!function e(t,o,i){function n(c,s){if(!o[c]){if(!t[c]){var r="function"==typeof require&&require;if(!s&&r)return r(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var y=o[c]={exports:{}};t[c][0].call(y.exports,function(e){var o=t[c][1][e];return n(o||e)},y,y.exports,e,t,o,i)}return o[c].exports}for(var a="function"==typeof require&&require,c=0;c"},Slash:{key:"/",shiftKey:"?"},Backquote:{key:"`",shiftKey:"~"},BracketLeft:{key:"[",shiftKey:"{"},Backslash:{key:"\\",shiftKey:"|"},BracketRight:{key:"]",shiftKey:"}"},Quote:{key:"'",shiftKey:'"'},IntlBackslash:{key:"\\",shiftKey:"|"}};o(f,"mac",{OSLeft:{key:"Meta"},OSRight:{key:"Meta"}});var v={Esc:"Escape",Nonconvert:"NonConvert",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Menu:"ContextMenu",MediaNextTrack:"MediaTrackNext",MediaPreviousTrack:"MediaTrackPrevious",SelectMedia:"MediaSelect",HalfWidth:"Hankaku",FullWidth:"Zenkaku",RomanCharacters:"Romaji",Crsel:"CrSel",Exsel:"ExSel",Zoom:"ZoomToggle"},k=function(e,t){var o={};return Object.keys(e).forEach(function(i){var n=e[i];t in n&&(o[n[t]]=n)}),o}(l,"code");try{var m=n&&"location"in new KeyboardEvent("")}catch(e){}"KeyboardEvent"in e&&"defineProperty"in Object&&function(){function e(e,t,o){t in e||Object.defineProperty(e,t,o)}if(e(KeyboardEvent.prototype,"code",{get:function(){var e=i(this);return e?e.code:""}}),"key"in KeyboardEvent.prototype){var t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,"key");Object.defineProperty(KeyboardEvent.prototype,"key",{get:function(){var e=t.get.call(this);return v.hasOwnProperty(e)?v[e]:e}})}e(KeyboardEvent.prototype,"key",{get:function(){var e=i(this);return e&&"key"in e?e.key:"Unidentified"}}),e(KeyboardEvent.prototype,"location",{get:function(){var e=i(this);return e&&"location"in e?e.location:a}}),e(KeyboardEvent.prototype,"locale",{get:function(){return""}})}(),"queryKeyCap"in e.KeyboardEvent||(e.KeyboardEvent.queryKeyCap=function(e,t){if(e=String(e),!k.hasOwnProperty(e))return"Undefined";if(t&&"en-us"!==String(t).toLowerCase())throw Error("Unsupported locale");var o=k[e];return o.keyCap||o.code||"Undefined"}),e.identifyKey=function(e){if(!("code"in e)){var t=i(e);e.code=t?t.code:"",e.key=t&&"key"in t?t.key:"Unidentified",e.location="location"in e?e.location:"keyLocation"in e?e.keyLocation:t&&"location"in t?t.location:a,e.locale=""}}}(window)},{}],5:[function(e,t,o){"use strict";t.exports=AFRAME.registerComponent("checkpoint-controls",{schema:{enabled:{default:!0},mode:{default:"teleport",oneOf:["teleport","animate"]},animateSpeed:{default:3}},init:function(){this.active=!0,this.checkpoint=null,this.isNavMeshConstrained=!1,this.offset=new THREE.Vector3,this.position=new THREE.Vector3,this.targetPosition=new THREE.Vector3},play:function(){this.active=!0},pause:function(){this.active=!1},setCheckpoint:function(e){var t=this.el;this.active&&this.checkpoint!==e&&(this.checkpoint&&t.emit("navigation-end",{checkpoint:this.checkpoint}),this.checkpoint=e,this.sync(),this.position.distanceTo(this.targetPosition)<.1?this.checkpoint=null:(t.emit("navigation-start",{checkpoint:e}),"teleport"===this.data.mode&&(this.el.setAttribute("position",this.targetPosition),this.checkpoint=null,t.emit("navigation-end",{checkpoint:e}),t.components["movement-controls"].updateNavLocation())))},isVelocityActive:function(){return!(!this.active||!this.checkpoint)},getVelocity:function(){if(this.active){var e=this.data,t=this.offset,o=this.position,i=this.targetPosition,n=this.checkpoint;return this.sync(),o.distanceTo(i)<.1?(this.checkpoint=null,this.el.emit("navigation-end",{checkpoint:n}),t.set(0,0,0)):(t.setLength(e.animateSpeed),t)}},sync:function(){var e=this.offset,t=this.position,o=this.targetPosition;t.copy(this.el.getAttribute("position")),o.copy(this.checkpoint.object3D.getWorldPosition()),o.add(this.checkpoint.components.checkpoint.getOffset()),e.copy(o).sub(t)}})},{}],6:[function(e,t,o){"use strict";var i=e("../../lib/GamepadButton"),n=e("../../lib/GamepadButtonEvent");t.exports=AFRAME.registerComponent("gamepad-controls",{GamepadButton:i,schema:{controller:{default:0,oneOf:[0,1,2,3]},enabled:{default:!0},debug:{default:!1},camera:{default:"[camera]",type:"selector"},rotationSensitivity:{default:2}},init:function(){var e=this.el.sceneEl;this.prevTime=window.performance.now(),this.buttons={};var t=this.el.object3D.rotation;this.pitch=new THREE.Object3D,this.pitch.rotation.x=THREE.Math.degToRad(t.x),this.yaw=new THREE.Object3D,this.yaw.position.y=10,this.yaw.rotation.y=THREE.Math.degToRad(t.y),this.yaw.add(this.pitch),e.addBehavior(this)},update:function(){this.tick()},tick:function(e,t){this.updateButtonState(),this.updateRotation(t)},remove:function(){},isVelocityActive:function(){if(!this.data.enabled||!this.isConnected())return!1;var e=this.getDpad(),t=this.getJoystick(0),o=e.x||t.x,i=e.y||t.y;return Math.abs(o)>.2||Math.abs(i)>.2},getVelocityDelta:function(){var e=this.getDpad(),t=this.getJoystick(0),o=e.x||t.x,i=e.y||t.y,n=new THREE.Vector3;return Math.abs(o)>.2&&(n.x+=o),Math.abs(i)>.2&&(n.z+=i),n},isRotationActive:function(){if(!this.data.enabled||!this.isConnected())return!1;var e=this.getJoystick(1);return Math.abs(e.x)>.2||Math.abs(e.y)>.2},updateRotation:function(e){if(this.isRotationActive()){var t=this.data,o=this.yaw,i=this.pitch,n=t.camera.components["look-controls"],a=n&&n.pitchObject&&n.yawObject;a&&(i.rotation.copy(n.pitchObject.rotation),o.rotation.copy(n.yawObject.rotation));var c=this.getJoystick(1);Math.abs(c.x)<=.2&&(c.x=0),Math.abs(c.y)<=.2&&(c.y=0),c.multiplyScalar(t.rotationSensitivity*e/1e3),o.rotation.y-=c.x,i.rotation.x-=c.y,i.rotation.x=Math.max(-Math.PI/2,Math.min(Math.PI/2,i.rotation.x)),t.camera.object3D.rotation.set(i.rotation.x,o.rotation.y,0),a&&(n.pitchObject.rotation.copy(i.rotation),n.yawObject.rotation.copy(o.rotation))}},updateButtonState:function(){var e=this.getGamepad();if(this.data.enabled&&e)for(var t=0;t.2?r.set(0,0,0):this.updateVelocity(n),c.constrainToNavMesh&&!1!==s.isNavMeshConstrained){if(r.lengthSq()<1e-5)return;e.copy(a.object3D.position),t.copy(r).multiplyScalar(n/1e3).add(e);var d=a.sceneEl.systems.nav;this.navGroup=null===this.navGroup?d.getGroup(e):this.navGroup,this.navNode=this.navNode||d.getNode(e,this.navGroup),this.navNode=d.clampStep(e,t,this.navGroup,this.navNode,o),a.object3D.position.copy(o)}else a.hasAttribute("velocity")?a.setAttribute("velocity",r):(a.object3D.position.x+=r.x*n/1e3,a.object3D.position.y+=r.y*n/1e3,a.object3D.position.z+=r.z*n/1e3)}}}}(),updateVelocityCtrl:function(){var e=this.data;if(e.enabled){for(var t=0,o=e.controls.length;t0&&(this.zVel=-1)}})},{}]},{},[1]);