(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{"7CyS":function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o}));var n=i("Womt"),s=i("VwSi");const a=30;function o(e,t){const i=t.interpolation===s.a.Spline?n.InterpolateSmooth:n.InterpolateLinear,o=[];return t.motion_data.forEach((t,r)=>{const l=e.get_bone(r);l&&t.tracks.forEach(({type:e,keyframes:t})=>{const c=[],h=[];for(const i of t)if(c.push(i.frame/a),e===s.b.Rotation){const e=l.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",t=(new n.Quaternion).setFromEuler(new n.Euler(i.value.x,i.value.y,i.value.z,e));h.push(t.x,t.y,t.z,t.w)}else h.push(i.value.x,i.value.y,i.value.z);if(e===s.b.Rotation)o.push(new n.QuaternionKeyframeTrack(`.bones[${r}].quaternion`,c,h,i));else{const t=e===s.b.Position?`.bones[${r}].position`:`.bones[${r}].scale`;o.push(new n.VectorKeyframeTrack(t,c,h,i))}})}),new n.AnimationClip("Animation",(t.frame_count-1)/a,o).optimize()}},Hdaq:function(e,t,i){"use strict";i.r(t);i("m5WL");var n=i("KUR2"),s=i("Womt"),a=i("iR5r"),o=i("Eqai"),r=i("488w"),l=i("7CyS"),c=i("Ftn7"),h=i("Tpfs");const m=i("rwco").c.get("viewer/rendering/Model3DRenderer"),_=new s.MeshLambertMaterial({color:16777215,side:s.DoubleSide}),d=new s.MeshLambertMaterial({skinning:!0,color:16777215,side:s.DoubleSide});class u extends c.a{constructor(e,t){super(e),this.model_3d_store=t,this.disposer=new h.a,this.clock=new s.Clock,this.update_animation_time=!0,this.camera=new s.PerspectiveCamera(75,1,1,200),this.nj_data_or_xvm_changed=()=>{this.mesh&&(this.scene.remove(this.mesh),this.mesh=void 0,this.scene.remove(this.skeleton_helper),this.skeleton_helper=void 0),this.animation&&(this.animation.mixer.stopAllAction(),this.mesh&&this.animation.mixer.uncacheRoot(this.mesh),this.animation=void 0);const e=this.model_3d_store.current_nj_data.val;if(e){const{nj_object:t,has_skeleton:i}=e;let n;const l=this.model_3d_store.current_textures.val.map(e=>{if(e)try{return Object(a.b)(e)}catch(e){m.error("Couldn't convert XVR texture.",e)}}).map(e=>e?new s.MeshBasicMaterial({skinning:i,map:e,side:s.DoubleSide,alphaTest:.1,transparent:!0}):new s.MeshLambertMaterial({skinning:i,side:s.DoubleSide}));n=i?Object(o.b)(Object(r.a)(t),l,d):Object(o.a)(Object(r.a)(t),l,_);const c=n.geometry.boundingBox,h=c.max.y-c.min.y;n.translateY(-h/2-c.min.y),this.mesh=n,this.scene.add(n),this.skeleton_helper=new s.SkeletonHelper(n),this.skeleton_helper.visible=this.model_3d_store.show_skeleton.val,this.skeleton_helper.material.linewidth=3,this.scene.add(this.skeleton_helper),this.reset_camera(new s.Vector3(0,10,20),new s.Vector3(0,0,0))}this.schedule_render()},this.nj_motion_changed=({value:e})=>{let t;this.animation&&(this.animation.mixer.stopAllAction(),t=this.animation.mixer);const i=this.model_3d_store.current_nj_data.val;if(!(this.mesh&&this.mesh instanceof s.SkinnedMesh&&e&&i))return;this.animation||(t=new s.AnimationMixer(this.mesh));const n=Object(l.b)(i.nj_object,e);this.animation={mixer:t,clip:n},this.clock.start(),this.animation.mixer.clipAction(this.animation.clip).play(),this.schedule_render()},this.show_skeleton_changed=({value:e})=>{this.skeleton_helper&&(this.skeleton_helper.visible=e,this.schedule_render())},this.animation_playing_changed=({value:e})=>{this.animation&&(this.animation.mixer.clipAction(this.animation.clip).paused=!e,e?(this.clock.start(),this.schedule_render()):this.clock.stop())},this.animation_frame_rate_changed=({value:e})=>{this.animation&&(this.animation.mixer.timeScale=e/l.a)},this.animation_frame_changed=({value:e})=>{const t=this.model_3d_store.current_nj_motion.val;if(this.animation&&t){const i=t.frame_count;e>i&&(e=1),e<1&&(e=i),this.update_animation_time&&(this.animation.mixer.clipAction(this.animation.clip).time=(e-1)/l.a),this.schedule_render()}},this.disposer.add_all(t.current_nj_data.observe(this.nj_data_or_xvm_changed),t.current_textures.observe(this.nj_data_or_xvm_changed),t.current_nj_motion.observe(this.nj_motion_changed),t.show_skeleton.observe(this.show_skeleton_changed),t.animation_playing.observe(this.animation_playing_changed),t.animation_frame_rate.observe(this.animation_frame_rate_changed),t.animation_frame.observe(this.animation_frame_changed)),this.init_camera_controls()}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}dispose(){super.dispose(),this.disposer.dispose()}render(){this.animation&&this.animation.mixer.update(this.clock.getDelta()),this.light_holder.quaternion.copy(this.camera.quaternion),super.render(),this.animation&&!this.animation.mixer.clipAction(this.animation.clip).paused&&(this.update_animation_frame(),this.schedule_render())}update_animation_frame(){if(this.animation){const e=this.animation.mixer.clipAction(this.animation.clip);e.paused||(this.update_animation_time=!1,this.model_3d_store.set_animation_frame(e.time*l.a+1),this.update_animation_time=!0)}}}var p=i("w6HN"),f=i("6cU9"),v=i("oyid"),b=i("PE7g"),w=i("7ZX1"),k=i("FXpb"),g=i("6Fug");class x extends g.a{constructor(e){super();const t=new f.a("Open file...",{icon_left:k.a.File,accept:".afs, .nj, .njm, .xj, .xvm"}),i=new v.a(!1,{label:"Show skeleton"}),n=new v.a(!0,{label:"Play animation"}),s=new b.a(l.a,{label:"Frame rate:",min:1,max:240,step:1}),a=new b.a(1,{label:"Frame:",min:1,max:e.animation_frame_count,step:1}),o=new w.a(e.animation_frame_count.map(e=>`/ ${e}`));this.toolbar=this.add(new p.a(t,i,n,s,a,o)),this.disposables(t.files.observe(({value:t})=>{t.length&&e.load_file(t[0])}),i.checked.observe(({value:t})=>e.set_show_skeleton(t)));const r=e.current_nj_motion.map(e=>null!=e);this.disposables(n.enabled.bind_to(r),n.checked.bind_to(e.animation_playing),n.checked.observe(({value:t})=>e.set_animation_playing(t)),s.enabled.bind_to(r),s.value.observe(({value:t})=>e.set_animation_frame_rate(t)),a.enabled.bind_to(r),a.value.bind_to(e.animation_frame.map(e=>Math.round(e))),a.value.observe(({value:t})=>e.set_animation_frame(t)),o.enabled.bind_to(r)),this.finalize_construction()}get element(){return this.toolbar.element}get height(){return this.toolbar.height}}i("8TW1");var y=i("zsIO");class j extends y.a{constructor(e,t,i){super(),this.models=e,this.selected=t,this.set_selected=i,this.element=Object(k.z)({className:"viewer_Model3DSelectListView"}),this.list_click=e=>{if(e.target instanceof HTMLLIElement&&e.target.dataset.index){this.selected_element&&this.selected_element.classList.remove("active"),e.target.classList.add("active");const t=parseInt(e.target.dataset.index,10);this.selected_element=e.target,this.set_selected(this.models[t])}},this.element.onclick=this.list_click,e.forEach((e,t)=>{this.element.append(Object(k.n)({data:{index:t.toString()}},e.name))}),this.disposables(t.observe(({value:e})=>{if(this.selected_element&&(this.selected_element.classList.remove("active"),this.selected_element=void 0),e&&e!==this.selected_model){const t=this.models.indexOf(e);-1!==t&&(this.selected_element=this.element.childNodes[t],this.selected_element.classList.add("active"))}},{call_now:!0})),this.finalize_construction()}set borders(e){e?(this.element.style.borderLeft="var(--border)",this.element.style.borderRight="var(--border)"):(this.element.style.borderLeft="none",this.element.style.borderRight="none")}}i.d(t,"Model3DView",(function(){return z}));const S=100,M=140;class z extends y.a{constructor(e,t,i){super(),this.gui_store=e,this.element=Object(k.h)({className:"viewer_Model3DView"}),this.tool_bar_view=this.add(new x(t)),this.model_list_view=this.add(new j(t.models,t.current_model,t.set_current_model)),this.animation_list_view=this.add(new j(t.animations,t.current_animation,t.set_current_animation)),this.renderer_view=this.add(new n.a(new u(i,t))),this.animation_list_view.borders=!0,this.element.append(this.tool_bar_view.element,Object(k.h)({className:"viewer_Model3DView_container"},this.model_list_view.element,this.animation_list_view.element,this.renderer_view.element)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){super.resize(e,t);const i=Math.max(0,t-this.tool_bar_view.height);return this.model_list_view.resize(S,i),this.animation_list_view.resize(M,i),this.renderer_view.resize(Math.max(0,e-S-M),i),this}}},VwSi:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return r}));var n=i("kwt4");const s=1296321870;var a,o;function r(e,t){return e.u32()===s?function(e,t){const i=e.u32();return l(e.take(i),t)}(e,t):(e.seek_start(0),function(e,t){e.seek_end(16);const i=e.u32();e.seek_start(i);const n=e.u32();return e.seek_start(n),function(e,t){e.seek(4);const i=e.u32();return e.seek_start(i),l(e,t)}(e,t)}(e,t))}function l(e,t){let i=e.u32();const n=e.u32(),s=e.u16(),a=e.u16(),r=(192&a)>>6,l=15&a,m=[];for(let a=0;a=i)return e.seek_start(a),m(e,t);o=n}return s}function m(e,t){const i=[];for(let s=0;s