From 9101fe5777687dbcf4e33a6811228e3b6a223656 Mon Sep 17 00:00:00 2001 From: bbohlender <85560643+bbohlender@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:11:37 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20pmndrs/x?= =?UTF-8?q?r@47d7a9ac83345aa7992fd77402bf7f831fd418d1=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mulate-DPamnAa0.js => emulate-BiDGoL_J.js} | 2 +- .../{index-CZrRNqy5.js => index-BcQysovk.js} | 2 +- examples/minecraft/index.html | 2 +- .../assets/emulate-C93hwdRN.js} | 2 +- .../{index-KkaVz-OQ.js => index-DxHPyL5Z.js} | 2 +- examples/pingpong/index.html | 2 +- .../assets/emulate-BJ1WIuRG.js} | 2 +- .../{index-BPIO8-Qx.js => index-B6JVeM_c.js} | 2 +- examples/rag-doll/index.html | 2 +- ...mulate-B3Stf41o.js => emulate-NBfH5vpj.js} | 2 +- .../{index-JGd9r4Iq.js => index-BNyAlFAk.js} | 2 +- examples/room-with-shadows/index.html | 2 +- examples/stage/assets/emulate-Cko4tTGd.js | 819 ++++++++++++++++++ examples/stage/assets/emulate-DM86Bhli.js | 819 ------------------ .../{index-Da-88g1w.js => index-BZrPM0HJ.js} | 2 +- examples/stage/index.html | 2 +- examples/watch/assets/emulate-B7RWhoU8.js | 819 ++++++++++++++++++ examples/watch/assets/emulate-BFmWTp6L.js | 819 ------------------ .../{index-Cajzeqhw.js => index-KwohaMom.js} | 4 +- examples/watch/index.html | 2 +- 20 files changed, 1655 insertions(+), 1655 deletions(-) rename examples/minecraft/assets/{emulate-DPamnAa0.js => emulate-BiDGoL_J.js} (99%) rename examples/minecraft/assets/{index-CZrRNqy5.js => index-BcQysovk.js} (99%) rename examples/{rag-doll/assets/emulate-plYy4mhx.js => pingpong/assets/emulate-C93hwdRN.js} (99%) rename examples/pingpong/assets/{index-KkaVz-OQ.js => index-DxHPyL5Z.js} (99%) rename examples/{pingpong/assets/emulate-D-6Vp1MH.js => rag-doll/assets/emulate-BJ1WIuRG.js} (99%) rename examples/rag-doll/assets/{index-BPIO8-Qx.js => index-B6JVeM_c.js} (99%) rename examples/room-with-shadows/assets/{emulate-B3Stf41o.js => emulate-NBfH5vpj.js} (99%) rename examples/room-with-shadows/assets/{index-JGd9r4Iq.js => index-BNyAlFAk.js} (99%) create mode 100644 examples/stage/assets/emulate-Cko4tTGd.js delete mode 100644 examples/stage/assets/emulate-DM86Bhli.js rename examples/stage/assets/{index-Da-88g1w.js => index-BZrPM0HJ.js} (99%) create mode 100644 examples/watch/assets/emulate-B7RWhoU8.js delete mode 100644 examples/watch/assets/emulate-BFmWTp6L.js rename examples/watch/assets/{index-Cajzeqhw.js => index-KwohaMom.js} (99%) diff --git a/examples/minecraft/assets/emulate-DPamnAa0.js b/examples/minecraft/assets/emulate-BiDGoL_J.js similarity index 99% rename from examples/minecraft/assets/emulate-DPamnAa0.js rename to examples/minecraft/assets/emulate-BiDGoL_J.js index 85211a0..f7f8781 100644 --- a/examples/minecraft/assets/emulate-DPamnAa0.js +++ b/examples/minecraft/assets/emulate-BiDGoL_J.js @@ -1,4 +1,4 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-CZrRNqy5.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-BcQysovk.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; diff --git a/examples/minecraft/assets/index-CZrRNqy5.js b/examples/minecraft/assets/index-BcQysovk.js similarity index 99% rename from examples/minecraft/assets/index-CZrRNqy5.js rename to examples/minecraft/assets/index-BcQysovk.js index 6f71d5d..94bef7b 100644 --- a/examples/minecraft/assets/index-CZrRNqy5.js +++ b/examples/minecraft/assets/index-BcQysovk.js @@ -4191,4 +4191,4 @@ No matching component was found for: `+A.vertexShader,A.vertexShader=A.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),A.fragmentShader=`varying float vFade; `+A.fragmentShader,A.fragmentShader=A.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function _8(g,A,I,C){if(!I.getEnabled()){g.visible=!1;return}g.visible=!0;const i=I.getIntersection(),B=typeof C.color=="function"?C.color(I):C.color;Array.isArray(B)?A.color.set(...B):A.color.set(B??"white"),A.opacity=typeof C.opacity=="function"?C.opacity(I):C.opacity??.4;let Q=C.maxLength??1;i!=null&&(Q=Math.min(Q,i.distance)),g.position.z=-Q/2;const e=C.size??.005;g.scale.set(e,e,Q),g.updateMatrix()}function P8(g,A,I,C,i,B={}){const Q=a=>{a.inputSource===I&&g.down(Object.assign(a,{button:B.button??0}))},e=a=>{a.inputSource===I&&g.up(Object.assign(a,{button:B.button??0}))},t=`${C}start`,E=`${C}end`,s=i.length;for(let a=0;a{A.removeEventListener(t,Q),A.removeEventListener(E,e)}}function Z8(g){var A;return g.getButtonsDown().size>0?.6:Fm(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.07,0,.2,.4)}function kD(g){return g.getButtonsDown().size>0?.6:.4}function W8(g){var A;return Fm(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.1,.03,.2,.6)}function Fm(g,A,I,C,i){return C+Math.max(0,Math.min(1,(g-A)/(I-A)))*(i-C)}function V8(g,A){return(I,C)=>{if(g===A)return I.identity(),!0;const i=typeof A=="function"?A():A;if(i==null)return!1;const B=C==null?void 0:C.getPose(g,i);return B==null?!1:(I.fromArray(B.transform.matrix),!0)}}function Rm(g,A,I){if(A==null){I.copy(g.matrixWorld);return}I.copy(A.matrixWorld).invert().multiply(g.matrixWorld)}function j8(g,A,I,C){C==null||C.copy(g.matrix);const i=Km(g,C);return i!=null||A==null||I==null?i:(C!=null&&Rm(g,A,C),I)}function Km({parent:g},A){if(g!=null)return A!=null&&A.premultiply(g.matrix),g.xrSpace??Km(g,A)}function X8(g,A,{anchors:I=!0,handTracking:C=!0,layers:i=!0,meshDetection:B=!0,planeDetection:Q=!0,originReferenceSpace:e="local-floor",customSessionInit:t,depthSensing:E=!1,hitTest:s=!0,unbounded:a=!0,domOverlay:r=!0}={}){if(t!=null)return t;const l=[e],D=[];return r instanceof Element&&(r=!0),nQ(I,"anchors",l,D),nQ(C,"hand-tracking",l,D),nQ(i,"layers",l,D),nQ(B,"mesh-detection",l,D),nQ(Q,"plane-detection",l,D),nQ(E,"depth-sensing",l,D),nQ(r,"dom-overlay",l,D),nQ(s,"hit-test",l,D),g!="immersive-vr"&&nQ(a,"unbounded",l,D),{requiredFeatures:l,optionalFeatures:D,domOverlay:{root:A}}}function nQ(g,A,I,C){if(g!==!1){if(g===!0){C.push(A);return}I.push(A)}}function le(g,A,I){return typeof g=="function"?g:(typeof g=="object"&&(A!=null&&z8(g,A)?g=g[A]:"default"in g&&(g=g.default)),g===!1?!1:g===!0?I:g??I)}function z8(g,A){return A in g}function Jm(g,A,I){return g??(g=I),g===!1?!1:typeof g=="function"?g:A!=null&&A in g?g[A]??I:"default"in g?g.default??I:g}const fm={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function pF(g,A){var I,C;Promise.all([(I=navigator.xr)==null?void 0:I.isSessionSupported("immersive-vr"),(C=navigator.xr)==null?void 0:C.isSessionSupported("immersive-ar")]).then(([i,B])=>!B&&!i?jq(()=>import("./emulate-DPamnAa0.js"),[]):void 0).then(i=>{A&&window.alert("emulator started"),i==null||i.emulate(g)})}function $8(g){const A="metaQuest3";let I;{window.location.hostname==="localhost"&&pF(A,!1);const r=l=>{l.altKey&&l.metaKey&&l.code==="KeyE"&&pF(A,!0)};window.addEventListener("keydown",r),I=()=>window.removeEventListener("keydown",r)}const C=(g==null?void 0:g.domOverlay)instanceof HTMLElement?g.domOverlay:document.createElement("div"),i=Xq(()=>({...fm,controller:g==null?void 0:g.controller,hand:g==null?void 0:g.hand,gaze:g==null?void 0:g.gaze,screenInput:g==null?void 0:g.screenInput,transientPointer:g==null?void 0:g.transientPointer,detectedMesh:g==null?void 0:g.detectedMesh,detectedPlane:g==null?void 0:g.detectedPlane,domOverlayRoot:C}));let B;if(C.parentNode==null){const r=D=>{C.style.display=D.session!=null?"block":"none"},l=i.subscribe(r);r(i.getState()),document.body.appendChild(C),B=()=>{C.remove(),l()}}document.body.append(C);const Q=H8({controller:r=>i.setState({controllerStates:[...i.getState().controllerStates,r]})},g),e=C1(i,Q),t=g1(g==null?void 0:g.enterGrantedSession,r=>gc(C,r,g,a));let E;const s=[];let a;return Object.assign(i,{requestFrame(){return new Promise(r=>s.push(r))},setWebXRManager(r){if(a===r)return;a=r;const{foveation:l,originReferenceSpace:D="local-floor"}={};r.setReferenceSpaceType(D),l!=null&&r.setFoveation(l),E==null||E(),E=I1(r,e)},setFrameRate(r){const{session:l}=i.getState();l!=null&&qm(l,r)},setHand(r,l){if(l==null){i.setState({hand:r});return}const D=i.getState().hand,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({hand:w})},setController(r,l){if(l==null){i.setState({controller:r});return}const D=i.getState().controller,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({controller:w})},setTransientPointer(r,l){if(l==null){i.setState({transientPointer:r});return}const D=i.getState().transientPointer,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({transientPointer:w})},setGaze(r){i.setState({gaze:r})},setScreenInput(r){i.setState({screenInput:r})},setDetectedPlane(r,l){if(l==null){i.setState({detectedPlane:r});return}const D=i.getState().detectedPlane,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({detectedPlane:w})},setDetectedMesh(r,l){if(l==null){i.setState({detectedMesh:r});return}const D=i.getState().detectedMesh,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({detectedMesh:w})},destroy(){I==null||I(),B==null||B(),E==null||E(),t==null||t(),e(void 0,void 0)},enterXR:r=>gc(C,r,g,a),enterAR:()=>gc(C,"immersive-ar",g,a),enterVR:()=>gc(C,"immersive-vr",g,a),onBeforeFrame(r,l,D){const{origin:w}=i.getState(),S=l.parent??r,c=(a==null?void 0:a.getReferenceSpace())??void 0;w!=S&&(S.xrSpace=c,i.setState({origin:S}));const{originReferenceSpace:G}=i.getState();if(c!=G&&(S.xrSpace=c,i.setState({originReferenceSpace:c})),D==null)return;a!=null&&i1(i,D,a);const u=s.length;for(let M=0;M component?"));const i=await navigator.xr.requestSession(A,X8(A,g,I));return qm(i,"high"),A1(C,i),i}function A1(g,A,I){g!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(A),g==null||g.setSession(A))}const UF=["immersive-ar","immersive-vr","inline"];function I1(g,A){const I=()=>{const C=g.getSession();A(C,C.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return g.addEventListener("sessionstart",I),()=>g.removeEventListener("sessionstart",I)}function g1(g=UF,A){var C;if(g===!1)return;g===!0&&(g=UF);const I=async()=>{var i;for(const B of g)await((i=navigator.xr)==null?void 0:i.isSessionSupported(B))&&A(B)};return(C=navigator.xr)==null||C.addEventListener("sessiongranted",I),()=>{var i;return(i=navigator.xr)==null?void 0:i.removeEventListener("sessiongranted",I)}}function C1(g,A){let I;return(C,i)=>{if(I==null||I(),C==null||i==null)return;const B=t=>g.setState(A(t.session,g.getState(),t.added,t.removed));C.addEventListener("inputsourceschange",B);const Q=()=>g.setState({frameRate:C.frameRate,visibilityState:C.visibilityState}),e=()=>{I==null||I(),I=void 0,g.setState(fm)};C.addEventListener("end",e),C.addEventListener("frameratechange",Q),C.addEventListener("visibilitychange",Q),g.setState({...A(C,void 0,C.inputSources,void 0),frameRate:C.frameRate,visibilityState:C.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:i,session:C}),I=()=>{A(C,g.getState(),void 0,"all"),C.removeEventListener("end",e),C.removeEventListener("frameratechange",Q),C.removeEventListener("visibilitychange",Q),C.removeEventListener("inputsourceschange",B)}}}function i1(g,A,I){const C=I.getReferenceSpace(),{detectedMeshes:i,detectedPlanes:B,session:Q,controllerStates:e,handStates:t}=g.getState();if(C==null||Q==null)return;const E=NF(B,A.detectedPlanes),s=NF(i,A.detectedMeshes);(B!=E||i!=s)&&g.setState({detectedPlanes:E,detectedMeshes:s});const a=e.length;for(let l=0;l{I instanceof Qg&&I.material instanceof ag&&(I.material.colorWrite=(A==null?void 0:A.colorWrite)??!0)})}function E1(g,A,I){const C=[];for(const i in A.components){const B=A.components[i];let Q=I[i];Q==null&&(I[i]=Q={state:"default"}),C.push(...Object.values(B.visualResponses).map(e=>o1(g,Q,e)))}return()=>{const i=C.length;for(let B=0;B{};if(I.valueNodeProperty==="visibility")return()=>C.visible=I.states.includes(A.state);const i=g.getObjectByName(I.minNodeName),B=g.getObjectByName(I.maxNodeName);return i==null||B==null?()=>{}:()=>{const Q=n1(A,I);C.quaternion.slerpQuaternions(i.quaternion,B.quaternion,Q),C.position.lerpVectors(i.position,B.position,Q),C.updateMatrix()}}function n1(g,{componentProperty:A,states:I}){const C=I.includes(g.state);switch(A){case"xAxis":return C?FF(g).x:.5;case"yAxis":return C?FF(g).y:.5;case"button":return C?g.button??0:0;case"state":return C?1:0}}const $n=new cA;function FF({xAxis:g=0,yAxis:A=0}){if($n.lengthSq()>1){const C=Math.atan2(A,g);$n.set(Math.cos(C),Math.sin(C))}else $n.set(g,A);return $n.multiplyScalar(.5).addScalar(.5),$n}function s1({_listeners:g,__r3f:A}){return g!=null&&Object.keys(g).length>0||A!=null&&(A==null?void 0:A.eventCount)>0}function a1({_listeners:g,__r3f:A},I){if(g!=null&&I in g)return g[I];if(A==null)return;const C=A.handlers[r1[I]];if(C!=null)return[C]}const r1={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class WC{constructor(A,I,C,i,B,Q=B.object,e=Q){FI(this,"type");FI(this,"bubbles");FI(this,"nativeEvent");FI(this,"pointer");FI(this,"intersection");FI(this,"currentObject");FI(this,"object");FI(this,"stopPropagation");FI(this,"stopImmediatePropagation");this.type=A,this.bubbles=I,this.nativeEvent=C,this.pointer=i,this.intersection=B,this.currentObject=Q,this.object=e}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new WC(I,C,i,B,Q,A,e)}}class ed extends WC{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(A,I,C,i,B){super("wheel",!0,A,I,C,i,B)}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new ed(i,B,Q,A,e)}}function bi(g){mm(g,g.currentObject)}function mm(g,A){if(A==null)return;const I=a1(A,g.type);let C=!g.bubbles;if(I!=null&&I.length>0){const i=g.retarget(A),B=I.length;i.stopPropagation=()=>C=!0;let Q=!1;i.stopImmediatePropagation=()=>{C=!0,Q=!0};for(let e=0;e=0;e--){const t=this.pointerEnteredHelper[e];bi(new WC("pointerenter",!1,A,this,C,t))}if(C!=null&&bi(new WC("pointermove",!0,A,this,C)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;tC){e.set(A.button,A.timeStamp);return}bi(new WC("dblclick",!0,A,this,this.intersection)),e.delete(A.button)}cancel(A){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,A));return}this.intersection!=null&&bi(new WC("pointercancel",!0,A,this,this.intersection))}}wheel(A,I,C){if(!this.enabled)return;let i=this.intersection;if(C||(i=this.computeIntersection(A,I,this.pointerCapture)),!this.wasMoved&&C){this.onFirstMove.push(this.cancel.bind(this,I));return}i!=null&&bi(new ed(I,this,i))}exit(A){var I;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,A));return}this.pointerCapture!=null&&((I=this.parentReleasePointerCapture)==null||I.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(A)}}function Lm(g,A,I,C){if(g==null)return;const i=I.indexOf(g);i!=-1?I.splice(i,1):C.push(g),A.push(g),Lm(g.parent,A,I,C)}function l1(g,A,I,C,i){if(A==null)return!1;const B=A.get(I);return!(B==null||C-B>i||B!=g.get(I))}function od(g,A,I){return A.face==null?!1:(g.setFromNormalAndCoplanarPoint(A.face.normal,A.localPoint),g.applyMatrix4(I.matrixWorld),!0)}function c1(g,A,I,C,i,B){if(A==="none"||A==="listener"&&!g)return!1;if(I==="all")return!0;if(typeof I=="function")return I(C,i,B);let Q,e;"deny"in I?(e=!0,Q=I.deny):(e=!1,Q=I.allow);let t;return Array.isArray(Q)?t=Q.includes(i):t=Q===i,e?!t:t}function Ph(g,A,I,C,i,B=!1,Q,e,t){const E=B||s1(g),s=g.pointerEvents??Q,a=g.pointerEventsType??e,r=g.pointerEventsOrder??t;c1(E,s??"listener",a??"all",A,I,C)&&i(g,r);const D=g.children.length;for(let w=0;w0)&&(g=E,Q=t)}return Q}function D1(g,A=0,I,C=0){return A!=C?C-A:g.distance-I.distance}const aQ=new qa,h1=new bA,$E=[];function S1(g,A,I,C,i,B,Q,e){if(Q!=null)return w1(g,A,Q);let t,E;if(Ph(I,C,i,B,(s,a)=>{let r=0;const l=((t==null?void 0:t.details.lineIndex)??A.length-2)+2;for(let D=1;D0;C--){const i=A[C-1],B=A[C];if(LG.origin.copy(i).applyMatrix4(g),LG.direction.copy(B).applyMatrix4(g).sub(aQ.ray.origin).normalize(),LG.intersectPlane(I,KF)!=null)return KF.clone()}}const HG=new qa,TG=new f,JF=new GB,y1=new bA,Cc=[];function u1(g,A,I,C,i,B,Q,e,t){if(e!=null)return k1(g,A,I,e);let E,s;if(HG.ray.origin.copy(g),HG.ray.direction.copy(I).applyQuaternion(A),Ph(C,i,B,Q,(a,r)=>{a.raycast(HG,Cc);const l=nd(E,s,Cc,r,t);l!=null&&(E=Cc[l],s=r),Cc.length=0}),E!=null)return Object.assign(E,{details:{type:"ray"},pointerPosition:g.clone(),pointerQuaternion:A.clone(),pointOnFace:E.point,localPoint:E.point.clone().applyMatrix4(y1.copy(E.object.matrixWorld).invert())})}const fF=new Te;function k1(g,A,I,{intersection:C,object:i}){if(C.details.type!="ray")return;TG.copy(I).applyQuaternion(A),fF.set(g,TG),od(JF,C,i);const B=fF.intersectPlane(JF,new f)??C.point;return{...C,object:i,pointOnFace:B,point:TG.clone().multiplyScalar(C.distance).add(g),pointerPosition:g.clone(),pointerQuaternion:A.clone()}}const xG=new jg,ic=[];function Hm(g,A,I,C,i,B,Q,e,t){if(e!=null)return p1(g,A,e);let E,s;if(xG.center.copy(g),xG.radius=I,Ph(C,i,B,Q,(a,r)=>{d1(xG,a,ic);const l=nd(E,s,ic,r,t);l!=null&&(E=ic[l],s=r),ic.length=0}),E!=null)return Object.assign(E,{details:{type:"sphere"},pointOnFace:E.point,pointerPosition:g.clone(),pointerQuaternion:A.clone(),localPoint:E.point.clone().applyMatrix4(MD.copy(E.object.matrixWorld).invert())})}const Bc=new bA;function M1(g){return"spherecast"in g}function d1(g,A,I){if(A.updateWorldMatrix(!0,!1),M1(A)){A.spherecast(g,I);return}if(A instanceof Na){A.geometry.boundingSphere==null&&A.geometry.computeBoundingSphere(),A.geometry.boundingBox==null&&A.geometry.computeBoundingBox();for(let i=0;ig.radius*g.radius)return;vG.max(U1);const Q=No.center.clone().sub(HF);Q.divide(vG),N1(Q);const e=Qc.clone();return{distance:Math.sqrt(B),face:{a:0,b:0,c:0,materialIndex:0,normal:Q},normal:Q,point:e,instanceId:C,object:A}}function N1(g){const A=Math.abs(g.x),I=Math.abs(g.y),C=Math.abs(g.z);if(A>=I&&A>=C){g.set(g.x<0?-1:1,0,0);return}if(I>=A&&I>=C){g.set(0,g.y<0?-1:1,0);return}g.set(0,0,g.z<0?-1:1)}const Ru={radius:.07};function F1(g,A,I=Ru,C="grab"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s!=null)return s.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),Hm(i,B,I.radius??Ru.radius,e,Q,C,A,E,I)},void 0,void 0,void 0,I)}const R1=new f(0,0,-1),K1=new f,rs={direction:R1,minDistance:0,linePoints:null};function J1(g,A,I=rs,C="ray"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s==null)return;s.updateWorldMatrix(!0,!1);let a;const r=I.linePoints??rs.linePoints;if(r==null?(i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),a=u1(i,B,I.direction??rs.direction,e,Q,C,A,E,I)):a=S1(s.matrixWorld,r,e,Q,C,A,E,I),!(a==null||a.distance*s.getWorldScale(K1).x<(I.minDistance??rs.minDistance)))return a},void 0,void 0,void 0,I)}const Fo={button:0,downRadius:.03,hoverRadius:.1};function f1(g,A,I=Fo,C="touch"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s!=null)return s.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),Hm(i,B,I.hoverRadius??Fo.hoverRadius,e,Q,C,A,E,I)},q1(I),void 0,void 0,I)}function q1(g=Fo){let A=!1;return I=>{if(!I.getEnabled())return;const C=I.getIntersection(),i=m1(C,g.downRadius??Fo.downRadius);if(i===A)return;const B={timeStamp:performance.now(),button:g.button??Fo.button};i?I.down(B):I.up(B),A=i}}function m1(g,A){return g==null?!1:g.distance<=A}let Y1=23412;function sd(){return Y1++}new f;new cA;let L1=class{constructor(){FI(this,"pointers",[]);FI(this,"isDefaults",[]);FI(this,"enabled",!0)}register(A,I){return this.pointers.push(A),this.isDefaults.push(I),this.unregister.bind(this,A)}unregister(A){const I=this.pointers.indexOf(A);I!==-1&&(this.isDefaults.splice(I,1),this.pointers.splice(I,1))}move(A,I){var Q,e;if(!this.enabled)return;const C=this.pointers.length;if(C===0)return;for(let t=0;t=g.lastChangedTime)return A;const I=new cI;return I.setIndex(new oI(g.indices,1)),I.setAttribute("position",new oI(g.vertices,3)),Object.assign(I,{creationTime:g.lastChangedTime})}function vF(g,A){return A!=null&&A.createdAt!=null&&A.createdAt>=g.lastChangedTime?A:Object.assign(H1(g.polygon),{createdAt:g.lastChangedTime})}const Is=new Dq,ec=new cA;function H1(g){const A=new Ne,I=g.map(({x:i,z:B})=>new cA(i,B));Is.setFromPoints(I),Is.getSize(ec);for(const i of I)i.sub(Is.min),i.divide(ec);A.setFromPoints(I);const C=new Ja(A);return C.scale(ec.x,ec.y,1),C.translate(Is.min.x,Is.min.y,0),C.rotateX(Math.PI/2),C}new f;new f;new f;const gs=new DC(0,0,0,"YXZ"),tc=new $I;function T1(g,A,I){g.matrixWorld.decompose(A.position,tc,A.scale),gs.setFromQuaternion(tc),gs.z=0,gs.x=Kc(gs.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),tc.setFromEuler(gs),A.quaternion.slerp(tc,I/100)}function x1(g){return g.userData.teleportTarget===!0}function v1(g={}){return A=>!(!x1(A.object)||g.customFilter!=null&&!g.customFilter(A))}function b1(){return new gh(new f(0,0,0),new f(0,0,-8),new f(0,-20,-15)).getPoints(20)}let O1=class extends Qg{constructor(I){const C=new zP,i=new Float32Array(I.length*3);for(let e=0;ee.distanceTo(I[t+1]))}update(I){if(!I.getEnabled()||I.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const i=I.getIntersection();if((i==null?void 0:i.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:B,lineIndex:Q}=i.details,e=this.lineLengths[Q];this.material.visibility=this.multiplier*(Q+B/e)/this.lineLengths.length;const{color:t="white",opacity:E=.4,size:s=.01}=this.options;this.material.lineWidth=s,this.material.opacity=typeof E=="function"?E(I):E;const a=typeof t=="function"?t(I):t;Array.isArray(a)?this.material.color.set(...a):this.material.color.set(a)}};const Ec=new bA,oc=new f,bF=new $I;async function _1(g,A,I=["point","plane","mesh"]){var t,E;let C,i,B;const Q=g.getState();if(A instanceof XRSpace)i=A,B=Q.origin;else{if(Q.originReferenceSpace==null)return;B=A,i=j8(A,Q.origin,Q.originReferenceSpace,Ec)??Q.originReferenceSpace,i===Q.originReferenceSpace&&Rm(A,Q.origin,Ec),oc.setFromMatrixPosition(Ec);const s={...oc};bF.setFromRotationMatrix(Ec),oc.set(0,0,-1).applyQuaternion(bF);const a={...oc};C=new XRRay(s,a)}const e=await((E=(t=g.getState().session)==null?void 0:t.requestHitTestSource)==null?void 0:E.call(t,{space:i,entityTypes:Array.isArray(I)?I:[I],offsetRay:C}));if(e!=null)return{source:e,getWorldMatrix:P1.bind(null,i,B)}}function P1(g,A,I,C){const i=C.getPose(g);return i==null?!1:(I.fromArray(i.transform.matrix),A!=null&&I.premultiply(A.matrixWorld),!0)}new f(1,1,1);new f(1,1,1);new bA;new bA;new f;new f;const Tm=new OW,xm="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",Z1="generic-trigger";class W1{constructor(A){FI(this,"baseAssetPath");FI(this,"defaultProfileId");FI(this,"profilesListPromise");FI(this,"profilePromisesMap",new Map);FI(this,"loadAsync",this.load);this.baseAssetPath=(A==null?void 0:A.baseAssetPath)??xm,this.defaultProfileId=(A==null?void 0:A.defaultControllerProfileId)??Z1}async load(A,I){const C=await this.loadProfile(A);for(const i in C.layouts)if(i.includes(I))return C.layouts[i];throw new Error(`No matching layout for "${I}", in profile ${C.profileId} with layouts ${Object.keys(C.layouts).join(", ")}.`)}async loadProfile(A){this.profilesListPromise??(this.profilesListPromise=OF(new URL("profilesList.json",this.baseAssetPath).href));const I=await this.profilesListPromise,C=A.length;for(let B=0;Bg.visibilityState)}function $1(g,A){const I=x.useRef(A);I.current=A;const[C,i]=x.useMemo(()=>{let B;return[Q=>{let e=!1;return navigator.xr==null?(B=!1,()=>{}):(navigator.xr.isSessionSupported(g).then(t=>{B=t,!e&&Q()}).catch(t=>{var E;e||(E=I.current)==null||E.call(I,t)}),()=>e=!0)},()=>B]},[g]);return x.useSyncExternalStore(C,i)}x.forwardRef(({id:g,children:A,onPress:I,onRelease:C},i)=>{const B=ad(),[Q,e]=x.useState(void 0);if(x.useImperativeHandle(i,()=>Q,[Q]),AV(g,t=>t==="pressed"?I==null?void 0:I():C==null?void 0:C()),BC(()=>{var t;return e((t=B.gamepad[g])==null?void 0:t.object)}),Q!=null)return aM(A,Q)});function AV(g,A,I){const C=ad(),i=x.useRef();BC(()=>{var Q;const B=(Q=C==null?void 0:C.gamepad[g])==null?void 0:Q.state;B!=null&&B!=i.current&&A(B),i.current=B})}function ad(g){const A=x.useContext(zB);if(A==null||A.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return A}const IV=Symbol("loadXRControllerModel"),gV=x.forwardRef((g,A)=>{const I=ad(),C=Sh(e1,[I.layout,void 0,IV]);t1(C,g),I.object=C,x.useImperativeHandle(A,()=>C,[C]);const i=x.useMemo(()=>E1(C,I.layout,I.gamepad),[C,I.layout,I.gamepad]);return BC(i),$.jsx("primitive",{object:C})});function rd(g){const A=x.useContext(zB);if(A==null||A.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return A}const CV=Symbol("loadXRHandModel"),iV=x.forwardRef((g,A)=>{const I=rd(),C=Sh(R8,[I.assetPath,void 0,CV]);K8(C,g),x.useImperativeHandle(A,()=>C,[C]);const i=pV(),B=x.useMemo(()=>m8(I.inputSource.hand,C,i),[I.inputSource,C,i]);return BC((Q,e,t)=>B(t)),$.jsx("primitive",{object:C})});x.forwardRef(({joint:g,children:A},I)=>{const C=rd();return $.jsx(eB,{ref:I,space:C.inputSource.hand.get(g),children:A})});function Pm({children:g}){const A=x.useMemo(()=>new L1,[]);return Wm(A),BC(I=>A.move(I.scene,{timeStamp:performance.now()}),-50),$.jsx(_m.Provider,{value:A,children:g})}function BV(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,Ru,I);const B=x.useMemo(()=>F1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}function Zm(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,rs,I);const B=x.useMemo(()=>J1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}function QV(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,Fo,I);const B=x.useMemo(()=>f1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}const eV=x.forwardRef((g,A)=>{const I=x.useMemo(()=>new O8,[]),C=x.useRef(null);return x.useImperativeHandle(A,()=>C.current,[]),BC(()=>C.current!=null&&_8(C.current,I,g.pointer,g)),$.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:g.renderOrder??2,ref:C,material:I,children:$.jsx("boxGeometry",{})})}),Zh=x.forwardRef((g,A)=>{const I=x.useMemo(()=>new x8,[]),C=x.useRef(null);x.useImperativeHandle(A,()=>C.current,[]),BC(()=>C.current!=null&&b8(C.current,I,g.pointer,g));const i=ui(B=>B.scene);return aM($.jsx("mesh",{renderOrder:g.renderOrder??1,ref:C,matrixAutoUpdate:!1,material:I,children:$.jsx("planeGeometry",{})}),i)});function ld(g,A,I,C){const i=fg(B=>B.session);x.useEffect(()=>{if(i!=null)return P8(g,i,A,I,C)},[I,A,g,i,C])}function cd(g,A=!1){const I=x.useContext(_m);I==null?(Wm(g),BC(C=>g.move(C.scene,{timeStamp:performance.now()}),-50)):x.useEffect(()=>I.register(g,A),[I,g,A]),x.useEffect(()=>()=>g.exit({timeStamp:performance.now()}),[g])}function Wm(g){const A=Dd();x.useEffect(()=>T8(A,I=>g.setEnabled(I,{timeStamp:performance.now()})),[A,g])}const tV=x.forwardRef(({pointer:g,linePoints:A,...I},C)=>{const i=x.useMemo(()=>new O1(A),[A]);return x.useImperativeHandle(C,()=>i,[i]),i.options=I,BC(()=>i.update(g)),$.jsx("primitive",{object:i})});function Vm(g,A,I){const C=x.useContext(zB);if(C==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const i=x.useRef(null),B=BV(i,C,I);ld(B,C.inputSource,g,C.events);const Q=I.cursorModel;return $.jsx(eB,{ref:i,space:A(C.inputSource),children:Q!==!1&&$.jsx(Zh,{pointer:B,opacity:Z8,...uC(Q)})})}const EV=Vm.bind(null,"select",g=>g.hand.get("index-finger-tip")),oV=Vm.bind(null,"squeeze",g=>g.gripSpace);function Oa(g){const A=x.useContext(zB);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=x.useRef(null),C=Zm(I,A,g);ld(C,A.inputSource,"select",A.events);const i=g.rayModel,B=g.cursorModel;return $.jsxs(eB,{ref:I,space:A.inputSource.targetRaySpace,children:[i!==!1&&$.jsx(eV,{pointer:C,opacity:kD,...uC(i)}),B!==!1&&$.jsx(Zh,{pointer:C,opacity:kD,...uC(B)})]})}function nV(g){const A=rd(),I=x.useRef(null),C=QV(I,A,g),i=g.cursorModel;return $.jsx(eB,{ref:I,space:A.inputSource.hand.get("index-finger-tip"),children:i!==!1&&$.jsx(Zh,{pointer:C,opacity:W8,...uC(i)})})}function sV(g){const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.teleportPointer??!1;return $.jsxs($.Fragment,{children:[A!==!1&&$.jsx(x.Suspense,{children:$.jsx(gV,{...uC(A)})}),$.jsxs(Pm,{children:[I!==!1&&$.jsx(oV,{...uC(I)}),C!==!1&&$.jsx(Oa,{makeDefault:!0,minDistance:.2,...uC(C)}),i!==!1&&$.jsx(jm,{...uC(i)})]})]})}function aV(g){var e;const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.touchPointer,B=g.teleportPointer??!1,Q=C===!1?!1:(e=uC(C))==null?void 0:e.rayModel;return $.jsxs($.Fragment,{children:[A!==!1&&$.jsx(x.Suspense,{children:$.jsx(iV,{...uC(A)})}),$.jsxs(Pm,{children:[I!==!1&&$.jsx(EV,{...uC(I)}),i!==!1&&$.jsx(nV,{...uC(i)}),C!==!1&&$.jsx(Oa,{makeDefault:!0,minDistance:.2,...uC(C),rayModel:Q===!1?!1:{maxLength:.2,...uC(Q)}}),B!==!1&&$.jsx(jm,{...uC(B)})]})]})}function rV(g){return $.jsx(Oa,{...g,rayModel:!1})}function lV(g){return $.jsx(Oa,{...g,rayModel:!1})}function cV(g){return $.jsx(Oa,{...g,cursorModel:!1,rayModel:!1})}function jm(g){const A=x.useContext(zB);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=x.useRef(null),C=x.useRef(null),i=x.useMemo(()=>b1(),[]),B=Zm(C,A,{...g,linePoints:i,customFilter:v1(g)},"teleport");ld(B,A.inputSource,"select",A.events);const Q=g.rayModel,e=g.cursorModel,t=ui(s=>s.scene),E=x.useRef(null);return BC((s,a)=>{E.current!=null&&(E.current.visible=B.getEnabled()&&B.getButtonsDown().size>0);const r=C.current,l=I.current;r==null||l==null||T1(l,r,a*1e3)}),$.jsxs($.Fragment,{children:[$.jsx(eB,{ref:I,space:A.inputSource.targetRaySpace}),aM($.jsxs("group",{ref:C,children:[Q!==!1&&$.jsx(tV,{linePoints:i,pointer:B,opacity:kD,...uC(Q)}),e!==!1&&$.jsx(Zh,{ref:E,pointer:B,opacity:kD,...uC(e)})]}),t)]})}function uC(g){if(g!==!0)return g}function DV({children:g}){const A=fg(Q=>Q.originReferenceSpace),I=fg(Q=>Q.origin),C=z1()==="visible",i=Ya(),B=x.useMemo(()=>Object.assign({},i,{getState(){return{...i.getState(),scene:I}}}),[I,i]);return I==null||A==null?null:$.jsx($.Fragment,{children:vo.createPortal($.jsx(wh.Provider,{value:i,children:$.jsxs(ba.Provider,{value:A,children:[$.jsxs("group",{matrixAutoUpdate:!1,visible:C,children:[$.jsx(hV,{}),$.jsx(SV,{}),$.jsx(wV,{}),$.jsx(GV,{}),$.jsx(yV,{})]}),$.jsx(uV,{}),$.jsx(kV,{}),g]})}),B,null)})}function hV(){const g=fg(I=>I.controllerStates);let A=fg(I=>I.controller);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.gripSpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(sV,{...C})})})},tE(I))})})}function SV(){const g=fg(I=>I.handStates),A=fg(I=>I.hand);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.hand.get("wrist"),children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(aV,{...C})})})},tE(I))})})}function wV(){const g=fg(I=>I.transientPointerStates),A=fg(I=>I.transientPointer);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(rV,{...C})})})},tE(I))})})}function GV(){const g=fg(I=>I.gazeStates),A=fg(I=>I.gaze);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof A=="function"?$.jsx(A,{}):$.jsx(lV,{...Xm(A)})})})},tE(I)))})}function yV(){const g=fg(I=>I.screenInputStates),A=fg(I=>I.screenInput);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof A=="function"?$.jsx(A,{}):$.jsx(cV,{...Xm(A)})})})},tE(I)))})}function Xm(g){if(g!==!0)return g}function uV(){const g=fg(I=>I.detectedMeshes),A=fg(I=>I.detectedMesh);if(A!==!1)return $.jsx($.Fragment,{children:g.map(I=>{const C=Jm(A,I.semanticLabel,!1);return C===!1?null:$.jsx(eB,{space:I.meshSpace,children:$.jsx(bm.Provider,{value:I,children:$.jsx(x.Suspense,{children:$.jsx(C,{})})})},tE(I))})})}function kV(){const g=fg(I=>I.detectedPlanes),A=fg(I=>I.detectedPlane);if(A!=null)return $.jsx($.Fragment,{children:g.map(I=>{const C=Jm(A,I.semanticLabel,!1);return C===!1?null:$.jsx(eB,{space:I.planeSpace,children:$.jsx(Om.Provider,{value:I,children:$.jsx(x.Suspense,{children:$.jsx(C,{})})})},tE(I))})})}function MV(g){return $8(g)}function dV({children:g,store:A}){A.setWebXRManager(ui(C=>C.gl.xr));const I=Ya();return x.useEffect(()=>{let C;return A.subscribe((i,B)=>{const Q=i.mode!=null,e=B.mode!=null;if(Q!==e){if(Q){const{camera:t,gl:E}=I.getState();C=t,I.setState({camera:E.xr.getCamera()});return}C!=null&&I.setState({camera:C})}})},[I,A]),BC((C,i,B)=>A.onBeforeFrame(C.scene,C.camera,B),-1e3),$.jsxs(vm.Provider,{value:A,children:[$.jsx(DV,{}),g]})}function Dd(){const g=x.useContext(vm);if(g==null)throw new Error("XR features can only be used inside the component");return g}function fg(g=A=>A){return hM(Dd(),g)}const eB=x.forwardRef(({space:g,children:A},I)=>{const C=x.useRef(null);return x.useImperativeHandle(I,()=>C.current,[]),NV(C,g,(i,B,Q)=>{C.current!=null&&(C.current.visible=Q!=null)}),$.jsx("group",{xrSpace:g,visible:!1,matrixAutoUpdate:!1,ref:C,children:$.jsx(ba.Provider,{value:g,children:A})})});function pV(){const g=x.useContext(ba);if(g==null)throw new Error("XR objects must be placed inside the XROrigin");return g}function UV(g){const A=x.useContext(ba),I=fg(C=>A??C.originReferenceSpace);return x.useMemo(()=>I==null?void 0:V8(g,I),[g,I])}function NV(g,A,I){const C=UV(A);BC((i,B,Q)=>{g.current==null||C==null||(C(g.current.matrix,Q),I==null||I(i,B,Q))},-100)}x.forwardRef((g,A)=>{const I=FV(),C=RV(I);return $.jsx("mesh",{ref:A,geometry:C,...g})});function FV(){const g=x.useContext(bm);if(g==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return g}function RV(g,A=!0){const[I,C]=x.useState(xF(g,void 0));return BC(()=>C(i=>xF(g,i))),x.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}x.forwardRef((g,A)=>{const I=KV(),C=JV(I);return $.jsx("mesh",{ref:A,geometry:C,...g})});function KV(){const g=x.useContext(Om);if(g==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return g}function JV(g,A=!0){const[I,C]=x.useState(vF(g,void 0));return BC(()=>C(i=>vF(g,i))),x.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}function fV(g,A){const I=fg(C=>C.mode);return A!=null?Array.isArray(A)?!A.includes(I):A!=I:g!=null?Array.isArray(g)?g.includes(I):g===I:!0}function qV({children:g,allow:A,deny:I}){return fV(A,I)?$.jsx($.Fragment,{children:g}):null}x.forwardRef(({children:g,...A},I)=>{const C=ui(B=>B.gl.xr.getCamera()),i=fg(B=>B.originReferenceSpace);return i==null?null:$.jsxs("group",{ref:I,...A,children:[$.jsx("primitive",{object:C}),$.jsx(ba.Provider,{value:i,children:g})]})});function mV(g,A,I){const C=x.useRef(void 0);YV(A,I,x.useCallback(i=>C.current=i,[])),BC((i,B,Q)=>{g==null||Q==null||C.current==null||g(Q.getHitTestResults(C.current.source),C.current.getWorldMatrix)})}function YV(g,A,I){const C=Dd();x.useEffect(()=>{let i,B=!1;const Q=g instanceof XRSpace?g:g.current;if(Q!=null)return _1(C,Q,A).then(e=>{B||(i=e,I(e))}),()=>{I(void 0),B=!0,i==null||i.source.cancel()}},[C,g,A,I])}x.forwardRef((g,A)=>{const I=x.useRef(null);return x.useImperativeHandle(A,()=>I.current),mV(g.onResults,I,g.trackableType),$.jsx("group",{...g,ref:I})});x.forwardRef((g,A)=>{const I=fg(B=>B.domOverlayRoot),{In:C,Out:i}=x.useMemo(fZ,[]);return x.useEffect(()=>{const B=dk(I);return B.render($.jsx(i,{})),()=>B.unmount()},[I,i]),$.jsx(C,{children:$.jsx("div",{...g,ref:A})})});const zm=x.forwardRef(({store:g,mode:A,onError:I,children:C,...i},B)=>{const Q=hM(g,t=>t.session),e=$1(A,I);return $.jsx("button",{ref:B,...i,onClick:()=>Q!=null?Q.end():g.enterXR(A).catch(I),children:typeof C=="function"?C(e?Q!=null?"entered":"exited":"unsupported"):C})});x.forwardRef((g,A)=>$.jsx(zm,{ref:A,mode:"immersive-ar",...g}));x.forwardRef((g,A)=>$.jsx(zm,{ref:A,mode:"immersive-vr",...g}));const LV={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:g=>g.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:g=>g.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:g=>g.pointerType==="ray"},onSqueeze:{type:"click",filter:g=>g.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:g=>g.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:g=>g.pointerType==="grab"}};function sQ(g,A,I){const C=x.useRef(I);C.current=I,x.useEffect(()=>{const{current:i}=g;if(i==null)return;const B=LV[A],Q=typeof B=="string"?t=>{var E;return(E=C.current)==null?void 0:E.call(C,{intersection:t,intersections:[t],target:t.pointerState})}:t=>{var E;t instanceof WC&&!B.filter(t)||(E=C.current)==null||E.call(C,{intersection:t,intersections:[t],target:t.pointerState})},e=typeof B=="string"?B:B.type;return i.addEventListener(e,Q),()=>i.removeEventListener(e,Q)},[g,A])}const HV=x.forwardRef(({onHover:g,onBlur:A,onSelectStart:I,onSelectEnd:C,onSelect:i,onSqueezeStart:B,onSqueezeEnd:Q,onSqueeze:e,onMove:t,children:E},s)=>{const a=x.useRef(null);return x.useImperativeHandle(s,()=>a.current),sQ(a,"onHover",g),sQ(a,"onBlur",A),sQ(a,"onSelectStart",I),sQ(a,"onSelectEnd",C),sQ(a,"onSelect",i),sQ(a,"onSqueezeStart",B),sQ(a,"onSqueezeEnd",Q),sQ(a,"onSqueeze",e),sQ(a,"onMove",t),$.jsx("group",{ref:a,children:E})});x.forwardRef(function({onSelectStart:A,onSelectEnd:I,children:C,...i},B){const Q=x.useRef(),e=x.useRef(null),t=x.useMemo(()=>new bA,[]);return x.useImperativeHandle(B,()=>e.current),BC(()=>{const E=Q.current,s=e.current;!s||!E||(s.applyMatrix4(t),s.applyMatrix4(E.matrixWorld),s.updateMatrixWorld(),t.copy(E.matrixWorld).invert())}),$.jsx(HV,{ref:e,onSelectStart:E=>{Y8(E.target)&&(E.target.type==="controller"||E.target.type==="hand")&&E.target.object!=null&&(Q.current=E.target.object,t.copy(E.target.object.matrixWorld).invert(),A==null||A(E))},onSelectEnd:E=>{E.target.controller===Q.current&&(Q.current=void 0),I==null||I(E)},...i,children:C})});const TV=5,bG=new f,PF=new f,ZF=new f,xV=new f,WF=new f;function vV({lerp:g=ka.lerp}){const A=x.useRef(),I=x.useRef(),C=xa(),[,i]=CP();return BC(B=>{const{forward:Q,backward:e,left:t,right:E,jump:s}=i(),a=I.current.linvel();WF.set(a.x,a.y,a.z);const{x:r,y:l,z:D}=I.current.translation();B.camera.position.set(r,l,D),A.current!=null&&(A.current.children[0].rotation.x=g(A.current.children[0].rotation.x,Math.sin((WF.length()>1)*B.clock.elapsedTime*10)/6,.1),A.current.rotation.copy(B.camera.rotation),A.current.position.copy(B.camera.position).add(B.camera.getWorldDirection(xV).multiplyScalar(1))),PF.set(0,0,e-Q),ZF.set(t-E,0,0),bG.subVectors(PF,ZF).normalize().multiplyScalar(TV).applyEuler(B.camera.rotation),I.current.setLinvel({x:bG.x,y:a.y,z:bG.z});const S=C.world.castRay(new PM(I.current.translation(),{x:0,y:-1,z:0})),c=S&&S.collider&&Math.abs(S.toi)<=1.75;s&&c&&I.current.setLinvel({x:0,y:7.5,z:0})}),$.jsxs($.Fragment,{children:[$.jsx(va,{ref:I,colliders:!1,mass:1,type:"dynamic",position:[0,10,0],enabledRotations:[!1,!1,!1],children:$.jsx(wm,{args:[.75,.5]})}),$.jsx(qV,{deny:"immersive-vr",children:$.jsx("group",{ref:A,onPointerMissed:B=>A.current.children[0].rotation.x=-.5,children:$.jsx(vW,{position:[.3,-.35,.5]})})})]})}const $m=JZ(g=>({cubes:[],addCube:(A,I,C)=>g(i=>({cubes:[...i.cubes,[A,I,C]]}))})),bV=()=>$m(A=>A.cubes).map((A,I)=>$.jsx(AY,{position:A},I));function AY(g){const A=x.useRef(),[I,C]=x.useState(null),i=$m(E=>E.addCube),B=Gh("dirt.jpg"),Q=x.useCallback(E=>{E.stopPropagation(),C(Math.floor(E.faceIndex/2))},[]),e=x.useCallback(()=>C(null),[]),t=x.useCallback(E=>{E.stopPropagation();const{x:s,y:a,z:r}=A.current.translation(),l=[[s+1,a,r],[s-1,a,r],[s,a+1,r],[s,a-1,r],[s,a,r+1],[s,a,r-1]];i(...l[Math.floor(E.faceIndex/2)])},[]);return $.jsx(va,{...g,type:"fixed",colliders:"cuboid",ref:A,children:$.jsxs("mesh",{receiveShadow:!0,castShadow:!0,onPointerMove:Q,onPointerOut:e,onClick:t,children:[[...Array(6)].map((E,s)=>$.jsx("meshStandardMaterial",{attach:`material-${s}`,map:B,color:I===s?"hotpink":"white"},s)),$.jsx("boxGeometry",{})]})})}const VF=MV();function OV(){return $.jsxs($.Fragment,{children:[$.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>VF.enterVR(),children:"Enter VR"}),$.jsx(gP,{map:[{name:"forward",keys:["ArrowUp","w","W"]},{name:"backward",keys:["ArrowDown","s","S"]},{name:"left",keys:["ArrowLeft","a","A"]},{name:"right",keys:["ArrowRight","d","D"]},{name:"jump",keys:["Space"]}],children:$.jsx(AP,{shadows:!0,camera:{fov:45},children:$.jsxs(dV,{store:VF,children:[$.jsx(tZ,{sunPosition:[100,20,100]}),$.jsx("ambientLight",{intensity:.8}),$.jsx("directionalLight",{intensity:5,position:[100,60,100]}),$.jsxs(yW,{gravity:[0,-30,0],children:[$.jsx(xW,{}),$.jsx(vV,{}),$.jsx(AY,{position:[0,.5,-10]}),$.jsx(bV,{})]}),$.jsx(iZ,{})]})})})]})}dk(document.getElementById("root")).render($.jsx(x.StrictMode,{children:$.jsx(OV,{})}));export{TQ as B,gn as C,Xi as D,DC as E,$A as F,AB as G,pC as L,bA as M,RI as O,AE as P,$I as Q,qa as R,fa as S,sh as T,f as V,Kf as W,Vg as a,cI as b,Qg as c,Ka as d,VB as e,BD as f,dD as g,Pg as h,oh as i,$ as j,pB as k,dk as l,lI as o,x as r}; + diffuseColor.a *= vFade;`)}}function _8(g,A,I,C){if(!I.getEnabled()){g.visible=!1;return}g.visible=!0;const i=I.getIntersection(),B=typeof C.color=="function"?C.color(I):C.color;Array.isArray(B)?A.color.set(...B):A.color.set(B??"white"),A.opacity=typeof C.opacity=="function"?C.opacity(I):C.opacity??.4;let Q=C.maxLength??1;i!=null&&(Q=Math.min(Q,i.distance)),g.position.z=-Q/2;const e=C.size??.005;g.scale.set(e,e,Q),g.updateMatrix()}function P8(g,A,I,C,i,B={}){const Q=a=>{a.inputSource===I&&g.down(Object.assign(a,{button:B.button??0}))},e=a=>{a.inputSource===I&&g.up(Object.assign(a,{button:B.button??0}))},t=`${C}start`,E=`${C}end`,s=i.length;for(let a=0;a{A.removeEventListener(t,Q),A.removeEventListener(E,e)}}function Z8(g){var A;return g.getButtonsDown().size>0?.6:Fm(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.07,0,.2,.4)}function kD(g){return g.getButtonsDown().size>0?.6:.4}function W8(g){var A;return Fm(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.1,.03,.2,.6)}function Fm(g,A,I,C,i){return C+Math.max(0,Math.min(1,(g-A)/(I-A)))*(i-C)}function V8(g,A){return(I,C)=>{if(g===A)return I.identity(),!0;const i=typeof A=="function"?A():A;if(i==null)return!1;const B=C==null?void 0:C.getPose(g,i);return B==null?!1:(I.fromArray(B.transform.matrix),!0)}}function Rm(g,A,I){if(A==null){I.copy(g.matrixWorld);return}I.copy(A.matrixWorld).invert().multiply(g.matrixWorld)}function j8(g,A,I,C){C==null||C.copy(g.matrix);const i=Km(g,C);return i!=null||A==null||I==null?i:(C!=null&&Rm(g,A,C),I)}function Km({parent:g},A){if(g!=null)return A!=null&&A.premultiply(g.matrix),g.xrSpace??Km(g,A)}function X8(g,A,{anchors:I=!0,handTracking:C=!0,layers:i=!0,meshDetection:B=!0,planeDetection:Q=!0,originReferenceSpace:e="local-floor",customSessionInit:t,depthSensing:E=!1,hitTest:s=!0,unbounded:a=!0,domOverlay:r=!0}={}){if(t!=null)return t;const l=[e],D=[];return r instanceof Element&&(r=!0),nQ(I,"anchors",l,D),nQ(C,"hand-tracking",l,D),nQ(i,"layers",l,D),nQ(B,"mesh-detection",l,D),nQ(Q,"plane-detection",l,D),nQ(E,"depth-sensing",l,D),nQ(r,"dom-overlay",l,D),nQ(s,"hit-test",l,D),g!="immersive-vr"&&nQ(a,"unbounded",l,D),{requiredFeatures:l,optionalFeatures:D,domOverlay:{root:A}}}function nQ(g,A,I,C){if(g!==!1){if(g===!0){C.push(A);return}I.push(A)}}function le(g,A,I){return typeof g=="function"?g:(typeof g=="object"&&(A!=null&&z8(g,A)?g=g[A]:"default"in g&&(g=g.default)),g===!1?!1:g===!0?I:g??I)}function z8(g,A){return A in g}function Jm(g,A,I){return g??(g=I),g===!1?!1:typeof g=="function"?g:A!=null&&A in g?g[A]??I:"default"in g?g.default??I:g}const fm={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function pF(g,A){var I,C;Promise.all([(I=navigator.xr)==null?void 0:I.isSessionSupported("immersive-vr"),(C=navigator.xr)==null?void 0:C.isSessionSupported("immersive-ar")]).then(([i,B])=>!B&&!i?jq(()=>import("./emulate-BiDGoL_J.js"),[]):void 0).then(i=>{A&&window.alert("emulator started"),i==null||i.emulate(g)})}function $8(g){const A="metaQuest3";let I;{window.location.hostname==="localhost"&&pF(A,!1);const r=l=>{l.altKey&&l.metaKey&&l.code==="KeyE"&&pF(A,!0)};window.addEventListener("keydown",r),I=()=>window.removeEventListener("keydown",r)}const C=(g==null?void 0:g.domOverlay)instanceof HTMLElement?g.domOverlay:document.createElement("div"),i=Xq(()=>({...fm,controller:g==null?void 0:g.controller,hand:g==null?void 0:g.hand,gaze:g==null?void 0:g.gaze,screenInput:g==null?void 0:g.screenInput,transientPointer:g==null?void 0:g.transientPointer,detectedMesh:g==null?void 0:g.detectedMesh,detectedPlane:g==null?void 0:g.detectedPlane,domOverlayRoot:C}));let B;if(C.parentNode==null){const r=D=>{C.style.display=D.session!=null?"block":"none"},l=i.subscribe(r);r(i.getState()),document.body.appendChild(C),B=()=>{C.remove(),l()}}document.body.append(C);const Q=H8({controller:r=>i.setState({controllerStates:[...i.getState().controllerStates,r]})},g),e=C1(i,Q),t=g1(g==null?void 0:g.enterGrantedSession,r=>gc(C,r,g,a));let E;const s=[];let a;return Object.assign(i,{requestFrame(){return new Promise(r=>s.push(r))},setWebXRManager(r){if(a===r)return;a=r;const{foveation:l,originReferenceSpace:D="local-floor"}={};r.setReferenceSpaceType(D),l!=null&&r.setFoveation(l),E==null||E(),E=I1(r,e)},setFrameRate(r){const{session:l}=i.getState();l!=null&&qm(l,r)},setHand(r,l){if(l==null){i.setState({hand:r});return}const D=i.getState().hand,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({hand:w})},setController(r,l){if(l==null){i.setState({controller:r});return}const D=i.getState().controller,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({controller:w})},setTransientPointer(r,l){if(l==null){i.setState({transientPointer:r});return}const D=i.getState().transientPointer,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({transientPointer:w})},setGaze(r){i.setState({gaze:r})},setScreenInput(r){i.setState({screenInput:r})},setDetectedPlane(r,l){if(l==null){i.setState({detectedPlane:r});return}const D=i.getState().detectedPlane,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({detectedPlane:w})},setDetectedMesh(r,l){if(l==null){i.setState({detectedMesh:r});return}const D=i.getState().detectedMesh,w={};typeof D=="object"&&Object.assign(w,D),Object.assign(w,{default:le(D,void 0,{}),[l]:r}),i.setState({detectedMesh:w})},destroy(){I==null||I(),B==null||B(),E==null||E(),t==null||t(),e(void 0,void 0)},enterXR:r=>gc(C,r,g,a),enterAR:()=>gc(C,"immersive-ar",g,a),enterVR:()=>gc(C,"immersive-vr",g,a),onBeforeFrame(r,l,D){const{origin:w}=i.getState(),S=l.parent??r,c=(a==null?void 0:a.getReferenceSpace())??void 0;w!=S&&(S.xrSpace=c,i.setState({origin:S}));const{originReferenceSpace:G}=i.getState();if(c!=G&&(S.xrSpace=c,i.setState({originReferenceSpace:c})),D==null)return;a!=null&&i1(i,D,a);const u=s.length;for(let M=0;M component?"));const i=await navigator.xr.requestSession(A,X8(A,g,I));return qm(i,"high"),A1(C,i),i}function A1(g,A,I){g!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(A),g==null||g.setSession(A))}const UF=["immersive-ar","immersive-vr","inline"];function I1(g,A){const I=()=>{const C=g.getSession();A(C,C.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return g.addEventListener("sessionstart",I),()=>g.removeEventListener("sessionstart",I)}function g1(g=UF,A){var C;if(g===!1)return;g===!0&&(g=UF);const I=async()=>{var i;for(const B of g)await((i=navigator.xr)==null?void 0:i.isSessionSupported(B))&&A(B)};return(C=navigator.xr)==null||C.addEventListener("sessiongranted",I),()=>{var i;return(i=navigator.xr)==null?void 0:i.removeEventListener("sessiongranted",I)}}function C1(g,A){let I;return(C,i)=>{if(I==null||I(),C==null||i==null)return;const B=t=>g.setState(A(t.session,g.getState(),t.added,t.removed));C.addEventListener("inputsourceschange",B);const Q=()=>g.setState({frameRate:C.frameRate,visibilityState:C.visibilityState}),e=()=>{I==null||I(),I=void 0,g.setState(fm)};C.addEventListener("end",e),C.addEventListener("frameratechange",Q),C.addEventListener("visibilitychange",Q),g.setState({...A(C,void 0,C.inputSources,void 0),frameRate:C.frameRate,visibilityState:C.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:i,session:C}),I=()=>{A(C,g.getState(),void 0,"all"),C.removeEventListener("end",e),C.removeEventListener("frameratechange",Q),C.removeEventListener("visibilitychange",Q),C.removeEventListener("inputsourceschange",B)}}}function i1(g,A,I){const C=I.getReferenceSpace(),{detectedMeshes:i,detectedPlanes:B,session:Q,controllerStates:e,handStates:t}=g.getState();if(C==null||Q==null)return;const E=NF(B,A.detectedPlanes),s=NF(i,A.detectedMeshes);(B!=E||i!=s)&&g.setState({detectedPlanes:E,detectedMeshes:s});const a=e.length;for(let l=0;l{I instanceof Qg&&I.material instanceof ag&&(I.material.colorWrite=(A==null?void 0:A.colorWrite)??!0)})}function E1(g,A,I){const C=[];for(const i in A.components){const B=A.components[i];let Q=I[i];Q==null&&(I[i]=Q={state:"default"}),C.push(...Object.values(B.visualResponses).map(e=>o1(g,Q,e)))}return()=>{const i=C.length;for(let B=0;B{};if(I.valueNodeProperty==="visibility")return()=>C.visible=I.states.includes(A.state);const i=g.getObjectByName(I.minNodeName),B=g.getObjectByName(I.maxNodeName);return i==null||B==null?()=>{}:()=>{const Q=n1(A,I);C.quaternion.slerpQuaternions(i.quaternion,B.quaternion,Q),C.position.lerpVectors(i.position,B.position,Q),C.updateMatrix()}}function n1(g,{componentProperty:A,states:I}){const C=I.includes(g.state);switch(A){case"xAxis":return C?FF(g).x:.5;case"yAxis":return C?FF(g).y:.5;case"button":return C?g.button??0:0;case"state":return C?1:0}}const $n=new cA;function FF({xAxis:g=0,yAxis:A=0}){if($n.lengthSq()>1){const C=Math.atan2(A,g);$n.set(Math.cos(C),Math.sin(C))}else $n.set(g,A);return $n.multiplyScalar(.5).addScalar(.5),$n}function s1({_listeners:g,__r3f:A}){return g!=null&&Object.keys(g).length>0||A!=null&&(A==null?void 0:A.eventCount)>0}function a1({_listeners:g,__r3f:A},I){if(g!=null&&I in g)return g[I];if(A==null)return;const C=A.handlers[r1[I]];if(C!=null)return[C]}const r1={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class WC{constructor(A,I,C,i,B,Q=B.object,e=Q){FI(this,"type");FI(this,"bubbles");FI(this,"nativeEvent");FI(this,"pointer");FI(this,"intersection");FI(this,"currentObject");FI(this,"object");FI(this,"stopPropagation");FI(this,"stopImmediatePropagation");this.type=A,this.bubbles=I,this.nativeEvent=C,this.pointer=i,this.intersection=B,this.currentObject=Q,this.object=e}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new WC(I,C,i,B,Q,A,e)}}class ed extends WC{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(A,I,C,i,B){super("wheel",!0,A,I,C,i,B)}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new ed(i,B,Q,A,e)}}function bi(g){mm(g,g.currentObject)}function mm(g,A){if(A==null)return;const I=a1(A,g.type);let C=!g.bubbles;if(I!=null&&I.length>0){const i=g.retarget(A),B=I.length;i.stopPropagation=()=>C=!0;let Q=!1;i.stopImmediatePropagation=()=>{C=!0,Q=!0};for(let e=0;e=0;e--){const t=this.pointerEnteredHelper[e];bi(new WC("pointerenter",!1,A,this,C,t))}if(C!=null&&bi(new WC("pointermove",!0,A,this,C)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;tC){e.set(A.button,A.timeStamp);return}bi(new WC("dblclick",!0,A,this,this.intersection)),e.delete(A.button)}cancel(A){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,A));return}this.intersection!=null&&bi(new WC("pointercancel",!0,A,this,this.intersection))}}wheel(A,I,C){if(!this.enabled)return;let i=this.intersection;if(C||(i=this.computeIntersection(A,I,this.pointerCapture)),!this.wasMoved&&C){this.onFirstMove.push(this.cancel.bind(this,I));return}i!=null&&bi(new ed(I,this,i))}exit(A){var I;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,A));return}this.pointerCapture!=null&&((I=this.parentReleasePointerCapture)==null||I.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(A)}}function Lm(g,A,I,C){if(g==null)return;const i=I.indexOf(g);i!=-1?I.splice(i,1):C.push(g),A.push(g),Lm(g.parent,A,I,C)}function l1(g,A,I,C,i){if(A==null)return!1;const B=A.get(I);return!(B==null||C-B>i||B!=g.get(I))}function od(g,A,I){return A.face==null?!1:(g.setFromNormalAndCoplanarPoint(A.face.normal,A.localPoint),g.applyMatrix4(I.matrixWorld),!0)}function c1(g,A,I,C,i,B){if(A==="none"||A==="listener"&&!g)return!1;if(I==="all")return!0;if(typeof I=="function")return I(C,i,B);let Q,e;"deny"in I?(e=!0,Q=I.deny):(e=!1,Q=I.allow);let t;return Array.isArray(Q)?t=Q.includes(i):t=Q===i,e?!t:t}function Ph(g,A,I,C,i,B=!1,Q,e,t){const E=B||s1(g),s=g.pointerEvents??Q,a=g.pointerEventsType??e,r=g.pointerEventsOrder??t;c1(E,s??"listener",a??"all",A,I,C)&&i(g,r);const D=g.children.length;for(let w=0;w0)&&(g=E,Q=t)}return Q}function D1(g,A=0,I,C=0){return A!=C?C-A:g.distance-I.distance}const aQ=new qa,h1=new bA,$E=[];function S1(g,A,I,C,i,B,Q,e){if(Q!=null)return w1(g,A,Q);let t,E;if(Ph(I,C,i,B,(s,a)=>{let r=0;const l=((t==null?void 0:t.details.lineIndex)??A.length-2)+2;for(let D=1;D0;C--){const i=A[C-1],B=A[C];if(LG.origin.copy(i).applyMatrix4(g),LG.direction.copy(B).applyMatrix4(g).sub(aQ.ray.origin).normalize(),LG.intersectPlane(I,KF)!=null)return KF.clone()}}const HG=new qa,TG=new f,JF=new GB,y1=new bA,Cc=[];function u1(g,A,I,C,i,B,Q,e,t){if(e!=null)return k1(g,A,I,e);let E,s;if(HG.ray.origin.copy(g),HG.ray.direction.copy(I).applyQuaternion(A),Ph(C,i,B,Q,(a,r)=>{a.raycast(HG,Cc);const l=nd(E,s,Cc,r,t);l!=null&&(E=Cc[l],s=r),Cc.length=0}),E!=null)return Object.assign(E,{details:{type:"ray"},pointerPosition:g.clone(),pointerQuaternion:A.clone(),pointOnFace:E.point,localPoint:E.point.clone().applyMatrix4(y1.copy(E.object.matrixWorld).invert())})}const fF=new Te;function k1(g,A,I,{intersection:C,object:i}){if(C.details.type!="ray")return;TG.copy(I).applyQuaternion(A),fF.set(g,TG),od(JF,C,i);const B=fF.intersectPlane(JF,new f)??C.point;return{...C,object:i,pointOnFace:B,point:TG.clone().multiplyScalar(C.distance).add(g),pointerPosition:g.clone(),pointerQuaternion:A.clone()}}const xG=new jg,ic=[];function Hm(g,A,I,C,i,B,Q,e,t){if(e!=null)return p1(g,A,e);let E,s;if(xG.center.copy(g),xG.radius=I,Ph(C,i,B,Q,(a,r)=>{d1(xG,a,ic);const l=nd(E,s,ic,r,t);l!=null&&(E=ic[l],s=r),ic.length=0}),E!=null)return Object.assign(E,{details:{type:"sphere"},pointOnFace:E.point,pointerPosition:g.clone(),pointerQuaternion:A.clone(),localPoint:E.point.clone().applyMatrix4(MD.copy(E.object.matrixWorld).invert())})}const Bc=new bA;function M1(g){return"spherecast"in g}function d1(g,A,I){if(A.updateWorldMatrix(!0,!1),M1(A)){A.spherecast(g,I);return}if(A instanceof Na){A.geometry.boundingSphere==null&&A.geometry.computeBoundingSphere(),A.geometry.boundingBox==null&&A.geometry.computeBoundingBox();for(let i=0;ig.radius*g.radius)return;vG.max(U1);const Q=No.center.clone().sub(HF);Q.divide(vG),N1(Q);const e=Qc.clone();return{distance:Math.sqrt(B),face:{a:0,b:0,c:0,materialIndex:0,normal:Q},normal:Q,point:e,instanceId:C,object:A}}function N1(g){const A=Math.abs(g.x),I=Math.abs(g.y),C=Math.abs(g.z);if(A>=I&&A>=C){g.set(g.x<0?-1:1,0,0);return}if(I>=A&&I>=C){g.set(0,g.y<0?-1:1,0);return}g.set(0,0,g.z<0?-1:1)}const Ru={radius:.07};function F1(g,A,I=Ru,C="grab"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s!=null)return s.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),Hm(i,B,I.radius??Ru.radius,e,Q,C,A,E,I)},void 0,void 0,void 0,I)}const R1=new f(0,0,-1),K1=new f,rs={direction:R1,minDistance:0,linePoints:null};function J1(g,A,I=rs,C="ray"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s==null)return;s.updateWorldMatrix(!0,!1);let a;const r=I.linePoints??rs.linePoints;if(r==null?(i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),a=u1(i,B,I.direction??rs.direction,e,Q,C,A,E,I)):a=S1(s.matrixWorld,r,e,Q,C,A,E,I),!(a==null||a.distance*s.getWorldScale(K1).x<(I.minDistance??rs.minDistance)))return a},void 0,void 0,void 0,I)}const Fo={button:0,downRadius:.03,hoverRadius:.1};function f1(g,A,I=Fo,C="touch"){const i=new f,B=new $I,Q=sd();return new Ed(Q,C,A,(e,t,E)=>{const s=g.current;if(s!=null)return s.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(s.matrixWorld),B.setFromRotationMatrix(s.matrixWorld),Hm(i,B,I.hoverRadius??Fo.hoverRadius,e,Q,C,A,E,I)},q1(I),void 0,void 0,I)}function q1(g=Fo){let A=!1;return I=>{if(!I.getEnabled())return;const C=I.getIntersection(),i=m1(C,g.downRadius??Fo.downRadius);if(i===A)return;const B={timeStamp:performance.now(),button:g.button??Fo.button};i?I.down(B):I.up(B),A=i}}function m1(g,A){return g==null?!1:g.distance<=A}let Y1=23412;function sd(){return Y1++}new f;new cA;let L1=class{constructor(){FI(this,"pointers",[]);FI(this,"isDefaults",[]);FI(this,"enabled",!0)}register(A,I){return this.pointers.push(A),this.isDefaults.push(I),this.unregister.bind(this,A)}unregister(A){const I=this.pointers.indexOf(A);I!==-1&&(this.isDefaults.splice(I,1),this.pointers.splice(I,1))}move(A,I){var Q,e;if(!this.enabled)return;const C=this.pointers.length;if(C===0)return;for(let t=0;t=g.lastChangedTime)return A;const I=new cI;return I.setIndex(new oI(g.indices,1)),I.setAttribute("position",new oI(g.vertices,3)),Object.assign(I,{creationTime:g.lastChangedTime})}function vF(g,A){return A!=null&&A.createdAt!=null&&A.createdAt>=g.lastChangedTime?A:Object.assign(H1(g.polygon),{createdAt:g.lastChangedTime})}const Is=new Dq,ec=new cA;function H1(g){const A=new Ne,I=g.map(({x:i,z:B})=>new cA(i,B));Is.setFromPoints(I),Is.getSize(ec);for(const i of I)i.sub(Is.min),i.divide(ec);A.setFromPoints(I);const C=new Ja(A);return C.scale(ec.x,ec.y,1),C.translate(Is.min.x,Is.min.y,0),C.rotateX(Math.PI/2),C}new f;new f;new f;const gs=new DC(0,0,0,"YXZ"),tc=new $I;function T1(g,A,I){g.matrixWorld.decompose(A.position,tc,A.scale),gs.setFromQuaternion(tc),gs.z=0,gs.x=Kc(gs.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),tc.setFromEuler(gs),A.quaternion.slerp(tc,I/100)}function x1(g){return g.userData.teleportTarget===!0}function v1(g={}){return A=>!(!x1(A.object)||g.customFilter!=null&&!g.customFilter(A))}function b1(){return new gh(new f(0,0,0),new f(0,0,-8),new f(0,-20,-15)).getPoints(20)}let O1=class extends Qg{constructor(I){const C=new zP,i=new Float32Array(I.length*3);for(let e=0;ee.distanceTo(I[t+1]))}update(I){if(!I.getEnabled()||I.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const i=I.getIntersection();if((i==null?void 0:i.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:B,lineIndex:Q}=i.details,e=this.lineLengths[Q];this.material.visibility=this.multiplier*(Q+B/e)/this.lineLengths.length;const{color:t="white",opacity:E=.4,size:s=.01}=this.options;this.material.lineWidth=s,this.material.opacity=typeof E=="function"?E(I):E;const a=typeof t=="function"?t(I):t;Array.isArray(a)?this.material.color.set(...a):this.material.color.set(a)}};const Ec=new bA,oc=new f,bF=new $I;async function _1(g,A,I=["point","plane","mesh"]){var t,E;let C,i,B;const Q=g.getState();if(A instanceof XRSpace)i=A,B=Q.origin;else{if(Q.originReferenceSpace==null)return;B=A,i=j8(A,Q.origin,Q.originReferenceSpace,Ec)??Q.originReferenceSpace,i===Q.originReferenceSpace&&Rm(A,Q.origin,Ec),oc.setFromMatrixPosition(Ec);const s={...oc};bF.setFromRotationMatrix(Ec),oc.set(0,0,-1).applyQuaternion(bF);const a={...oc};C=new XRRay(s,a)}const e=await((E=(t=g.getState().session)==null?void 0:t.requestHitTestSource)==null?void 0:E.call(t,{space:i,entityTypes:Array.isArray(I)?I:[I],offsetRay:C}));if(e!=null)return{source:e,getWorldMatrix:P1.bind(null,i,B)}}function P1(g,A,I,C){const i=C.getPose(g);return i==null?!1:(I.fromArray(i.transform.matrix),A!=null&&I.premultiply(A.matrixWorld),!0)}new f(1,1,1);new f(0,0,0);new bA;new bA;new f;new f;const Tm=new OW,xm="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",Z1="generic-trigger";class W1{constructor(A){FI(this,"baseAssetPath");FI(this,"defaultProfileId");FI(this,"profilesListPromise");FI(this,"profilePromisesMap",new Map);FI(this,"loadAsync",this.load);this.baseAssetPath=(A==null?void 0:A.baseAssetPath)??xm,this.defaultProfileId=(A==null?void 0:A.defaultControllerProfileId)??Z1}async load(A,I){const C=await this.loadProfile(A);for(const i in C.layouts)if(i.includes(I))return C.layouts[i];throw new Error(`No matching layout for "${I}", in profile ${C.profileId} with layouts ${Object.keys(C.layouts).join(", ")}.`)}async loadProfile(A){this.profilesListPromise??(this.profilesListPromise=OF(new URL("profilesList.json",this.baseAssetPath).href));const I=await this.profilesListPromise,C=A.length;for(let B=0;Bg.visibilityState)}function $1(g,A){const I=x.useRef(A);I.current=A;const[C,i]=x.useMemo(()=>{let B;return[Q=>{let e=!1;return navigator.xr==null?(B=!1,()=>{}):(navigator.xr.isSessionSupported(g).then(t=>{B=t,!e&&Q()}).catch(t=>{var E;e||(E=I.current)==null||E.call(I,t)}),()=>e=!0)},()=>B]},[g]);return x.useSyncExternalStore(C,i)}x.forwardRef(({id:g,children:A,onPress:I,onRelease:C},i)=>{const B=ad(),[Q,e]=x.useState(void 0);if(x.useImperativeHandle(i,()=>Q,[Q]),AV(g,t=>t==="pressed"?I==null?void 0:I():C==null?void 0:C()),BC(()=>{var t;return e((t=B.gamepad[g])==null?void 0:t.object)}),Q!=null)return aM(A,Q)});function AV(g,A,I){const C=ad(),i=x.useRef();BC(()=>{var Q;const B=(Q=C==null?void 0:C.gamepad[g])==null?void 0:Q.state;B!=null&&B!=i.current&&A(B),i.current=B})}function ad(g){const A=x.useContext(zB);if(A==null||A.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return A}const IV=Symbol("loadXRControllerModel"),gV=x.forwardRef((g,A)=>{const I=ad(),C=Sh(e1,[I.layout,void 0,IV]);t1(C,g),I.object=C,x.useImperativeHandle(A,()=>C,[C]);const i=x.useMemo(()=>E1(C,I.layout,I.gamepad),[C,I.layout,I.gamepad]);return BC(i),$.jsx("primitive",{object:C})});function rd(g){const A=x.useContext(zB);if(A==null||A.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return A}const CV=Symbol("loadXRHandModel"),iV=x.forwardRef((g,A)=>{const I=rd(),C=Sh(R8,[I.assetPath,void 0,CV]);K8(C,g),x.useImperativeHandle(A,()=>C,[C]);const i=pV(),B=x.useMemo(()=>m8(I.inputSource.hand,C,i),[I.inputSource,C,i]);return BC((Q,e,t)=>B(t)),$.jsx("primitive",{object:C})});x.forwardRef(({joint:g,children:A},I)=>{const C=rd();return $.jsx(eB,{ref:I,space:C.inputSource.hand.get(g),children:A})});function Pm({children:g}){const A=x.useMemo(()=>new L1,[]);return Wm(A),BC(I=>A.move(I.scene,{timeStamp:performance.now()}),-50),$.jsx(_m.Provider,{value:A,children:g})}function BV(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,Ru,I);const B=x.useMemo(()=>F1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}function Zm(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,rs,I);const B=x.useMemo(()=>J1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}function QV(g,A,I,C){const i=x.useMemo(()=>({}),[]);Object.assign(i,Fo,I);const B=x.useMemo(()=>f1(g,A,i,C),[g,A,i,C]);return cd(B,I==null?void 0:I.makeDefault),B}const eV=x.forwardRef((g,A)=>{const I=x.useMemo(()=>new O8,[]),C=x.useRef(null);return x.useImperativeHandle(A,()=>C.current,[]),BC(()=>C.current!=null&&_8(C.current,I,g.pointer,g)),$.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:g.renderOrder??2,ref:C,material:I,children:$.jsx("boxGeometry",{})})}),Zh=x.forwardRef((g,A)=>{const I=x.useMemo(()=>new x8,[]),C=x.useRef(null);x.useImperativeHandle(A,()=>C.current,[]),BC(()=>C.current!=null&&b8(C.current,I,g.pointer,g));const i=ui(B=>B.scene);return aM($.jsx("mesh",{renderOrder:g.renderOrder??1,ref:C,matrixAutoUpdate:!1,material:I,children:$.jsx("planeGeometry",{})}),i)});function ld(g,A,I,C){const i=fg(B=>B.session);x.useEffect(()=>{if(i!=null)return P8(g,i,A,I,C)},[I,A,g,i,C])}function cd(g,A=!1){const I=x.useContext(_m);I==null?(Wm(g),BC(C=>g.move(C.scene,{timeStamp:performance.now()}),-50)):x.useEffect(()=>I.register(g,A),[I,g,A]),x.useEffect(()=>()=>g.exit({timeStamp:performance.now()}),[g])}function Wm(g){const A=Dd();x.useEffect(()=>T8(A,I=>g.setEnabled(I,{timeStamp:performance.now()})),[A,g])}const tV=x.forwardRef(({pointer:g,linePoints:A,...I},C)=>{const i=x.useMemo(()=>new O1(A),[A]);return x.useImperativeHandle(C,()=>i,[i]),i.options=I,BC(()=>i.update(g)),$.jsx("primitive",{object:i})});function Vm(g,A,I){const C=x.useContext(zB);if(C==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const i=x.useRef(null),B=BV(i,C,I);ld(B,C.inputSource,g,C.events);const Q=I.cursorModel;return $.jsx(eB,{ref:i,space:A(C.inputSource),children:Q!==!1&&$.jsx(Zh,{pointer:B,opacity:Z8,...uC(Q)})})}const EV=Vm.bind(null,"select",g=>g.hand.get("index-finger-tip")),oV=Vm.bind(null,"squeeze",g=>g.gripSpace);function Oa(g){const A=x.useContext(zB);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=x.useRef(null),C=Zm(I,A,g);ld(C,A.inputSource,"select",A.events);const i=g.rayModel,B=g.cursorModel;return $.jsxs(eB,{ref:I,space:A.inputSource.targetRaySpace,children:[i!==!1&&$.jsx(eV,{pointer:C,opacity:kD,...uC(i)}),B!==!1&&$.jsx(Zh,{pointer:C,opacity:kD,...uC(B)})]})}function nV(g){const A=rd(),I=x.useRef(null),C=QV(I,A,g),i=g.cursorModel;return $.jsx(eB,{ref:I,space:A.inputSource.hand.get("index-finger-tip"),children:i!==!1&&$.jsx(Zh,{pointer:C,opacity:W8,...uC(i)})})}function sV(g){const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.teleportPointer??!1;return $.jsxs($.Fragment,{children:[A!==!1&&$.jsx(x.Suspense,{children:$.jsx(gV,{...uC(A)})}),$.jsxs(Pm,{children:[I!==!1&&$.jsx(oV,{...uC(I)}),C!==!1&&$.jsx(Oa,{makeDefault:!0,minDistance:.2,...uC(C)}),i!==!1&&$.jsx(jm,{...uC(i)})]})]})}function aV(g){var e;const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.touchPointer,B=g.teleportPointer??!1,Q=C===!1?!1:(e=uC(C))==null?void 0:e.rayModel;return $.jsxs($.Fragment,{children:[A!==!1&&$.jsx(x.Suspense,{children:$.jsx(iV,{...uC(A)})}),$.jsxs(Pm,{children:[I!==!1&&$.jsx(EV,{...uC(I)}),i!==!1&&$.jsx(nV,{...uC(i)}),C!==!1&&$.jsx(Oa,{makeDefault:!0,minDistance:.2,...uC(C),rayModel:Q===!1?!1:{maxLength:.2,...uC(Q)}}),B!==!1&&$.jsx(jm,{...uC(B)})]})]})}function rV(g){return $.jsx(Oa,{...g,rayModel:!1})}function lV(g){return $.jsx(Oa,{...g,rayModel:!1})}function cV(g){return $.jsx(Oa,{...g,cursorModel:!1,rayModel:!1})}function jm(g){const A=x.useContext(zB);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=x.useRef(null),C=x.useRef(null),i=x.useMemo(()=>b1(),[]),B=Zm(C,A,{...g,linePoints:i,customFilter:v1(g)},"teleport");ld(B,A.inputSource,"select",A.events);const Q=g.rayModel,e=g.cursorModel,t=ui(s=>s.scene),E=x.useRef(null);return BC((s,a)=>{E.current!=null&&(E.current.visible=B.getEnabled()&&B.getButtonsDown().size>0);const r=C.current,l=I.current;r==null||l==null||T1(l,r,a*1e3)}),$.jsxs($.Fragment,{children:[$.jsx(eB,{ref:I,space:A.inputSource.targetRaySpace}),aM($.jsxs("group",{ref:C,children:[Q!==!1&&$.jsx(tV,{linePoints:i,pointer:B,opacity:kD,...uC(Q)}),e!==!1&&$.jsx(Zh,{ref:E,pointer:B,opacity:kD,...uC(e)})]}),t)]})}function uC(g){if(g!==!0)return g}function DV({children:g}){const A=fg(Q=>Q.originReferenceSpace),I=fg(Q=>Q.origin),C=z1()==="visible",i=Ya(),B=x.useMemo(()=>Object.assign({},i,{getState(){return{...i.getState(),scene:I}}}),[I,i]);return I==null||A==null?null:$.jsx($.Fragment,{children:vo.createPortal($.jsx(wh.Provider,{value:i,children:$.jsxs(ba.Provider,{value:A,children:[$.jsxs("group",{matrixAutoUpdate:!1,visible:C,children:[$.jsx(hV,{}),$.jsx(SV,{}),$.jsx(wV,{}),$.jsx(GV,{}),$.jsx(yV,{})]}),$.jsx(uV,{}),$.jsx(kV,{}),g]})}),B,null)})}function hV(){const g=fg(I=>I.controllerStates);let A=fg(I=>I.controller);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.gripSpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(sV,{...C})})})},tE(I))})})}function SV(){const g=fg(I=>I.handStates),A=fg(I=>I.hand);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.hand.get("wrist"),children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(aV,{...C})})})},tE(I))})})}function wV(){const g=fg(I=>I.transientPointerStates),A=fg(I=>I.transientPointer);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>{const C=le(A,I.inputSource.handedness,{});return C===!1?null:$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof C=="function"?$.jsx(C,{}):$.jsx(rV,{...C})})})},tE(I))})})}function GV(){const g=fg(I=>I.gazeStates),A=fg(I=>I.gaze);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof A=="function"?$.jsx(A,{}):$.jsx(lV,{...Xm(A)})})})},tE(I)))})}function yV(){const g=fg(I=>I.screenInputStates),A=fg(I=>I.screenInput);return A===!1?null:$.jsx($.Fragment,{children:g.map(I=>$.jsx(eB,{space:I.inputSource.targetRaySpace,children:$.jsx(zB.Provider,{value:I,children:$.jsx(x.Suspense,{children:typeof A=="function"?$.jsx(A,{}):$.jsx(cV,{...Xm(A)})})})},tE(I)))})}function Xm(g){if(g!==!0)return g}function uV(){const g=fg(I=>I.detectedMeshes),A=fg(I=>I.detectedMesh);if(A!==!1)return $.jsx($.Fragment,{children:g.map(I=>{const C=Jm(A,I.semanticLabel,!1);return C===!1?null:$.jsx(eB,{space:I.meshSpace,children:$.jsx(bm.Provider,{value:I,children:$.jsx(x.Suspense,{children:$.jsx(C,{})})})},tE(I))})})}function kV(){const g=fg(I=>I.detectedPlanes),A=fg(I=>I.detectedPlane);if(A!=null)return $.jsx($.Fragment,{children:g.map(I=>{const C=Jm(A,I.semanticLabel,!1);return C===!1?null:$.jsx(eB,{space:I.planeSpace,children:$.jsx(Om.Provider,{value:I,children:$.jsx(x.Suspense,{children:$.jsx(C,{})})})},tE(I))})})}function MV(g){return $8(g)}function dV({children:g,store:A}){A.setWebXRManager(ui(C=>C.gl.xr));const I=Ya();return x.useEffect(()=>{let C;return A.subscribe((i,B)=>{const Q=i.mode!=null,e=B.mode!=null;if(Q!==e){if(Q){const{camera:t,gl:E}=I.getState();C=t,I.setState({camera:E.xr.getCamera()});return}C!=null&&I.setState({camera:C})}})},[I,A]),BC((C,i,B)=>A.onBeforeFrame(C.scene,C.camera,B),-1e3),$.jsxs(vm.Provider,{value:A,children:[$.jsx(DV,{}),g]})}function Dd(){const g=x.useContext(vm);if(g==null)throw new Error("XR features can only be used inside the component");return g}function fg(g=A=>A){return hM(Dd(),g)}const eB=x.forwardRef(({space:g,children:A},I)=>{const C=x.useRef(null);return x.useImperativeHandle(I,()=>C.current,[]),NV(C,g,(i,B,Q)=>{C.current!=null&&(C.current.visible=Q!=null)}),$.jsx("group",{xrSpace:g,visible:!1,matrixAutoUpdate:!1,ref:C,children:$.jsx(ba.Provider,{value:g,children:A})})});function pV(){const g=x.useContext(ba);if(g==null)throw new Error("XR objects must be placed inside the XROrigin");return g}function UV(g){const A=x.useContext(ba),I=fg(C=>A??C.originReferenceSpace);return x.useMemo(()=>I==null?void 0:V8(g,I),[g,I])}function NV(g,A,I){const C=UV(A);BC((i,B,Q)=>{g.current==null||C==null||(C(g.current.matrix,Q),I==null||I(i,B,Q))},-100)}x.forwardRef((g,A)=>{const I=FV(),C=RV(I);return $.jsx("mesh",{ref:A,geometry:C,...g})});function FV(){const g=x.useContext(bm);if(g==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return g}function RV(g,A=!0){const[I,C]=x.useState(xF(g,void 0));return BC(()=>C(i=>xF(g,i))),x.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}x.forwardRef((g,A)=>{const I=KV(),C=JV(I);return $.jsx("mesh",{ref:A,geometry:C,...g})});function KV(){const g=x.useContext(Om);if(g==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return g}function JV(g,A=!0){const[I,C]=x.useState(vF(g,void 0));return BC(()=>C(i=>vF(g,i))),x.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}function fV(g,A){const I=fg(C=>C.mode);return A!=null?Array.isArray(A)?!A.includes(I):A!=I:g!=null?Array.isArray(g)?g.includes(I):g===I:!0}function qV({children:g,allow:A,deny:I}){return fV(A,I)?$.jsx($.Fragment,{children:g}):null}x.forwardRef(({children:g,...A},I)=>{const C=ui(B=>B.gl.xr.getCamera()),i=fg(B=>B.originReferenceSpace);return i==null?null:$.jsxs("group",{ref:I,...A,children:[$.jsx("primitive",{object:C}),$.jsx(ba.Provider,{value:i,children:g})]})});function mV(g,A,I){const C=x.useRef(void 0);YV(A,I,x.useCallback(i=>C.current=i,[])),BC((i,B,Q)=>{g==null||Q==null||C.current==null||g(Q.getHitTestResults(C.current.source),C.current.getWorldMatrix)})}function YV(g,A,I){const C=Dd();x.useEffect(()=>{let i,B=!1;const Q=g instanceof XRSpace?g:g.current;if(Q!=null)return _1(C,Q,A).then(e=>{B||(i=e,I(e))}),()=>{I(void 0),B=!0,i==null||i.source.cancel()}},[C,g,A,I])}x.forwardRef((g,A)=>{const I=x.useRef(null);return x.useImperativeHandle(A,()=>I.current),mV(g.onResults,I,g.trackableType),$.jsx("group",{...g,ref:I})});x.forwardRef((g,A)=>{const I=fg(B=>B.domOverlayRoot),{In:C,Out:i}=x.useMemo(fZ,[]);return x.useEffect(()=>{const B=dk(I);return B.render($.jsx(i,{})),()=>B.unmount()},[I,i]),$.jsx(C,{children:$.jsx("div",{...g,ref:A})})});const zm=x.forwardRef(({store:g,mode:A,onError:I,children:C,...i},B)=>{const Q=hM(g,t=>t.session),e=$1(A,I);return $.jsx("button",{ref:B,...i,onClick:()=>Q!=null?Q.end():g.enterXR(A).catch(I),children:typeof C=="function"?C(e?Q!=null?"entered":"exited":"unsupported"):C})});x.forwardRef((g,A)=>$.jsx(zm,{ref:A,mode:"immersive-ar",...g}));x.forwardRef((g,A)=>$.jsx(zm,{ref:A,mode:"immersive-vr",...g}));const LV={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:g=>g.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:g=>g.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:g=>g.pointerType==="ray"},onSqueeze:{type:"click",filter:g=>g.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:g=>g.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:g=>g.pointerType==="grab"}};function sQ(g,A,I){const C=x.useRef(I);C.current=I,x.useEffect(()=>{const{current:i}=g;if(i==null)return;const B=LV[A],Q=typeof B=="string"?t=>{var E;return(E=C.current)==null?void 0:E.call(C,{intersection:t,intersections:[t],target:t.pointerState})}:t=>{var E;t instanceof WC&&!B.filter(t)||(E=C.current)==null||E.call(C,{intersection:t,intersections:[t],target:t.pointerState})},e=typeof B=="string"?B:B.type;return i.addEventListener(e,Q),()=>i.removeEventListener(e,Q)},[g,A])}const HV=x.forwardRef(({onHover:g,onBlur:A,onSelectStart:I,onSelectEnd:C,onSelect:i,onSqueezeStart:B,onSqueezeEnd:Q,onSqueeze:e,onMove:t,children:E},s)=>{const a=x.useRef(null);return x.useImperativeHandle(s,()=>a.current),sQ(a,"onHover",g),sQ(a,"onBlur",A),sQ(a,"onSelectStart",I),sQ(a,"onSelectEnd",C),sQ(a,"onSelect",i),sQ(a,"onSqueezeStart",B),sQ(a,"onSqueezeEnd",Q),sQ(a,"onSqueeze",e),sQ(a,"onMove",t),$.jsx("group",{ref:a,children:E})});x.forwardRef(function({onSelectStart:A,onSelectEnd:I,children:C,...i},B){const Q=x.useRef(),e=x.useRef(null),t=x.useMemo(()=>new bA,[]);return x.useImperativeHandle(B,()=>e.current),BC(()=>{const E=Q.current,s=e.current;!s||!E||(s.applyMatrix4(t),s.applyMatrix4(E.matrixWorld),s.updateMatrixWorld(),t.copy(E.matrixWorld).invert())}),$.jsx(HV,{ref:e,onSelectStart:E=>{Y8(E.target)&&(E.target.type==="controller"||E.target.type==="hand")&&E.target.object!=null&&(Q.current=E.target.object,t.copy(E.target.object.matrixWorld).invert(),A==null||A(E))},onSelectEnd:E=>{E.target.controller===Q.current&&(Q.current=void 0),I==null||I(E)},...i,children:C})});const TV=5,bG=new f,PF=new f,ZF=new f,xV=new f,WF=new f;function vV({lerp:g=ka.lerp}){const A=x.useRef(),I=x.useRef(),C=xa(),[,i]=CP();return BC(B=>{const{forward:Q,backward:e,left:t,right:E,jump:s}=i(),a=I.current.linvel();WF.set(a.x,a.y,a.z);const{x:r,y:l,z:D}=I.current.translation();B.camera.position.set(r,l,D),A.current!=null&&(A.current.children[0].rotation.x=g(A.current.children[0].rotation.x,Math.sin((WF.length()>1)*B.clock.elapsedTime*10)/6,.1),A.current.rotation.copy(B.camera.rotation),A.current.position.copy(B.camera.position).add(B.camera.getWorldDirection(xV).multiplyScalar(1))),PF.set(0,0,e-Q),ZF.set(t-E,0,0),bG.subVectors(PF,ZF).normalize().multiplyScalar(TV).applyEuler(B.camera.rotation),I.current.setLinvel({x:bG.x,y:a.y,z:bG.z});const S=C.world.castRay(new PM(I.current.translation(),{x:0,y:-1,z:0})),c=S&&S.collider&&Math.abs(S.toi)<=1.75;s&&c&&I.current.setLinvel({x:0,y:7.5,z:0})}),$.jsxs($.Fragment,{children:[$.jsx(va,{ref:I,colliders:!1,mass:1,type:"dynamic",position:[0,10,0],enabledRotations:[!1,!1,!1],children:$.jsx(wm,{args:[.75,.5]})}),$.jsx(qV,{deny:"immersive-vr",children:$.jsx("group",{ref:A,onPointerMissed:B=>A.current.children[0].rotation.x=-.5,children:$.jsx(vW,{position:[.3,-.35,.5]})})})]})}const $m=JZ(g=>({cubes:[],addCube:(A,I,C)=>g(i=>({cubes:[...i.cubes,[A,I,C]]}))})),bV=()=>$m(A=>A.cubes).map((A,I)=>$.jsx(AY,{position:A},I));function AY(g){const A=x.useRef(),[I,C]=x.useState(null),i=$m(E=>E.addCube),B=Gh("dirt.jpg"),Q=x.useCallback(E=>{E.stopPropagation(),C(Math.floor(E.faceIndex/2))},[]),e=x.useCallback(()=>C(null),[]),t=x.useCallback(E=>{E.stopPropagation();const{x:s,y:a,z:r}=A.current.translation(),l=[[s+1,a,r],[s-1,a,r],[s,a+1,r],[s,a-1,r],[s,a,r+1],[s,a,r-1]];i(...l[Math.floor(E.faceIndex/2)])},[]);return $.jsx(va,{...g,type:"fixed",colliders:"cuboid",ref:A,children:$.jsxs("mesh",{receiveShadow:!0,castShadow:!0,onPointerMove:Q,onPointerOut:e,onClick:t,children:[[...Array(6)].map((E,s)=>$.jsx("meshStandardMaterial",{attach:`material-${s}`,map:B,color:I===s?"hotpink":"white"},s)),$.jsx("boxGeometry",{})]})})}const VF=MV();function OV(){return $.jsxs($.Fragment,{children:[$.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>VF.enterVR(),children:"Enter VR"}),$.jsx(gP,{map:[{name:"forward",keys:["ArrowUp","w","W"]},{name:"backward",keys:["ArrowDown","s","S"]},{name:"left",keys:["ArrowLeft","a","A"]},{name:"right",keys:["ArrowRight","d","D"]},{name:"jump",keys:["Space"]}],children:$.jsx(AP,{shadows:!0,camera:{fov:45},children:$.jsxs(dV,{store:VF,children:[$.jsx(tZ,{sunPosition:[100,20,100]}),$.jsx("ambientLight",{intensity:.8}),$.jsx("directionalLight",{intensity:5,position:[100,60,100]}),$.jsxs(yW,{gravity:[0,-30,0],children:[$.jsx(xW,{}),$.jsx(vV,{}),$.jsx(AY,{position:[0,.5,-10]}),$.jsx(bV,{})]}),$.jsx(iZ,{})]})})})]})}dk(document.getElementById("root")).render($.jsx(x.StrictMode,{children:$.jsx(OV,{})}));export{TQ as B,gn as C,Xi as D,DC as E,$A as F,AB as G,pC as L,bA as M,RI as O,AE as P,$I as Q,qa as R,fa as S,sh as T,f as V,Kf as W,Vg as a,cI as b,Qg as c,Ka as d,VB as e,BD as f,dD as g,Pg as h,oh as i,$ as j,pB as k,dk as l,lI as o,x as r}; diff --git a/examples/minecraft/index.html b/examples/minecraft/index.html index fb3f661..da3ff69 100644 --- a/examples/minecraft/index.html +++ b/examples/minecraft/index.html @@ -4,7 +4,7 @@ Document - +
diff --git a/examples/rag-doll/assets/emulate-plYy4mhx.js b/examples/pingpong/assets/emulate-C93hwdRN.js similarity index 99% rename from examples/rag-doll/assets/emulate-plYy4mhx.js rename to examples/pingpong/assets/emulate-C93hwdRN.js index a29dcff..c931203 100644 --- a/examples/rag-doll/assets/emulate-plYy4mhx.js +++ b/examples/pingpong/assets/emulate-C93hwdRN.js @@ -1,4 +1,4 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-BPIO8-Qx.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-DxHPyL5Z.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; diff --git a/examples/pingpong/assets/index-KkaVz-OQ.js b/examples/pingpong/assets/index-DxHPyL5Z.js similarity index 99% rename from examples/pingpong/assets/index-KkaVz-OQ.js rename to examples/pingpong/assets/index-DxHPyL5Z.js index a80f16f..c210663 100644 --- a/examples/pingpong/assets/index-KkaVz-OQ.js +++ b/examples/pingpong/assets/index-DxHPyL5Z.js @@ -4251,4 +4251,4 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; `+A.vertexShader,A.vertexShader=A.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),A.fragmentShader=`varying float vFade; `+A.fragmentShader,A.fragmentShader=A.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function RV(g,A,I,C){if(!I.getEnabled()){g.visible=!1;return}g.visible=!0;const i=I.getIntersection(),B=typeof C.color=="function"?C.color(I):C.color;Array.isArray(B)?A.color.set(...B):A.color.set(B??"white"),A.opacity=typeof C.opacity=="function"?C.opacity(I):C.opacity??.4;let Q=C.maxLength??1;i!=null&&(Q=Math.min(Q,i.distance)),g.position.z=-Q/2;const e=C.size??.005;g.scale.set(e,e,Q),g.updateMatrix()}function KV(g,A,I,C,i,B={}){const Q=s=>{s.inputSource===I&&g.down(Object.assign(s,{button:B.button??0}))},e=s=>{s.inputSource===I&&g.up(Object.assign(s,{button:B.button??0}))},t=`${C}start`,E=`${C}end`,o=i.length;for(let s=0;s{A.removeEventListener(t,Q),A.removeEventListener(E,e)}}function JV(g){var A;return g.getButtonsDown().size>0?.6:ZL(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.07,0,.2,.4)}function rD(g){return g.getButtonsDown().size>0?.6:.4}function qV(g){var A;return ZL(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.1,.03,.2,.6)}function ZL(g,A,I,C,i){return C+Math.max(0,Math.min(1,(g-A)/(I-A)))*(i-C)}function mV(g,A){return(I,C)=>{if(g===A)return I.identity(),!0;const i=typeof A=="function"?A():A;if(i==null)return!1;const B=C==null?void 0:C.getPose(g,i);return B==null?!1:(I.fromArray(B.transform.matrix),!0)}}function WL(g,A,I){if(A==null){I.copy(g.matrixWorld);return}I.copy(A.matrixWorld).invert().multiply(g.matrixWorld)}function LV(g,A,I,C){C==null||C.copy(g.matrix);const i=VL(g,C);return i!=null||A==null||I==null?i:(C!=null&&WL(g,A,C),I)}function VL({parent:g},A){if(g!=null)return A!=null&&A.premultiply(g.matrix),g.xrSpace??VL(g,A)}function YV(g,A,{anchors:I=!0,handTracking:C=!0,layers:i=!0,meshDetection:B=!0,planeDetection:Q=!0,originReferenceSpace:e="local-floor",customSessionInit:t,depthSensing:E=!1,hitTest:o=!0,unbounded:s=!0,domOverlay:r=!0}={}){if(t!=null)return t;const l=[e],c=[];return r instanceof Element&&(r=!0),HQ(I,"anchors",l,c),HQ(C,"hand-tracking",l,c),HQ(i,"layers",l,c),HQ(B,"mesh-detection",l,c),HQ(Q,"plane-detection",l,c),HQ(E,"depth-sensing",l,c),HQ(r,"dom-overlay",l,c),HQ(o,"hit-test",l,c),g!="immersive-vr"&&HQ(s,"unbounded",l,c),{requiredFeatures:l,optionalFeatures:c,domOverlay:{root:A}}}function HQ(g,A,I,C){if(g!==!1){if(g===!0){C.push(A);return}I.push(A)}}function _e(g,A,I){return typeof g=="function"?g:(typeof g=="object"&&(A!=null&&HV(g,A)?g=g[A]:"default"in g&&(g=g.default)),g===!1?!1:g===!0?I:g??I)}function HV(g,A){return A in g}function jL(g,A,I){return g??(g=I),g===!1?!1:typeof g=="function"?g:A!=null&&A in g?g[A]??I:"default"in g?g.default??I:g}const XL={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function FF(g,A){var I,C;Promise.all([(I=navigator.xr)==null?void 0:I.isSessionSupported("immersive-vr"),(C=navigator.xr)==null?void 0:C.isSessionSupported("immersive-ar")]).then(([i,B])=>!B&&!i?QL(()=>import("./emulate-D-6Vp1MH.js"),[]):void 0).then(i=>{A&&window.alert("emulator started"),i==null||i.emulate(g===!0?"metaQuest3":g)})}function TV(g){const A=(g==null?void 0:g.emulate)??"metaQuest3";let I;if(A!=!1){window.location.hostname==="localhost"&&FF(A,!1);const r=l=>{l.altKey&&l.metaKey&&l.code==="KeyE"&&FF(A,!0)};window.addEventListener("keydown",r),I=()=>window.removeEventListener("keydown",r)}const C=(g==null?void 0:g.domOverlay)instanceof HTMLElement?g.domOverlay:document.createElement("div"),i=eL(()=>({...XL,controller:g==null?void 0:g.controller,hand:g==null?void 0:g.hand,gaze:g==null?void 0:g.gaze,screenInput:g==null?void 0:g.screenInput,transientPointer:g==null?void 0:g.transientPointer,detectedMesh:g==null?void 0:g.detectedMesh,detectedPlane:g==null?void 0:g.detectedPlane,domOverlayRoot:C}));let B;if(C.parentNode==null){const r=c=>{C.style.display=c.session!=null?"block":"none"},l=i.subscribe(r);r(i.getState()),document.body.appendChild(C),B=()=>{C.remove(),l()}}document.body.append(C);const Q=MV({controller:r=>i.setState({controllerStates:[...i.getState().controllerStates,r]})},g),e=OV(i,Q),t=bV(g==null?void 0:g.enterGrantedSession,r=>Pc(C,r,g,s));let E;const o=[];let s;return Object.assign(i,{requestFrame(){return new Promise(r=>o.push(r))},setWebXRManager(r){if(s===r)return;s=r;const{foveation:l,originReferenceSpace:c="local-floor"}=g??{};r.setReferenceSpaceType(c),l!=null&&r.setFoveation(l),E==null||E(),E=vV(r,e)},setFrameRate(r){const{session:l}=i.getState();l!=null&&zL(l,r)},setHand(r,l){if(l==null){i.setState({hand:r});return}const c=i.getState().hand,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({hand:w})},setController(r,l){if(l==null){i.setState({controller:r});return}const c=i.getState().controller,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({controller:w})},setTransientPointer(r,l){if(l==null){i.setState({transientPointer:r});return}const c=i.getState().transientPointer,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({transientPointer:w})},setGaze(r){i.setState({gaze:r})},setScreenInput(r){i.setState({screenInput:r})},setDetectedPlane(r,l){if(l==null){i.setState({detectedPlane:r});return}const c=i.getState().detectedPlane,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({detectedPlane:w})},setDetectedMesh(r,l){if(l==null){i.setState({detectedMesh:r});return}const c=i.getState().detectedMesh,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({detectedMesh:w})},destroy(){I==null||I(),B==null||B(),E==null||E(),t==null||t(),e(void 0,void 0)},enterXR:r=>Pc(C,r,g,s),enterAR:()=>Pc(C,"immersive-ar",g,s),enterVR:()=>Pc(C,"immersive-vr",g,s),onBeforeFrame(r,l,c){const{origin:w}=i.getState(),D=l.parent??r,h=(s==null?void 0:s.getReferenceSpace())??void 0;w!=D&&(D.xrSpace=h,i.setState({origin:D}));const{originReferenceSpace:G}=i.getState();if(h!=G&&(D.xrSpace=h,i.setState({originReferenceSpace:h})),c==null)return;s!=null&&_V(i,c,s);const u=o.length;for(let d=0;d component?"));const i=await navigator.xr.requestSession(A,YV(A,g,I));return zL(i,(I==null?void 0:I.frameRate)??"high"),xV(C,i,I),i}function xV(g,A,I){if(g==null)return;const C=XRWebGLLayer.getNativeFramebufferScaleFactor(A);let i=I==null?void 0:I.frameBufferScaling;typeof i=="function"&&(i=i(C)),typeof i=="string"&&(i=i==="high"?C:i==="mid"?1:.5),i!=null&&(g==null||g.setFramebufferScaleFactor(i)),g==null||g.setSession(A)}const RF=["immersive-ar","immersive-vr","inline"];function vV(g,A){const I=()=>{const C=g.getSession();A(C,C.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return g.addEventListener("sessionstart",I),()=>g.removeEventListener("sessionstart",I)}function bV(g=RF,A){var C;if(g===!1)return;g===!0&&(g=RF);const I=async()=>{var i;for(const B of g)await((i=navigator.xr)==null?void 0:i.isSessionSupported(B))&&A(B)};return(C=navigator.xr)==null||C.addEventListener("sessiongranted",I),()=>{var i;return(i=navigator.xr)==null?void 0:i.removeEventListener("sessiongranted",I)}}function OV(g,A){let I;return(C,i)=>{if(I==null||I(),C==null||i==null)return;const B=t=>g.setState(A(t.session,g.getState(),t.added,t.removed));C.addEventListener("inputsourceschange",B);const Q=()=>g.setState({frameRate:C.frameRate,visibilityState:C.visibilityState}),e=()=>{I==null||I(),I=void 0,g.setState(XL)};C.addEventListener("end",e),C.addEventListener("frameratechange",Q),C.addEventListener("visibilitychange",Q),g.setState({...A(C,void 0,C.inputSources,void 0),frameRate:C.frameRate,visibilityState:C.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:i,session:C}),I=()=>{A(C,g.getState(),void 0,"all"),C.removeEventListener("end",e),C.removeEventListener("frameratechange",Q),C.removeEventListener("visibilitychange",Q),C.removeEventListener("inputsourceschange",B)}}}function _V(g,A,I){const C=I.getReferenceSpace(),{detectedMeshes:i,detectedPlanes:B,session:Q,controllerStates:e,handStates:t}=g.getState();if(C==null||Q==null)return;const E=KF(B,A.detectedPlanes),o=KF(i,A.detectedMeshes);(B!=E||i!=o)&&g.setState({detectedPlanes:E,detectedMeshes:o});const s=e.length;for(let l=0;l{I instanceof eg&&I.material instanceof Gg&&(I.material.colorWrite=(A==null?void 0:A.colorWrite)??!0)})}function jV(g,A,I){const C=[];for(const i in A.components){const B=A.components[i];let Q=I[i];Q==null&&(I[i]=Q={state:"default"}),C.push(...Object.values(B.visualResponses).map(e=>XV(g,Q,e)))}return()=>{const i=C.length;for(let B=0;B{};if(I.valueNodeProperty==="visibility")return()=>C.visible=I.states.includes(A.state);const i=g.getObjectByName(I.minNodeName),B=g.getObjectByName(I.maxNodeName);return i==null||B==null?()=>{}:()=>{const Q=zV(A,I);C.quaternion.slerpQuaternions(i.quaternion,B.quaternion,Q),C.position.lerpVectors(i.position,B.position,Q),C.updateMatrix()}}function zV(g,{componentProperty:A,states:I}){const C=I.includes(g.state);switch(A){case"xAxis":return C?JF(g).x:.5;case"yAxis":return C?JF(g).y:.5;case"button":return C?g.button??0:0;case"state":return C?1:0}}const bs=new LA;function JF({xAxis:g=0,yAxis:A=0}){if(bs.lengthSq()>1){const C=Math.atan2(A,g);bs.set(Math.cos(C),Math.sin(C))}else bs.set(g,A);return bs.multiplyScalar(.5).addScalar(.5),bs}function $V({_listeners:g,__r3f:A}){return g!=null&&Object.keys(g).length>0||A!=null&&(A==null?void 0:A.eventCount)>0}function Aj({_listeners:g,__r3f:A},I){if(g!=null&&I in g)return g[I];if(A==null)return;const C=A.handlers[Ij[I]];if(C!=null)return[C]}const Ij={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class ri{constructor(A,I,C,i,B,Q=B.object,e=Q){LI(this,"type");LI(this,"bubbles");LI(this,"nativeEvent");LI(this,"pointer");LI(this,"intersection");LI(this,"currentObject");LI(this,"object");LI(this,"stopPropagation");LI(this,"stopImmediatePropagation");this.type=A,this.bubbles=I,this.nativeEvent=C,this.pointer=i,this.intersection=B,this.currentObject=Q,this.object=e}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new ri(I,C,i,B,Q,A,e)}}class zM extends ri{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(A,I,C,i,B){super("wheel",!0,A,I,C,i,B)}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new zM(i,B,Q,A,e)}}function aB(g){$L(g,g.currentObject)}function $L(g,A){if(A==null)return;const I=Aj(A,g.type);let C=!g.bubbles;if(I!=null&&I.length>0){const i=g.retarget(A),B=I.length;i.stopPropagation=()=>C=!0;let Q=!1;i.stopImmediatePropagation=()=>{C=!0,Q=!0};for(let e=0;e=0;e--){const t=this.pointerEnteredHelper[e];aB(new ri("pointerenter",!1,A,this,C,t))}if(C!=null&&aB(new ri("pointermove",!0,A,this,C)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;tC){e.set(A.button,A.timeStamp);return}aB(new ri("dblclick",!0,A,this,this.intersection)),e.delete(A.button)}cancel(A){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,A));return}this.intersection!=null&&aB(new ri("pointercancel",!0,A,this,this.intersection))}}wheel(A,I,C){if(!this.enabled)return;let i=this.intersection;if(C||(i=this.computeIntersection(A,I,this.pointerCapture)),!this.wasMoved&&C){this.onFirstMove.push(this.cancel.bind(this,I));return}i!=null&&aB(new zM(I,this,i))}exit(A){var I;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,A));return}this.pointerCapture!=null&&((I=this.parentReleasePointerCapture)==null||I.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(A)}}function IY(g,A,I,C){if(g==null)return;const i=I.indexOf(g);i!=-1?I.splice(i,1):C.push(g),A.push(g),IY(g.parent,A,I,C)}function gj(g,A,I,C,i){if(A==null)return!1;const B=A.get(I);return!(B==null||C-B>i||B!=g.get(I))}function I0(g,A,I){return A.face==null?!1:(g.setFromNormalAndCoplanarPoint(A.face.normal,A.localPoint),g.applyMatrix4(I.matrixWorld),!0)}function Cj(g,A,I,C,i,B){if(A==="none"||A==="listener"&&!g)return!1;if(I==="all")return!0;if(typeof I=="function")return I(C,i,B);let Q,e;"deny"in I?(e=!0,Q=I.deny):(e=!1,Q=I.allow);let t;return Array.isArray(Q)?t=Q.includes(i):t=Q===i,e?!t:t}function TS(g,A,I,C,i,B=!1,Q,e,t){const E=B||$V(g),o=g.pointerEvents??Q,s=g.pointerEventsType??e,r=g.pointerEventsOrder??t;Cj(E,o??"listener",s??"all",A,I,C)&&i(g,r);const c=g.children.length;for(let w=0;w0)&&(g=E,Q=t)}return Q}function ij(g,A=0,I,C=0){return A!=C?C-A:g.distance-I.distance}const xQ=new Fr,Bj=new II,Lo=[];function Qj(g,A,I,C,i,B,Q,e){if(Q!=null)return ej(g,A,Q);let t,E;if(TS(I,C,i,B,(o,s)=>{let r=0;const l=((t==null?void 0:t.details.lineIndex)??A.length-2)+2;for(let c=1;c0;C--){const i=A[C-1],B=A[C];if(yu.origin.copy(i).applyMatrix4(g),yu.direction.copy(B).applyMatrix4(g).sub(xQ.ray.origin).normalize(),yu.intersectPlane(I,mF)!=null)return mF.clone()}}const du=new Fr,ku=new T,LF=new OB,Ej=new II,Zc=[];function oj(g,A,I,C,i,B,Q,e,t){if(e!=null)return nj(g,A,I,e);let E,o;if(du.ray.origin.copy(g),du.ray.direction.copy(I).applyQuaternion(A),TS(C,i,B,Q,(s,r)=>{s.raycast(du,Zc);const l=g0(E,o,Zc,r,t);l!=null&&(E=Zc[l],o=r),Zc.length=0}),E!=null)return Object.assign(E,{details:{type:"ray"},pointerPosition:g.clone(),pointerQuaternion:A.clone(),pointOnFace:E.point,localPoint:E.point.clone().applyMatrix4(Ej.copy(E.object.matrixWorld).invert())})}const YF=new lt;function nj(g,A,I,{intersection:C,object:i}){if(C.details.type!="ray")return;ku.copy(I).applyQuaternion(A),YF.set(g,ku),I0(LF,C,i);const B=YF.intersectPlane(LF,new T)??C.point;return{...C,object:i,pointOnFace:B,point:ku.clone().multiplyScalar(C.distance).add(g),pointerPosition:g.clone(),pointerQuaternion:A.clone()}}const Mu=new jg,Wc=[];function gY(g,A,I,C,i,B,Q,e,t){if(e!=null)return rj(g,A,e);let E,o;if(Mu.center.copy(g),Mu.radius=I,TS(C,i,B,Q,(s,r)=>{aj(Mu,s,Wc);const l=g0(E,o,Wc,r,t);l!=null&&(E=Wc[l],o=r),Wc.length=0}),E!=null)return Object.assign(E,{details:{type:"sphere"},pointOnFace:E.point,pointerPosition:g.clone(),pointerQuaternion:A.clone(),localPoint:E.point.clone().applyMatrix4(lD.copy(E.object.matrixWorld).invert())})}const Vc=new II;function sj(g){return"spherecast"in g}function aj(g,A,I){if(A.updateWorldMatrix(!0,!1),sj(A)){A.spherecast(g,I);return}if(A instanceof kr){A.geometry.boundingSphere==null&&A.geometry.computeBoundingSphere(),A.geometry.boundingBox==null&&A.geometry.computeBoundingBox();for(let i=0;ig.radius*g.radius)return;pu.max(lj);const Q=rn.center.clone().sub(bF);Q.divide(pu),cj(Q);const e=jc.clone();return{distance:Math.sqrt(B),face:{a:0,b:0,c:0,materialIndex:0,normal:Q},normal:Q,point:e,instanceId:C,object:A}}function cj(g){const A=Math.abs(g.x),I=Math.abs(g.y),C=Math.abs(g.z);if(A>=I&&A>=C){g.set(g.x<0?-1:1,0,0);return}if(I>=A&&I>=C){g.set(0,g.y<0?-1:1,0);return}g.set(0,0,g.z<0?-1:1)}const yd={radius:.07};function hj(g,A,I=yd,C="grab"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o!=null)return o.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),gY(i,B,I.radius??yd.radius,e,Q,C,A,E,I)},void 0,void 0,void 0,I)}const Dj=new T(0,0,-1),Sj=new T,Ba={direction:Dj,minDistance:0,linePoints:null};function wj(g,A,I=Ba,C="ray"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o==null)return;o.updateWorldMatrix(!0,!1);let s;const r=I.linePoints??Ba.linePoints;if(r==null?(i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),s=oj(i,B,I.direction??Ba.direction,e,Q,C,A,E,I)):s=Qj(o.matrixWorld,r,e,Q,C,A,E,I),!(s==null||s.distance*o.getWorldScale(Sj).x<(I.minDistance??Ba.minDistance)))return s},void 0,void 0,void 0,I)}const ln={button:0,downRadius:.03,hoverRadius:.1};function Gj(g,A,I=ln,C="touch"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o!=null)return o.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),gY(i,B,I.hoverRadius??ln.hoverRadius,e,Q,C,A,E,I)},uj(I),void 0,void 0,I)}function uj(g=ln){let A=!1;return I=>{if(!I.getEnabled())return;const C=I.getIntersection(),i=yj(C,g.downRadius??ln.downRadius);if(i===A)return;const B={timeStamp:performance.now(),button:g.button??ln.button};i?I.down(B):I.up(B),A=i}}function yj(g,A){return g==null?!1:g.distance<=A}let dj=23412;function C0(){return dj++}new T;new LA;let kj=class{constructor(){LI(this,"pointers",[]);LI(this,"isDefaults",[]);LI(this,"enabled",!0)}register(A,I){return this.pointers.push(A),this.isDefaults.push(I),this.unregister.bind(this,A)}unregister(A){const I=this.pointers.indexOf(A);I!==-1&&(this.isDefaults.splice(I,1),this.pointers.splice(I,1))}move(A,I){var Q,e;if(!this.enabled)return;const C=this.pointers.length;if(C===0)return;for(let t=0;t=g.lastChangedTime)return A;const I=new pI;return I.setIndex(new GI(g.indices,1)),I.setAttribute("position",new GI(g.vertices,3)),Object.assign(I,{creationTime:g.lastChangedTime})}function PF(g,A){return A!=null&&A.createdAt!=null&&A.createdAt>=g.lastChangedTime?A:Object.assign(Mj(g.polygon),{createdAt:g.lastChangedTime})}const _s=new Sm,Xc=new LA;function Mj(g){const A=new Bt,I=g.map(({x:i,z:B})=>new LA(i,B));_s.setFromPoints(I),_s.getSize(Xc);for(const i of I)i.sub(_s.min),i.divide(Xc);A.setFromPoints(I);const C=new fr(A);return C.scale(Xc.x,Xc.y,1),C.translate(_s.min.x,_s.min.y,0),C.rotateX(Math.PI/2),C}new T;new T;new T;const Ps=new LC(0,0,0,"YXZ"),zc=new gg;function pj(g,A,I){g.matrixWorld.decompose(A.position,zc,A.scale),Ps.setFromQuaternion(zc),Ps.z=0,Ps.x=dh(Ps.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),zc.setFromEuler(Ps),A.quaternion.slerp(zc,I/100)}function Uj(g){return g.userData.teleportTarget===!0}function fj(g={}){return A=>!(!Uj(A.object)||g.customFilter!=null&&!g.customFilter(A))}function Nj(){return new jD(new T(0,0,0),new T(0,0,-8),new T(0,-20,-15)).getPoints(20)}let Fj=class extends eg{constructor(I){const C=new vZ,i=new Float32Array(I.length*3);for(let e=0;ee.distanceTo(I[t+1]))}update(I){if(!I.getEnabled()||I.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const i=I.getIntersection();if((i==null?void 0:i.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:B,lineIndex:Q}=i.details,e=this.lineLengths[Q];this.material.visibility=this.multiplier*(Q+B/e)/this.lineLengths.length;const{color:t="white",opacity:E=.4,size:o=.01}=this.options;this.material.lineWidth=o,this.material.opacity=typeof E=="function"?E(I):E;const s=typeof t=="function"?t(I):t;Array.isArray(s)?this.material.color.set(...s):this.material.color.set(s)}};const $c=new II,Ah=new T,ZF=new gg;async function Rj(g,A,I=["point","plane","mesh"]){var t,E;let C,i,B;const Q=g.getState();if(A instanceof XRSpace)i=A,B=Q.origin;else{if(Q.originReferenceSpace==null)return;B=A,i=LV(A,Q.origin,Q.originReferenceSpace,$c)??Q.originReferenceSpace,i===Q.originReferenceSpace&&WL(A,Q.origin,$c),Ah.setFromMatrixPosition($c);const o={...Ah};ZF.setFromRotationMatrix($c),Ah.set(0,0,-1).applyQuaternion(ZF);const s={...Ah};C=new XRRay(o,s)}const e=await((E=(t=g.getState().session)==null?void 0:t.requestHitTestSource)==null?void 0:E.call(t,{space:i,entityTypes:Array.isArray(I)?I:[I],offsetRay:C}));if(e!=null)return{source:e,getWorldMatrix:Kj.bind(null,i,B)}}function Kj(g,A,I,C){const i=C.getPose(g);return i==null?!1:(I.fromArray(i.transform.matrix),A!=null&&I.premultiply(A.matrixWorld),!0)}new T(1,1,1);new T(1,1,1);new II;new II;new T;new T;const CY=new F8,iY="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",Jj="generic-trigger";class qj{constructor(A){LI(this,"baseAssetPath");LI(this,"defaultProfileId");LI(this,"profilesListPromise");LI(this,"profilePromisesMap",new Map);LI(this,"loadAsync",this.load);this.baseAssetPath=(A==null?void 0:A.baseAssetPath)??iY,this.defaultProfileId=(A==null?void 0:A.defaultControllerProfileId)??Jj}async load(A,I){const C=await this.loadProfile(A);for(const i in C.layouts)if(i.includes(I))return C.layouts[i];throw new Error(`No matching layout for "${I}", in profile ${C.profileId} with layouts ${Object.keys(C.layouts).join(", ")}.`)}async loadProfile(A){this.profilesListPromise??(this.profilesListPromise=WF(new URL("profilesList.json",this.baseAssetPath).href));const I=await this.profilesListPromise,C=A.length;for(let B=0;Bg.visibilityState)}function Tj(g,A){const I=j.useRef(A);I.current=A;const[C,i]=j.useMemo(()=>{let B;return[Q=>{let e=!1;return navigator.xr==null?(B=!1,()=>{}):(navigator.xr.isSessionSupported(g).then(t=>{B=t,!e&&Q()}).catch(t=>{var E;e||(E=I.current)==null||E.call(I,t)}),()=>e=!0)},()=>B]},[g]);return j.useSyncExternalStore(C,i)}j.forwardRef(({id:g,children:A,onPress:I,onRelease:C},i)=>{const B=i0(),[Q,e]=j.useState(void 0);if(j.useImperativeHandle(i,()=>Q,[Q]),xj(g,t=>t==="pressed"?I==null?void 0:I():C==null?void 0:C()),lC(()=>{var t;return e((t=B.gamepad[g])==null?void 0:t.object)}),Q!=null)return QM(A,Q)});function xj(g,A,I){const C=i0(),i=j.useRef();lC(()=>{var Q;const B=(Q=C==null?void 0:C.gamepad[g])==null?void 0:Q.state;B!=null&&B!=i.current&&A(B),i.current=B})}function i0(g){const A=j.useContext(uQ);if(A==null||A.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return A}const vj=Symbol("loadXRControllerModel"),bj=j.forwardRef((g,A)=>{const I=i0(),C=Rr(WV,[I.layout,void 0,vj]);VV(C,g),I.object=C,j.useImperativeHandle(A,()=>C,[C]);const i=j.useMemo(()=>jV(C,I.layout,I.gamepad),[C,I.layout,I.gamepad]);return lC(i),nA.jsx("primitive",{object:C})});function xS(g){const A=j.useContext(uQ);if(A==null||A.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return A}const Oj=Symbol("loadXRHandModel"),EY=j.forwardRef((g,A)=>{const I=xS(),C=Rr(DV,[I.assetPath,void 0,Oj]);SV(C,g),j.useImperativeHandle(A,()=>C,[C]);const i=a5(),B=j.useMemo(()=>yV(I.inputSource.hand,C,i),[I.inputSource,C,i]);return lC((Q,e,t)=>B(t)),nA.jsx("primitive",{object:C})});j.forwardRef(({joint:g,children:A},I)=>{const C=xS();return nA.jsx(FB,{ref:I,space:C.inputSource.hand.get(g),children:A})});function oY({children:g}){const A=j.useMemo(()=>new kj,[]);return sY(A),lC(I=>A.move(I.scene,{timeStamp:performance.now()}),-50),nA.jsx(tY.Provider,{value:A,children:g})}function _j(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,yd,I);const B=j.useMemo(()=>hj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}function nY(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,Ba,I);const B=j.useMemo(()=>wj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}function Pj(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,ln,I);const B=j.useMemo(()=>Gj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}const Zj=j.forwardRef((g,A)=>{const I=j.useMemo(()=>new FV,[]),C=j.useRef(null);return j.useImperativeHandle(A,()=>C.current,[]),lC(()=>C.current!=null&&RV(C.current,I,g.pointer,g)),nA.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:g.renderOrder??2,ref:C,material:I,children:nA.jsx("boxGeometry",{})})}),vS=j.forwardRef((g,A)=>{const I=j.useMemo(()=>new UV,[]),C=j.useRef(null);j.useImperativeHandle(A,()=>C.current,[]),lC(()=>C.current!=null&&NV(C.current,I,g.pointer,g));const i=OE(B=>B.scene);return QM(nA.jsx("mesh",{renderOrder:g.renderOrder??1,ref:C,matrixAutoUpdate:!1,material:I,children:nA.jsx("planeGeometry",{})}),i)});function B0(g,A,I,C){const i=zg(B=>B.session);j.useEffect(()=>{if(i!=null)return KV(g,i,A,I,C)},[I,A,g,i,C])}function Q0(g,A=!1){const I=j.useContext(tY);I==null?(sY(g),lC(C=>g.move(C.scene,{timeStamp:performance.now()}),-50)):j.useEffect(()=>I.register(g,A),[I,g,A]),j.useEffect(()=>()=>g.exit({timeStamp:performance.now()}),[g])}function sY(g){const A=e0();j.useEffect(()=>pV(A,I=>g.setEnabled(I,{timeStamp:performance.now()})),[A,g])}const Wj=j.forwardRef(({pointer:g,linePoints:A,...I},C)=>{const i=j.useMemo(()=>new Fj(A),[A]);return j.useImperativeHandle(C,()=>i,[i]),i.options=I,lC(()=>i.update(g)),nA.jsx("primitive",{object:i})});function aY(g,A,I){const C=j.useContext(uQ);if(C==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const i=j.useRef(null),B=_j(i,C,I);B0(B,C.inputSource,g,C.events);const Q=I.cursorModel;return nA.jsx(FB,{ref:i,space:A(C.inputSource),children:Q!==!1&&nA.jsx(vS,{pointer:B,opacity:JV,...JC(Q)})})}const Vj=aY.bind(null,"select",g=>g.hand.get("index-finger-tip")),jj=aY.bind(null,"squeeze",g=>g.gripSpace);function Yr(g){const A=j.useContext(uQ);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=j.useRef(null),C=nY(I,A,g);B0(C,A.inputSource,"select",A.events);const i=g.rayModel,B=g.cursorModel;return nA.jsxs(FB,{ref:I,space:A.inputSource.targetRaySpace,children:[i!==!1&&nA.jsx(Zj,{pointer:C,opacity:rD,...JC(i)}),B!==!1&&nA.jsx(vS,{pointer:C,opacity:rD,...JC(B)})]})}function Xj(g){const A=xS(),I=j.useRef(null),C=Pj(I,A,g),i=g.cursorModel;return nA.jsx(FB,{ref:I,space:A.inputSource.hand.get("index-finger-tip"),children:i!==!1&&nA.jsx(vS,{pointer:C,opacity:qV,...JC(i)})})}function zj(g){const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.teleportPointer??!1;return nA.jsxs(nA.Fragment,{children:[A!==!1&&nA.jsx(j.Suspense,{children:nA.jsx(bj,{...JC(A)})}),nA.jsxs(oY,{children:[I!==!1&&nA.jsx(jj,{...JC(I)}),C!==!1&&nA.jsx(Yr,{makeDefault:!0,minDistance:.2,...JC(C)}),i!==!1&&nA.jsx(rY,{...JC(i)})]})]})}function $j(g){var e;const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.touchPointer,B=g.teleportPointer??!1,Q=C===!1?!1:(e=JC(C))==null?void 0:e.rayModel;return nA.jsxs(nA.Fragment,{children:[A!==!1&&nA.jsx(j.Suspense,{children:nA.jsx(EY,{...JC(A)})}),nA.jsxs(oY,{children:[I!==!1&&nA.jsx(Vj,{...JC(I)}),i!==!1&&nA.jsx(Xj,{...JC(i)}),C!==!1&&nA.jsx(Yr,{makeDefault:!0,minDistance:.2,...JC(C),rayModel:Q===!1?!1:{maxLength:.2,...JC(Q)}}),B!==!1&&nA.jsx(rY,{...JC(B)})]})]})}function A5(g){return nA.jsx(Yr,{...g,rayModel:!1})}function I5(g){return nA.jsx(Yr,{...g,rayModel:!1})}function g5(g){return nA.jsx(Yr,{...g,cursorModel:!1,rayModel:!1})}function rY(g){const A=j.useContext(uQ);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=j.useRef(null),C=j.useRef(null),i=j.useMemo(()=>Nj(),[]),B=nY(C,A,{...g,linePoints:i,customFilter:fj(g)},"teleport");B0(B,A.inputSource,"select",A.events);const Q=g.rayModel,e=g.cursorModel,t=OE(o=>o.scene),E=j.useRef(null);return lC((o,s)=>{E.current!=null&&(E.current.visible=B.getEnabled()&&B.getButtonsDown().size>0);const r=C.current,l=I.current;r==null||l==null||pj(l,r,s*1e3)}),nA.jsxs(nA.Fragment,{children:[nA.jsx(FB,{ref:I,space:A.inputSource.targetRaySpace}),QM(nA.jsxs("group",{ref:C,children:[Q!==!1&&nA.jsx(Wj,{linePoints:i,pointer:B,opacity:rD,...JC(Q)}),e!==!1&&nA.jsx(vS,{ref:E,pointer:B,opacity:rD,...JC(e)})]}),t)]})}function JC(g){if(g!==!0)return g}function C5({children:g}){const A=zg(Q=>Q.originReferenceSpace),I=zg(Q=>Q.origin),C=Hj()==="visible",i=Jr(),B=j.useMemo(()=>Object.assign({},i,{getState(){return{...i.getState(),scene:I}}}),[I,i]);return I==null||A==null?null:nA.jsx(nA.Fragment,{children:pn.createPortal(nA.jsx(aS.Provider,{value:i,children:nA.jsxs(Lr.Provider,{value:A,children:[nA.jsxs("group",{matrixAutoUpdate:!1,visible:C,children:[nA.jsx(i5,{}),nA.jsx(B5,{}),nA.jsx(Q5,{}),nA.jsx(e5,{}),nA.jsx(t5,{})]}),nA.jsx(E5,{}),nA.jsx(o5,{}),g]})}),B,null)})}function i5(){const g=zg(I=>I.controllerStates);let A=zg(I=>I.controller);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.gripSpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx(zj,{...C})})})},PE(I))})})}function B5(){const g=zg(I=>I.handStates),A=zg(I=>I.hand);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.hand.get("wrist"),children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx($j,{...C})})})},PE(I))})})}function Q5(){const g=zg(I=>I.transientPointerStates),A=zg(I=>I.transientPointer);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx(A5,{...C})})})},PE(I))})})}function e5(){const g=zg(I=>I.gazeStates),A=zg(I=>I.gaze);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof A=="function"?nA.jsx(A,{}):nA.jsx(I5,{...lY(A)})})})},PE(I)))})}function t5(){const g=zg(I=>I.screenInputStates),A=zg(I=>I.screenInput);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof A=="function"?nA.jsx(A,{}):nA.jsx(g5,{...lY(A)})})})},PE(I)))})}function lY(g){if(g!==!0)return g}function E5(){const g=zg(I=>I.detectedMeshes),A=zg(I=>I.detectedMesh);if(A!==!1)return nA.jsx(nA.Fragment,{children:g.map(I=>{const C=jL(A,I.semanticLabel,!1);return C===!1?null:nA.jsx(FB,{space:I.meshSpace,children:nA.jsx(QY.Provider,{value:I,children:nA.jsx(j.Suspense,{children:nA.jsx(C,{})})})},PE(I))})})}function o5(){const g=zg(I=>I.detectedPlanes),A=zg(I=>I.detectedPlane);if(A!=null)return nA.jsx(nA.Fragment,{children:g.map(I=>{const C=jL(A,I.semanticLabel,!1);return C===!1?null:nA.jsx(FB,{space:I.planeSpace,children:nA.jsx(eY.Provider,{value:I,children:nA.jsx(j.Suspense,{children:nA.jsx(C,{})})})},PE(I))})})}function n5(g){return TV(g)}function s5({children:g,store:A}){A.setWebXRManager(OE(C=>C.gl.xr));const I=Jr();return j.useEffect(()=>{let C;return A.subscribe((i,B)=>{const Q=i.mode!=null,e=B.mode!=null;if(Q!==e){if(Q){const{camera:t,gl:E}=I.getState();C=t,I.setState({camera:E.xr.getCamera()});return}C!=null&&I.setState({camera:C})}})},[I,A]),lC((C,i,B)=>A.onBeforeFrame(C.scene,C.camera,B),-1e3),nA.jsxs(BY.Provider,{value:A,children:[nA.jsx(C5,{}),g]})}function e0(){const g=j.useContext(BY);if(g==null)throw new Error("XR features can only be used inside the component");return g}function zg(g=A=>A){return nM(e0(),g)}const FB=j.forwardRef(({space:g,children:A},I)=>{const C=j.useRef(null);return j.useImperativeHandle(I,()=>C.current,[]),l5(C,g,(i,B,Q)=>{C.current!=null&&(C.current.visible=Q!=null)}),nA.jsx("group",{xrSpace:g,visible:!1,matrixAutoUpdate:!1,ref:C,children:nA.jsx(Lr.Provider,{value:g,children:A})})});function a5(){const g=j.useContext(Lr);if(g==null)throw new Error("XR objects must be placed inside the XROrigin");return g}function r5(g){const A=j.useContext(Lr),I=zg(C=>A??C.originReferenceSpace);return j.useMemo(()=>I==null?void 0:mV(g,I),[g,I])}function l5(g,A,I){const C=r5(A);lC((i,B,Q)=>{g.current==null||C==null||(C(g.current.matrix,Q),I==null||I(i,B,Q))},-100)}j.forwardRef((g,A)=>{const I=c5(),C=h5(I);return nA.jsx("mesh",{ref:A,geometry:C,...g})});function c5(){const g=j.useContext(QY);if(g==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return g}function h5(g,A=!0){const[I,C]=j.useState(_F(g,void 0));return lC(()=>C(i=>_F(g,i))),j.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}j.forwardRef((g,A)=>{const I=D5(),C=S5(I);return nA.jsx("mesh",{ref:A,geometry:C,...g})});function D5(){const g=j.useContext(eY);if(g==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return g}function S5(g,A=!0){const[I,C]=j.useState(PF(g,void 0));return lC(()=>C(i=>PF(g,i))),j.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}const w5=j.forwardRef(({children:g,...A},I)=>{const C=OE(B=>B.gl.xr.getCamera()),i=zg(B=>B.originReferenceSpace);return i==null?null:nA.jsxs("group",{ref:I,...A,children:[nA.jsx("primitive",{object:C}),nA.jsx(Lr.Provider,{value:i,children:g})]})});function G5(g,A,I){const C=j.useRef(void 0);u5(A,I,j.useCallback(i=>C.current=i,[])),lC((i,B,Q)=>{g==null||Q==null||C.current==null||g(Q.getHitTestResults(C.current.source),C.current.getWorldMatrix)})}function u5(g,A,I){const C=e0();j.useEffect(()=>{let i,B=!1;const Q=g instanceof XRSpace?g:g.current;if(Q!=null)return Rj(C,Q,A).then(e=>{B||(i=e,I(e))}),()=>{I(void 0),B=!0,i==null||i.source.cancel()}},[C,g,A,I])}j.forwardRef((g,A)=>{const I=j.useRef(null);return j.useImperativeHandle(A,()=>I.current),G5(g.onResults,I,g.trackableType),nA.jsx("group",{...g,ref:I})});j.forwardRef((g,A)=>{const I=zg(B=>B.domOverlayRoot),{In:C,Out:i}=j.useMemo(GW,[]);return j.useEffect(()=>{const B=wk(I);return B.render(nA.jsx(i,{})),()=>B.unmount()},[I,i]),nA.jsx(C,{children:nA.jsx("div",{...g,ref:A})})});const cY=j.forwardRef(({store:g,mode:A,onError:I,children:C,...i},B)=>{const Q=nM(g,t=>t.session),e=Tj(A,I);return nA.jsx("button",{ref:B,...i,onClick:()=>Q!=null?Q.end():g.enterXR(A).catch(I),children:typeof C=="function"?C(e?Q!=null?"entered":"exited":"unsupported"):C})});j.forwardRef((g,A)=>nA.jsx(cY,{ref:A,mode:"immersive-ar",...g}));j.forwardRef((g,A)=>nA.jsx(cY,{ref:A,mode:"immersive-vr",...g}));const y5={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:g=>g.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:g=>g.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:g=>g.pointerType==="ray"},onSqueeze:{type:"click",filter:g=>g.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:g=>g.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:g=>g.pointerType==="grab"}};function TQ(g,A,I){const C=j.useRef(I);C.current=I,j.useEffect(()=>{const{current:i}=g;if(i==null)return;const B=y5[A],Q=typeof B=="string"?t=>{var E;return(E=C.current)==null?void 0:E.call(C,{intersection:t,intersections:[t],target:t.pointerState})}:t=>{var E;t instanceof ri&&!B.filter(t)||(E=C.current)==null||E.call(C,{intersection:t,intersections:[t],target:t.pointerState})},e=typeof B=="string"?B:B.type;return i.addEventListener(e,Q),()=>i.removeEventListener(e,Q)},[g,A])}const d5=j.forwardRef(({onHover:g,onBlur:A,onSelectStart:I,onSelectEnd:C,onSelect:i,onSqueezeStart:B,onSqueezeEnd:Q,onSqueeze:e,onMove:t,children:E},o)=>{const s=j.useRef(null);return j.useImperativeHandle(o,()=>s.current),TQ(s,"onHover",g),TQ(s,"onBlur",A),TQ(s,"onSelectStart",I),TQ(s,"onSelectEnd",C),TQ(s,"onSelect",i),TQ(s,"onSqueezeStart",B),TQ(s,"onSqueezeEnd",Q),TQ(s,"onSqueeze",e),TQ(s,"onMove",t),nA.jsx("group",{ref:s,children:E})});j.forwardRef(function({onSelectStart:A,onSelectEnd:I,children:C,...i},B){const Q=j.useRef(),e=j.useRef(null),t=j.useMemo(()=>new II,[]);return j.useImperativeHandle(B,()=>e.current),lC(()=>{const E=Q.current,o=e.current;!o||!E||(o.applyMatrix4(t),o.applyMatrix4(E.matrixWorld),o.updateMatrixWorld(),t.copy(E.matrixWorld).invert())}),nA.jsx(d5,{ref:e,onSelectStart:E=>{dV(E.target)&&(E.target.type==="controller"||E.target.type==="hand")&&E.target.object!=null&&(Q.current=E.target.object,t.copy(E.target.object.matrixWorld).invert(),A==null||A(E))},onSelectEnd:E=>{E.target.controller===Q.current&&(Q.current=void 0),I==null||I(E)},...i,children:C})});const k5=Symbol(),t0=Symbol(),Zs="a",ua="w";let M5=(g,A)=>new Proxy(g,A);const dd=Object.getPrototypeOf,kd=new WeakMap,hY=g=>g&&(kd.has(g)?kd.get(g):dd(g)===Object.prototype||dd(g)===Array.prototype),cD=g=>typeof g=="object"&&g!==null,p5=g=>{if(Array.isArray(g))return Array.from(g);const A=Object.getOwnPropertyDescriptors(g);return Object.values(A).forEach(I=>{I.configurable=!0}),Object.create(dd(g),A)},E0=g=>g[t0]||g,DY=(g,A,I,C)=>{if(!hY(g))return g;let i=C&&C.get(g);if(!i){const t=E0(g);i=(E=>Object.values(Object.getOwnPropertyDescriptors(E)).some(o=>!o.configurable&&!o.writable))(t)?[t,p5(t)]:[t],C==null||C.set(g,i)}const[B,Q]=i;let e=I&&I.get(B);return e&&e[1].f===!!Q||(e=((t,E)=>{const o={f:E};let s=!1;const r=(c,w)=>{if(!s){let D=o[Zs].get(t);if(D||(D={},o[Zs].set(t,D)),c===ua)D[ua]=!0;else{let h=D[c];h||(h=new Set,D[c]=h),h.add(w)}}},l={get:(c,w)=>w===t0?t:(r("k",w),DY(Reflect.get(c,w),o[Zs],o.c,o.t)),has:(c,w)=>w===k5?(s=!0,o[Zs].delete(t),!0):(r("h",w),Reflect.has(c,w)),getOwnPropertyDescriptor:(c,w)=>(r("o",w),Reflect.getOwnPropertyDescriptor(c,w)),ownKeys:c=>(r(ua),Reflect.ownKeys(c))};return E&&(l.set=l.deleteProperty=()=>!1),[l,o]})(B,!!Q),e[1].p=M5(Q||B,e[0]),I&&I.set(B,e)),e[1][Zs]=A,e[1].c=I,e[1].t=C,e[1].p},SY=(g,A,I,C,i=Object.is)=>{if(i(g,A))return!1;if(!cD(g)||!cD(A))return!0;const B=I.get(E0(g));if(!B)return!0;if(C){const e=C.get(g);if(e&&e.n===A)return e.g;C.set(g,{n:A,g:!1})}let Q=null;try{for(const e of B.h||[])if(Q=Reflect.has(g,e)!==Reflect.has(A,e),Q)return Q;if(B[ua]===!0){if(Q=((e,t)=>{const E=Reflect.ownKeys(e),o=Reflect.ownKeys(t);return E.length!==o.length||E.some((s,r)=>s!==o[r])})(g,A),Q)return Q}else for(const e of B.o||[])if(Q=!!Reflect.getOwnPropertyDescriptor(g,e)!=!!Reflect.getOwnPropertyDescriptor(A,e),Q)return Q;for(const e of B.k||[])if(Q=SY(g[e],A[e],I,C,i),Q)return Q;return Q===null&&(Q=!0),Q}finally{C&&C.set(g,{n:A,g:Q})}},U5=g=>hY(g)&&g[t0]||null,jF=(g,A=!0)=>{kd.set(g,A)},f5=(g,A,I)=>{const C=[],i=new WeakSet,B=(Q,e)=>{if(i.has(Q))return;cD(Q)&&i.add(Q);const t=cD(Q)&&A.get(E0(Q));if(t){var E,o;if((E=t.h)==null||E.forEach(r=>{const l=`:has(${String(r)})`;C.push(e?[...e,l]:[l])}),t[ua]===!0){const r=":ownKeys";C.push(e?[...e,r]:[r])}else{var s;(s=t.o)==null||s.forEach(r=>{const l=`:hasOwn(${String(r)})`;C.push(e?[...e,l]:[l])})}(o=t.k)==null||o.forEach(r=>{!("value"in(Object.getOwnPropertyDescriptor(Q,r)||{}))||B(Q[r],e?[...e,r]:[r])})}else e&&C.push(e)};return B(g),C};var hD={BASE_URL:"/xr/examples/pingpong/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Uu=g=>typeof g=="object"&&g!==null,xe=new WeakMap,Ih=new WeakSet,N5=(g=Object.is,A=(E,o)=>new Proxy(E,o),I=E=>Uu(E)&&!Ih.has(E)&&(Array.isArray(E)||!(Symbol.iterator in E))&&!(E instanceof WeakMap)&&!(E instanceof WeakSet)&&!(E instanceof Error)&&!(E instanceof Number)&&!(E instanceof Date)&&!(E instanceof String)&&!(E instanceof RegExp)&&!(E instanceof ArrayBuffer),C=E=>{switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:throw E}},i=new WeakMap,B=(E,o,s=C)=>{const r=i.get(E);if((r==null?void 0:r[0])===o)return r[1];const l=Array.isArray(E)?[]:Object.create(Object.getPrototypeOf(E));return jF(l,!0),i.set(E,[o,l]),Reflect.ownKeys(E).forEach(c=>{if(Object.getOwnPropertyDescriptor(l,c))return;const w=Reflect.get(E,c),{enumerable:D}=Reflect.getOwnPropertyDescriptor(E,c),h={value:w,enumerable:D,configurable:!0};if(Ih.has(w))jF(w,!1);else if(w instanceof Promise)delete h.value,h.get=()=>s(w);else if(xe.has(w)){const[G,u]=xe.get(w);h.value=B(G,u(),s)}Object.defineProperty(l,c,h)}),Object.preventExtensions(l)},Q=new WeakMap,e=[1,1],t=E=>{if(!Uu(E))throw new Error("object required");const o=Q.get(E);if(o)return o;let s=e[0];const r=new Set,l=(f,p=++e[0])=>{s!==p&&(s=p,r.forEach(m=>m(f,p)))};let c=e[1];const w=(f=++e[1])=>(c!==f&&!r.size&&(c=f,h.forEach(([p])=>{const m=p[1](f);m>s&&(s=m)})),s),D=f=>(p,m)=>{const q=[...p];q[1]=[f,...q[1]],l(q,m)},h=new Map,G=(f,p)=>{if((hD?"production":void 0)!=="production"&&h.has(f))throw new Error("prop listener already exists");if(r.size){const m=p[3](D(f));h.set(f,[p,m])}else h.set(f,[p])},u=f=>{var p;const m=h.get(f);m&&(h.delete(f),(p=m[1])==null||p.call(m))},d=f=>(r.add(f),r.size===1&&h.forEach(([m,q],L)=>{if((hD?"production":void 0)!=="production"&&q)throw new Error("remove already exists");const O=m[3](D(L));h.set(L,[m,O])}),()=>{r.delete(f),r.size===0&&h.forEach(([m,q],L)=>{q&&(q(),h.set(L,[m]))})}),F=Array.isArray(E)?[]:Object.create(Object.getPrototypeOf(E)),N=A(F,{deleteProperty(f,p){const m=Reflect.get(f,p);u(p);const q=Reflect.deleteProperty(f,p);return q&&l(["delete",[p],m]),q},set(f,p,m,q){const L=Reflect.has(f,p),O=Reflect.get(f,p,q);if(L&&(g(O,m)||Q.has(m)&&g(O,Q.get(m))))return!0;u(p),Uu(m)&&(m=U5(m)||m);let iA=m;if(m instanceof Promise)m.then(AA=>{m.status="fulfilled",m.value=AA,l(["resolve",[p],AA])}).catch(AA=>{m.status="rejected",m.reason=AA,l(["reject",[p],AA])});else{!xe.has(m)&&I(m)&&(iA=t(m));const AA=!Ih.has(iA)&&xe.get(iA);AA&&G(p,AA)}return Reflect.set(f,p,iA,q),l(["set",[p],m,O]),!0}});Q.set(E,N);const K=[F,w,B,d];return xe.set(N,K),Reflect.ownKeys(E).forEach(f=>{const p=Object.getOwnPropertyDescriptor(E,f);"value"in p&&(N[f]=E[f],delete p.value,delete p.writable),Object.defineProperty(F,f,p)}),N})=>[t,xe,Ih,g,A,I,C,i,B,Q,e],[F5]=N5();function R5(g={}){return F5(g)}function K5(g,A,I){const C=xe.get(g);(hD?"production":void 0)!=="production"&&!C&&console.warn("Please use proxy object");let i;const B=[],Q=C[3];let e=!1;const E=Q(o=>{B.push(o),i||(i=Promise.resolve().then(()=>{i=void 0,e&&A(B.splice(0))}))});return e=!0,()=>{e=!1,E()}}function XF(g,A){const I=xe.get(g);(hD?"production":void 0)!=="production"&&!I&&console.warn("Please use proxy object");const[C,i,B]=I;return B(C,i(),A)}var J5={BASE_URL:"/xr/examples/pingpong/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{use:zF}=MI,{useSyncExternalStore:q5}=QW,m5=(g,A)=>{const I=j.useRef();j.useEffect(()=>{I.current=f5(g,A)}),j.useDebugValue(I.current)},L5=new WeakMap;function Y5(g,A){const C=j.useRef(),i=j.useRef();let B=!0;const Q=q5(j.useCallback(E=>{const o=K5(g,E);return E(),o},[g,void 0]),()=>{const E=XF(g,zF);try{if(!B&&C.current&&i.current&&!SY(C.current,E,i.current,new WeakMap))return C.current}catch{}return E},()=>XF(g,zF));B=!1;const e=new WeakMap;j.useEffect(()=>{C.current=Q,i.current=e}),(J5?"production":void 0)!=="production"&&m5(Q,e);const t=j.useMemo(()=>new WeakMap,[]);return DY(Q,e,t,L5)}const fu=new Audio("ping.mp3"),Er=R5({count:0,api:{pong(g){console.log(g),fu.currentTime=0,fu.volume=Math.min(Math.max(0,g/20,0),1),fu.play(),g>10&&++Er.count},reset:()=>Er.count=0}});function H5(){const g=xS();return nA.jsxs(nA.Fragment,{children:[nA.jsx(j.Suspense,{children:nA.jsx(EY,{renderOrder:-1,colorWrite:!1})}),nA.jsx("group",{scale:.045,children:nA.jsx(j.Suspense,{children:nA.jsx(T5,{handedness:g.inputSource.handedness})})})]})}const $F=new T,AR=new gg;function T5({handedness:g}){const A=j.useRef(),I=j.useRef(),C=j.useRef(),{count:i}=Y5(Er),{nodes:B,materials:Q}=lS("pingpong.glb"),e=j.useCallback(t=>{Er.api.pong(t.totalForceMagnitude*1300)},[]);return lC(()=>{I.current.getWorldPosition($F),A.current.setTranslation($F),I.current.getWorldQuaternion(AR),A.current.setRotation(AR)}),nA.jsxs("group",{position:[0,-1,-1.6],"rotation-z":g==="left"?.6:-.6,"rotation-x":0,"rotation-y":g==="left"?-.7:.7,children:[nA.jsx("group",{ref:I,position:[.1,.3,-2.6],children:nA.jsx(YZ,{anchorX:"center",anchorY:"middle",rotation:[-Math.PI/2,Math.PI,0],position:[0,-.2,0],fontSize:10,scale:.15,children:i})}),nA.jsx(tr,{ccd:!0,canSleep:!1,ref:A,type:"kinematicPosition",colliders:!1,children:nA.jsx(XM,{onContactForce:e,args:[.15,1.9]})}),nA.jsx("group",{ref:C,scale:.15,children:nA.jsxs("group",{rotation:[0,-.04,0],scale:141.94,children:[nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.wood,geometry:B.mesh.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.side,geometry:B.mesh_1.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.foam,geometry:B.mesh_2.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.lower,geometry:B.mesh_3.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.upper,geometry:B.mesh_4.geometry})]})})]})}const Nu=n5({hand:H5});function x5(){return nA.jsxs(nA.Fragment,{children:[nA.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1rem",position:"absolute",zIndex:1e4,bottom:"1rem",left:"50%",transform:"translate(-50%, 0)"},children:[nA.jsx("button",{style:{background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",boxShadow:"0px 0px 20px rgba(0,0,0,1)"},onClick:()=>Nu.enterAR(),children:"Enter AR"}),nA.jsx("button",{style:{background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",boxShadow:"0px 0px 20px rgba(0,0,0,1)"},onClick:()=>Nu.enterVR(),children:"Enter VR"})]}),nA.jsx(iP,{shadows:!0,dpr:[1,1.5],children:nA.jsx(n8,{maxCcdSubsteps:10,gravity:[0,-5,0],timeStep:"vary",children:nA.jsxs(s5,{store:Nu,children:[nA.jsx("color",{attach:"background",args:["#f0f0f0"]}),nA.jsx("ambientLight",{intensity:.5*Math.PI}),nA.jsx("spotLight",{decay:0,position:[-10,15,-5],angle:1,penumbra:1,intensity:2,castShadow:!0,"shadow-mapSize":1024,"shadow-bias":-1e-4}),nA.jsx(j.Suspense,{children:nA.jsx(v5,{})}),nA.jsx(w5,{})]})})})]})}function v5(){const g=j.useRef(),A=oM("crossp.jpg"),I=j.useCallback(()=>{Er.api.reset(),g.current.resetForces(!0),g.current.resetTorques(!0),g.current.setTranslation({x:0,y:2,z:-.5}),g.current.setAngvel({x:0,y:0,z:0}),g.current.setLinvel({x:0,y:2,z:0})},[]);return nA.jsxs(nA.Fragment,{children:[nA.jsxs(tr,{ccd:!0,ref:g,angularDamping:.1,restitution:1.5,canSleep:!1,colliders:!1,enabledTranslations:[!0,!0,!1],children:[nA.jsx(YL,{args:[.02]}),nA.jsxs("mesh",{castShadow:!0,receiveShadow:!0,children:[nA.jsx("sphereGeometry",{args:[.02,64,64]}),nA.jsx("meshStandardMaterial",{map:A})]})]}),nA.jsx(tr,{type:"fixed",colliders:!1,position:[0,-3,0],restitution:2.1,onCollisionEnter:I,children:nA.jsx(LL,{args:[1e3,2,1e3]})})]})}wk(document.getElementById("root")).render(nA.jsx(j.StrictMode,{children:nA.jsx(x5,{})}));export{ct as B,xn as C,fi as D,LC as E,sI as F,yB as G,YC as L,II as M,YI as O,GQ as P,gg as Q,Fr as R,Nr as S,QS as T,T as V,qq as W,Vg as a,pI as b,eg as c,Ur as d,SQ as e,Xh as f,or as g,iC as h,iS as i,nA as j,pB as k,wk as l,MI as o,j as r}; + diffuseColor.a *= vFade;`)}}function RV(g,A,I,C){if(!I.getEnabled()){g.visible=!1;return}g.visible=!0;const i=I.getIntersection(),B=typeof C.color=="function"?C.color(I):C.color;Array.isArray(B)?A.color.set(...B):A.color.set(B??"white"),A.opacity=typeof C.opacity=="function"?C.opacity(I):C.opacity??.4;let Q=C.maxLength??1;i!=null&&(Q=Math.min(Q,i.distance)),g.position.z=-Q/2;const e=C.size??.005;g.scale.set(e,e,Q),g.updateMatrix()}function KV(g,A,I,C,i,B={}){const Q=s=>{s.inputSource===I&&g.down(Object.assign(s,{button:B.button??0}))},e=s=>{s.inputSource===I&&g.up(Object.assign(s,{button:B.button??0}))},t=`${C}start`,E=`${C}end`,o=i.length;for(let s=0;s{A.removeEventListener(t,Q),A.removeEventListener(E,e)}}function JV(g){var A;return g.getButtonsDown().size>0?.6:ZL(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.07,0,.2,.4)}function rD(g){return g.getButtonsDown().size>0?.6:.4}function qV(g){var A;return ZL(((A=g.getIntersection())==null?void 0:A.distance)??1/0,.1,.03,.2,.6)}function ZL(g,A,I,C,i){return C+Math.max(0,Math.min(1,(g-A)/(I-A)))*(i-C)}function mV(g,A){return(I,C)=>{if(g===A)return I.identity(),!0;const i=typeof A=="function"?A():A;if(i==null)return!1;const B=C==null?void 0:C.getPose(g,i);return B==null?!1:(I.fromArray(B.transform.matrix),!0)}}function WL(g,A,I){if(A==null){I.copy(g.matrixWorld);return}I.copy(A.matrixWorld).invert().multiply(g.matrixWorld)}function LV(g,A,I,C){C==null||C.copy(g.matrix);const i=VL(g,C);return i!=null||A==null||I==null?i:(C!=null&&WL(g,A,C),I)}function VL({parent:g},A){if(g!=null)return A!=null&&A.premultiply(g.matrix),g.xrSpace??VL(g,A)}function YV(g,A,{anchors:I=!0,handTracking:C=!0,layers:i=!0,meshDetection:B=!0,planeDetection:Q=!0,originReferenceSpace:e="local-floor",customSessionInit:t,depthSensing:E=!1,hitTest:o=!0,unbounded:s=!0,domOverlay:r=!0}={}){if(t!=null)return t;const l=[e],c=[];return r instanceof Element&&(r=!0),HQ(I,"anchors",l,c),HQ(C,"hand-tracking",l,c),HQ(i,"layers",l,c),HQ(B,"mesh-detection",l,c),HQ(Q,"plane-detection",l,c),HQ(E,"depth-sensing",l,c),HQ(r,"dom-overlay",l,c),HQ(o,"hit-test",l,c),g!="immersive-vr"&&HQ(s,"unbounded",l,c),{requiredFeatures:l,optionalFeatures:c,domOverlay:{root:A}}}function HQ(g,A,I,C){if(g!==!1){if(g===!0){C.push(A);return}I.push(A)}}function _e(g,A,I){return typeof g=="function"?g:(typeof g=="object"&&(A!=null&&HV(g,A)?g=g[A]:"default"in g&&(g=g.default)),g===!1?!1:g===!0?I:g??I)}function HV(g,A){return A in g}function jL(g,A,I){return g??(g=I),g===!1?!1:typeof g=="function"?g:A!=null&&A in g?g[A]??I:"default"in g?g.default??I:g}const XL={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function FF(g,A){var I,C;Promise.all([(I=navigator.xr)==null?void 0:I.isSessionSupported("immersive-vr"),(C=navigator.xr)==null?void 0:C.isSessionSupported("immersive-ar")]).then(([i,B])=>!B&&!i?QL(()=>import("./emulate-C93hwdRN.js"),[]):void 0).then(i=>{A&&window.alert("emulator started"),i==null||i.emulate(g===!0?"metaQuest3":g)})}function TV(g){const A=(g==null?void 0:g.emulate)??"metaQuest3";let I;if(A!=!1){window.location.hostname==="localhost"&&FF(A,!1);const r=l=>{l.altKey&&l.metaKey&&l.code==="KeyE"&&FF(A,!0)};window.addEventListener("keydown",r),I=()=>window.removeEventListener("keydown",r)}const C=(g==null?void 0:g.domOverlay)instanceof HTMLElement?g.domOverlay:document.createElement("div"),i=eL(()=>({...XL,controller:g==null?void 0:g.controller,hand:g==null?void 0:g.hand,gaze:g==null?void 0:g.gaze,screenInput:g==null?void 0:g.screenInput,transientPointer:g==null?void 0:g.transientPointer,detectedMesh:g==null?void 0:g.detectedMesh,detectedPlane:g==null?void 0:g.detectedPlane,domOverlayRoot:C}));let B;if(C.parentNode==null){const r=c=>{C.style.display=c.session!=null?"block":"none"},l=i.subscribe(r);r(i.getState()),document.body.appendChild(C),B=()=>{C.remove(),l()}}document.body.append(C);const Q=MV({controller:r=>i.setState({controllerStates:[...i.getState().controllerStates,r]})},g),e=OV(i,Q),t=bV(g==null?void 0:g.enterGrantedSession,r=>Pc(C,r,g,s));let E;const o=[];let s;return Object.assign(i,{requestFrame(){return new Promise(r=>o.push(r))},setWebXRManager(r){if(s===r)return;s=r;const{foveation:l,originReferenceSpace:c="local-floor"}=g??{};r.setReferenceSpaceType(c),l!=null&&r.setFoveation(l),E==null||E(),E=vV(r,e)},setFrameRate(r){const{session:l}=i.getState();l!=null&&zL(l,r)},setHand(r,l){if(l==null){i.setState({hand:r});return}const c=i.getState().hand,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({hand:w})},setController(r,l){if(l==null){i.setState({controller:r});return}const c=i.getState().controller,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({controller:w})},setTransientPointer(r,l){if(l==null){i.setState({transientPointer:r});return}const c=i.getState().transientPointer,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({transientPointer:w})},setGaze(r){i.setState({gaze:r})},setScreenInput(r){i.setState({screenInput:r})},setDetectedPlane(r,l){if(l==null){i.setState({detectedPlane:r});return}const c=i.getState().detectedPlane,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({detectedPlane:w})},setDetectedMesh(r,l){if(l==null){i.setState({detectedMesh:r});return}const c=i.getState().detectedMesh,w={};typeof c=="object"&&Object.assign(w,c),Object.assign(w,{default:_e(c,void 0,{}),[l]:r}),i.setState({detectedMesh:w})},destroy(){I==null||I(),B==null||B(),E==null||E(),t==null||t(),e(void 0,void 0)},enterXR:r=>Pc(C,r,g,s),enterAR:()=>Pc(C,"immersive-ar",g,s),enterVR:()=>Pc(C,"immersive-vr",g,s),onBeforeFrame(r,l,c){const{origin:w}=i.getState(),D=l.parent??r,h=(s==null?void 0:s.getReferenceSpace())??void 0;w!=D&&(D.xrSpace=h,i.setState({origin:D}));const{originReferenceSpace:G}=i.getState();if(h!=G&&(D.xrSpace=h,i.setState({originReferenceSpace:h})),c==null)return;s!=null&&_V(i,c,s);const u=o.length;for(let d=0;d component?"));const i=await navigator.xr.requestSession(A,YV(A,g,I));return zL(i,(I==null?void 0:I.frameRate)??"high"),xV(C,i,I),i}function xV(g,A,I){if(g==null)return;const C=XRWebGLLayer.getNativeFramebufferScaleFactor(A);let i=I==null?void 0:I.frameBufferScaling;typeof i=="function"&&(i=i(C)),typeof i=="string"&&(i=i==="high"?C:i==="mid"?1:.5),i!=null&&(g==null||g.setFramebufferScaleFactor(i)),g==null||g.setSession(A)}const RF=["immersive-ar","immersive-vr","inline"];function vV(g,A){const I=()=>{const C=g.getSession();A(C,C.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return g.addEventListener("sessionstart",I),()=>g.removeEventListener("sessionstart",I)}function bV(g=RF,A){var C;if(g===!1)return;g===!0&&(g=RF);const I=async()=>{var i;for(const B of g)await((i=navigator.xr)==null?void 0:i.isSessionSupported(B))&&A(B)};return(C=navigator.xr)==null||C.addEventListener("sessiongranted",I),()=>{var i;return(i=navigator.xr)==null?void 0:i.removeEventListener("sessiongranted",I)}}function OV(g,A){let I;return(C,i)=>{if(I==null||I(),C==null||i==null)return;const B=t=>g.setState(A(t.session,g.getState(),t.added,t.removed));C.addEventListener("inputsourceschange",B);const Q=()=>g.setState({frameRate:C.frameRate,visibilityState:C.visibilityState}),e=()=>{I==null||I(),I=void 0,g.setState(XL)};C.addEventListener("end",e),C.addEventListener("frameratechange",Q),C.addEventListener("visibilitychange",Q),g.setState({...A(C,void 0,C.inputSources,void 0),frameRate:C.frameRate,visibilityState:C.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:i,session:C}),I=()=>{A(C,g.getState(),void 0,"all"),C.removeEventListener("end",e),C.removeEventListener("frameratechange",Q),C.removeEventListener("visibilitychange",Q),C.removeEventListener("inputsourceschange",B)}}}function _V(g,A,I){const C=I.getReferenceSpace(),{detectedMeshes:i,detectedPlanes:B,session:Q,controllerStates:e,handStates:t}=g.getState();if(C==null||Q==null)return;const E=KF(B,A.detectedPlanes),o=KF(i,A.detectedMeshes);(B!=E||i!=o)&&g.setState({detectedPlanes:E,detectedMeshes:o});const s=e.length;for(let l=0;l{I instanceof eg&&I.material instanceof Gg&&(I.material.colorWrite=(A==null?void 0:A.colorWrite)??!0)})}function jV(g,A,I){const C=[];for(const i in A.components){const B=A.components[i];let Q=I[i];Q==null&&(I[i]=Q={state:"default"}),C.push(...Object.values(B.visualResponses).map(e=>XV(g,Q,e)))}return()=>{const i=C.length;for(let B=0;B{};if(I.valueNodeProperty==="visibility")return()=>C.visible=I.states.includes(A.state);const i=g.getObjectByName(I.minNodeName),B=g.getObjectByName(I.maxNodeName);return i==null||B==null?()=>{}:()=>{const Q=zV(A,I);C.quaternion.slerpQuaternions(i.quaternion,B.quaternion,Q),C.position.lerpVectors(i.position,B.position,Q),C.updateMatrix()}}function zV(g,{componentProperty:A,states:I}){const C=I.includes(g.state);switch(A){case"xAxis":return C?JF(g).x:.5;case"yAxis":return C?JF(g).y:.5;case"button":return C?g.button??0:0;case"state":return C?1:0}}const bs=new LA;function JF({xAxis:g=0,yAxis:A=0}){if(bs.lengthSq()>1){const C=Math.atan2(A,g);bs.set(Math.cos(C),Math.sin(C))}else bs.set(g,A);return bs.multiplyScalar(.5).addScalar(.5),bs}function $V({_listeners:g,__r3f:A}){return g!=null&&Object.keys(g).length>0||A!=null&&(A==null?void 0:A.eventCount)>0}function Aj({_listeners:g,__r3f:A},I){if(g!=null&&I in g)return g[I];if(A==null)return;const C=A.handlers[Ij[I]];if(C!=null)return[C]}const Ij={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class ri{constructor(A,I,C,i,B,Q=B.object,e=Q){LI(this,"type");LI(this,"bubbles");LI(this,"nativeEvent");LI(this,"pointer");LI(this,"intersection");LI(this,"currentObject");LI(this,"object");LI(this,"stopPropagation");LI(this,"stopImmediatePropagation");this.type=A,this.bubbles=I,this.nativeEvent=C,this.pointer=i,this.intersection=B,this.currentObject=Q,this.object=e}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new ri(I,C,i,B,Q,A,e)}}class zM extends ri{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(A,I,C,i,B){super("wheel",!0,A,I,C,i,B)}retarget(A){const{type:I,bubbles:C,nativeEvent:i,pointer:B,intersection:Q,target:e}=this;return new zM(i,B,Q,A,e)}}function aB(g){$L(g,g.currentObject)}function $L(g,A){if(A==null)return;const I=Aj(A,g.type);let C=!g.bubbles;if(I!=null&&I.length>0){const i=g.retarget(A),B=I.length;i.stopPropagation=()=>C=!0;let Q=!1;i.stopImmediatePropagation=()=>{C=!0,Q=!0};for(let e=0;e=0;e--){const t=this.pointerEnteredHelper[e];aB(new ri("pointerenter",!1,A,this,C,t))}if(C!=null&&aB(new ri("pointermove",!0,A,this,C)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;tC){e.set(A.button,A.timeStamp);return}aB(new ri("dblclick",!0,A,this,this.intersection)),e.delete(A.button)}cancel(A){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,A));return}this.intersection!=null&&aB(new ri("pointercancel",!0,A,this,this.intersection))}}wheel(A,I,C){if(!this.enabled)return;let i=this.intersection;if(C||(i=this.computeIntersection(A,I,this.pointerCapture)),!this.wasMoved&&C){this.onFirstMove.push(this.cancel.bind(this,I));return}i!=null&&aB(new zM(I,this,i))}exit(A){var I;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,A));return}this.pointerCapture!=null&&((I=this.parentReleasePointerCapture)==null||I.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(A)}}function IY(g,A,I,C){if(g==null)return;const i=I.indexOf(g);i!=-1?I.splice(i,1):C.push(g),A.push(g),IY(g.parent,A,I,C)}function gj(g,A,I,C,i){if(A==null)return!1;const B=A.get(I);return!(B==null||C-B>i||B!=g.get(I))}function I0(g,A,I){return A.face==null?!1:(g.setFromNormalAndCoplanarPoint(A.face.normal,A.localPoint),g.applyMatrix4(I.matrixWorld),!0)}function Cj(g,A,I,C,i,B){if(A==="none"||A==="listener"&&!g)return!1;if(I==="all")return!0;if(typeof I=="function")return I(C,i,B);let Q,e;"deny"in I?(e=!0,Q=I.deny):(e=!1,Q=I.allow);let t;return Array.isArray(Q)?t=Q.includes(i):t=Q===i,e?!t:t}function TS(g,A,I,C,i,B=!1,Q,e,t){const E=B||$V(g),o=g.pointerEvents??Q,s=g.pointerEventsType??e,r=g.pointerEventsOrder??t;Cj(E,o??"listener",s??"all",A,I,C)&&i(g,r);const c=g.children.length;for(let w=0;w0)&&(g=E,Q=t)}return Q}function ij(g,A=0,I,C=0){return A!=C?C-A:g.distance-I.distance}const xQ=new Fr,Bj=new II,Lo=[];function Qj(g,A,I,C,i,B,Q,e){if(Q!=null)return ej(g,A,Q);let t,E;if(TS(I,C,i,B,(o,s)=>{let r=0;const l=((t==null?void 0:t.details.lineIndex)??A.length-2)+2;for(let c=1;c0;C--){const i=A[C-1],B=A[C];if(yu.origin.copy(i).applyMatrix4(g),yu.direction.copy(B).applyMatrix4(g).sub(xQ.ray.origin).normalize(),yu.intersectPlane(I,mF)!=null)return mF.clone()}}const du=new Fr,ku=new T,LF=new OB,Ej=new II,Zc=[];function oj(g,A,I,C,i,B,Q,e,t){if(e!=null)return nj(g,A,I,e);let E,o;if(du.ray.origin.copy(g),du.ray.direction.copy(I).applyQuaternion(A),TS(C,i,B,Q,(s,r)=>{s.raycast(du,Zc);const l=g0(E,o,Zc,r,t);l!=null&&(E=Zc[l],o=r),Zc.length=0}),E!=null)return Object.assign(E,{details:{type:"ray"},pointerPosition:g.clone(),pointerQuaternion:A.clone(),pointOnFace:E.point,localPoint:E.point.clone().applyMatrix4(Ej.copy(E.object.matrixWorld).invert())})}const YF=new lt;function nj(g,A,I,{intersection:C,object:i}){if(C.details.type!="ray")return;ku.copy(I).applyQuaternion(A),YF.set(g,ku),I0(LF,C,i);const B=YF.intersectPlane(LF,new T)??C.point;return{...C,object:i,pointOnFace:B,point:ku.clone().multiplyScalar(C.distance).add(g),pointerPosition:g.clone(),pointerQuaternion:A.clone()}}const Mu=new jg,Wc=[];function gY(g,A,I,C,i,B,Q,e,t){if(e!=null)return rj(g,A,e);let E,o;if(Mu.center.copy(g),Mu.radius=I,TS(C,i,B,Q,(s,r)=>{aj(Mu,s,Wc);const l=g0(E,o,Wc,r,t);l!=null&&(E=Wc[l],o=r),Wc.length=0}),E!=null)return Object.assign(E,{details:{type:"sphere"},pointOnFace:E.point,pointerPosition:g.clone(),pointerQuaternion:A.clone(),localPoint:E.point.clone().applyMatrix4(lD.copy(E.object.matrixWorld).invert())})}const Vc=new II;function sj(g){return"spherecast"in g}function aj(g,A,I){if(A.updateWorldMatrix(!0,!1),sj(A)){A.spherecast(g,I);return}if(A instanceof kr){A.geometry.boundingSphere==null&&A.geometry.computeBoundingSphere(),A.geometry.boundingBox==null&&A.geometry.computeBoundingBox();for(let i=0;ig.radius*g.radius)return;pu.max(lj);const Q=rn.center.clone().sub(bF);Q.divide(pu),cj(Q);const e=jc.clone();return{distance:Math.sqrt(B),face:{a:0,b:0,c:0,materialIndex:0,normal:Q},normal:Q,point:e,instanceId:C,object:A}}function cj(g){const A=Math.abs(g.x),I=Math.abs(g.y),C=Math.abs(g.z);if(A>=I&&A>=C){g.set(g.x<0?-1:1,0,0);return}if(I>=A&&I>=C){g.set(0,g.y<0?-1:1,0);return}g.set(0,0,g.z<0?-1:1)}const yd={radius:.07};function hj(g,A,I=yd,C="grab"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o!=null)return o.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),gY(i,B,I.radius??yd.radius,e,Q,C,A,E,I)},void 0,void 0,void 0,I)}const Dj=new T(0,0,-1),Sj=new T,Ba={direction:Dj,minDistance:0,linePoints:null};function wj(g,A,I=Ba,C="ray"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o==null)return;o.updateWorldMatrix(!0,!1);let s;const r=I.linePoints??Ba.linePoints;if(r==null?(i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),s=oj(i,B,I.direction??Ba.direction,e,Q,C,A,E,I)):s=Qj(o.matrixWorld,r,e,Q,C,A,E,I),!(s==null||s.distance*o.getWorldScale(Sj).x<(I.minDistance??Ba.minDistance)))return s},void 0,void 0,void 0,I)}const ln={button:0,downRadius:.03,hoverRadius:.1};function Gj(g,A,I=ln,C="touch"){const i=new T,B=new gg,Q=C0();return new A0(Q,C,A,(e,t,E)=>{const o=g.current;if(o!=null)return o.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(o.matrixWorld),B.setFromRotationMatrix(o.matrixWorld),gY(i,B,I.hoverRadius??ln.hoverRadius,e,Q,C,A,E,I)},uj(I),void 0,void 0,I)}function uj(g=ln){let A=!1;return I=>{if(!I.getEnabled())return;const C=I.getIntersection(),i=yj(C,g.downRadius??ln.downRadius);if(i===A)return;const B={timeStamp:performance.now(),button:g.button??ln.button};i?I.down(B):I.up(B),A=i}}function yj(g,A){return g==null?!1:g.distance<=A}let dj=23412;function C0(){return dj++}new T;new LA;let kj=class{constructor(){LI(this,"pointers",[]);LI(this,"isDefaults",[]);LI(this,"enabled",!0)}register(A,I){return this.pointers.push(A),this.isDefaults.push(I),this.unregister.bind(this,A)}unregister(A){const I=this.pointers.indexOf(A);I!==-1&&(this.isDefaults.splice(I,1),this.pointers.splice(I,1))}move(A,I){var Q,e;if(!this.enabled)return;const C=this.pointers.length;if(C===0)return;for(let t=0;t=g.lastChangedTime)return A;const I=new pI;return I.setIndex(new GI(g.indices,1)),I.setAttribute("position",new GI(g.vertices,3)),Object.assign(I,{creationTime:g.lastChangedTime})}function PF(g,A){return A!=null&&A.createdAt!=null&&A.createdAt>=g.lastChangedTime?A:Object.assign(Mj(g.polygon),{createdAt:g.lastChangedTime})}const _s=new Sm,Xc=new LA;function Mj(g){const A=new Bt,I=g.map(({x:i,z:B})=>new LA(i,B));_s.setFromPoints(I),_s.getSize(Xc);for(const i of I)i.sub(_s.min),i.divide(Xc);A.setFromPoints(I);const C=new fr(A);return C.scale(Xc.x,Xc.y,1),C.translate(_s.min.x,_s.min.y,0),C.rotateX(Math.PI/2),C}new T;new T;new T;const Ps=new LC(0,0,0,"YXZ"),zc=new gg;function pj(g,A,I){g.matrixWorld.decompose(A.position,zc,A.scale),Ps.setFromQuaternion(zc),Ps.z=0,Ps.x=dh(Ps.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),zc.setFromEuler(Ps),A.quaternion.slerp(zc,I/100)}function Uj(g){return g.userData.teleportTarget===!0}function fj(g={}){return A=>!(!Uj(A.object)||g.customFilter!=null&&!g.customFilter(A))}function Nj(){return new jD(new T(0,0,0),new T(0,0,-8),new T(0,-20,-15)).getPoints(20)}let Fj=class extends eg{constructor(I){const C=new vZ,i=new Float32Array(I.length*3);for(let e=0;ee.distanceTo(I[t+1]))}update(I){if(!I.getEnabled()||I.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const i=I.getIntersection();if((i==null?void 0:i.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:B,lineIndex:Q}=i.details,e=this.lineLengths[Q];this.material.visibility=this.multiplier*(Q+B/e)/this.lineLengths.length;const{color:t="white",opacity:E=.4,size:o=.01}=this.options;this.material.lineWidth=o,this.material.opacity=typeof E=="function"?E(I):E;const s=typeof t=="function"?t(I):t;Array.isArray(s)?this.material.color.set(...s):this.material.color.set(s)}};const $c=new II,Ah=new T,ZF=new gg;async function Rj(g,A,I=["point","plane","mesh"]){var t,E;let C,i,B;const Q=g.getState();if(A instanceof XRSpace)i=A,B=Q.origin;else{if(Q.originReferenceSpace==null)return;B=A,i=LV(A,Q.origin,Q.originReferenceSpace,$c)??Q.originReferenceSpace,i===Q.originReferenceSpace&&WL(A,Q.origin,$c),Ah.setFromMatrixPosition($c);const o={...Ah};ZF.setFromRotationMatrix($c),Ah.set(0,0,-1).applyQuaternion(ZF);const s={...Ah};C=new XRRay(o,s)}const e=await((E=(t=g.getState().session)==null?void 0:t.requestHitTestSource)==null?void 0:E.call(t,{space:i,entityTypes:Array.isArray(I)?I:[I],offsetRay:C}));if(e!=null)return{source:e,getWorldMatrix:Kj.bind(null,i,B)}}function Kj(g,A,I,C){const i=C.getPose(g);return i==null?!1:(I.fromArray(i.transform.matrix),A!=null&&I.premultiply(A.matrixWorld),!0)}new T(1,1,1);new T(0,0,0);new II;new II;new T;new T;const CY=new F8,iY="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",Jj="generic-trigger";class qj{constructor(A){LI(this,"baseAssetPath");LI(this,"defaultProfileId");LI(this,"profilesListPromise");LI(this,"profilePromisesMap",new Map);LI(this,"loadAsync",this.load);this.baseAssetPath=(A==null?void 0:A.baseAssetPath)??iY,this.defaultProfileId=(A==null?void 0:A.defaultControllerProfileId)??Jj}async load(A,I){const C=await this.loadProfile(A);for(const i in C.layouts)if(i.includes(I))return C.layouts[i];throw new Error(`No matching layout for "${I}", in profile ${C.profileId} with layouts ${Object.keys(C.layouts).join(", ")}.`)}async loadProfile(A){this.profilesListPromise??(this.profilesListPromise=WF(new URL("profilesList.json",this.baseAssetPath).href));const I=await this.profilesListPromise,C=A.length;for(let B=0;Bg.visibilityState)}function Tj(g,A){const I=j.useRef(A);I.current=A;const[C,i]=j.useMemo(()=>{let B;return[Q=>{let e=!1;return navigator.xr==null?(B=!1,()=>{}):(navigator.xr.isSessionSupported(g).then(t=>{B=t,!e&&Q()}).catch(t=>{var E;e||(E=I.current)==null||E.call(I,t)}),()=>e=!0)},()=>B]},[g]);return j.useSyncExternalStore(C,i)}j.forwardRef(({id:g,children:A,onPress:I,onRelease:C},i)=>{const B=i0(),[Q,e]=j.useState(void 0);if(j.useImperativeHandle(i,()=>Q,[Q]),xj(g,t=>t==="pressed"?I==null?void 0:I():C==null?void 0:C()),lC(()=>{var t;return e((t=B.gamepad[g])==null?void 0:t.object)}),Q!=null)return QM(A,Q)});function xj(g,A,I){const C=i0(),i=j.useRef();lC(()=>{var Q;const B=(Q=C==null?void 0:C.gamepad[g])==null?void 0:Q.state;B!=null&&B!=i.current&&A(B),i.current=B})}function i0(g){const A=j.useContext(uQ);if(A==null||A.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return A}const vj=Symbol("loadXRControllerModel"),bj=j.forwardRef((g,A)=>{const I=i0(),C=Rr(WV,[I.layout,void 0,vj]);VV(C,g),I.object=C,j.useImperativeHandle(A,()=>C,[C]);const i=j.useMemo(()=>jV(C,I.layout,I.gamepad),[C,I.layout,I.gamepad]);return lC(i),nA.jsx("primitive",{object:C})});function xS(g){const A=j.useContext(uQ);if(A==null||A.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return A}const Oj=Symbol("loadXRHandModel"),EY=j.forwardRef((g,A)=>{const I=xS(),C=Rr(DV,[I.assetPath,void 0,Oj]);SV(C,g),j.useImperativeHandle(A,()=>C,[C]);const i=a5(),B=j.useMemo(()=>yV(I.inputSource.hand,C,i),[I.inputSource,C,i]);return lC((Q,e,t)=>B(t)),nA.jsx("primitive",{object:C})});j.forwardRef(({joint:g,children:A},I)=>{const C=xS();return nA.jsx(FB,{ref:I,space:C.inputSource.hand.get(g),children:A})});function oY({children:g}){const A=j.useMemo(()=>new kj,[]);return sY(A),lC(I=>A.move(I.scene,{timeStamp:performance.now()}),-50),nA.jsx(tY.Provider,{value:A,children:g})}function _j(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,yd,I);const B=j.useMemo(()=>hj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}function nY(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,Ba,I);const B=j.useMemo(()=>wj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}function Pj(g,A,I,C){const i=j.useMemo(()=>({}),[]);Object.assign(i,ln,I);const B=j.useMemo(()=>Gj(g,A,i,C),[g,A,i,C]);return Q0(B,I==null?void 0:I.makeDefault),B}const Zj=j.forwardRef((g,A)=>{const I=j.useMemo(()=>new FV,[]),C=j.useRef(null);return j.useImperativeHandle(A,()=>C.current,[]),lC(()=>C.current!=null&&RV(C.current,I,g.pointer,g)),nA.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:g.renderOrder??2,ref:C,material:I,children:nA.jsx("boxGeometry",{})})}),vS=j.forwardRef((g,A)=>{const I=j.useMemo(()=>new UV,[]),C=j.useRef(null);j.useImperativeHandle(A,()=>C.current,[]),lC(()=>C.current!=null&&NV(C.current,I,g.pointer,g));const i=OE(B=>B.scene);return QM(nA.jsx("mesh",{renderOrder:g.renderOrder??1,ref:C,matrixAutoUpdate:!1,material:I,children:nA.jsx("planeGeometry",{})}),i)});function B0(g,A,I,C){const i=zg(B=>B.session);j.useEffect(()=>{if(i!=null)return KV(g,i,A,I,C)},[I,A,g,i,C])}function Q0(g,A=!1){const I=j.useContext(tY);I==null?(sY(g),lC(C=>g.move(C.scene,{timeStamp:performance.now()}),-50)):j.useEffect(()=>I.register(g,A),[I,g,A]),j.useEffect(()=>()=>g.exit({timeStamp:performance.now()}),[g])}function sY(g){const A=e0();j.useEffect(()=>pV(A,I=>g.setEnabled(I,{timeStamp:performance.now()})),[A,g])}const Wj=j.forwardRef(({pointer:g,linePoints:A,...I},C)=>{const i=j.useMemo(()=>new Fj(A),[A]);return j.useImperativeHandle(C,()=>i,[i]),i.options=I,lC(()=>i.update(g)),nA.jsx("primitive",{object:i})});function aY(g,A,I){const C=j.useContext(uQ);if(C==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const i=j.useRef(null),B=_j(i,C,I);B0(B,C.inputSource,g,C.events);const Q=I.cursorModel;return nA.jsx(FB,{ref:i,space:A(C.inputSource),children:Q!==!1&&nA.jsx(vS,{pointer:B,opacity:JV,...JC(Q)})})}const Vj=aY.bind(null,"select",g=>g.hand.get("index-finger-tip")),jj=aY.bind(null,"squeeze",g=>g.gripSpace);function Yr(g){const A=j.useContext(uQ);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=j.useRef(null),C=nY(I,A,g);B0(C,A.inputSource,"select",A.events);const i=g.rayModel,B=g.cursorModel;return nA.jsxs(FB,{ref:I,space:A.inputSource.targetRaySpace,children:[i!==!1&&nA.jsx(Zj,{pointer:C,opacity:rD,...JC(i)}),B!==!1&&nA.jsx(vS,{pointer:C,opacity:rD,...JC(B)})]})}function Xj(g){const A=xS(),I=j.useRef(null),C=Pj(I,A,g),i=g.cursorModel;return nA.jsx(FB,{ref:I,space:A.inputSource.hand.get("index-finger-tip"),children:i!==!1&&nA.jsx(vS,{pointer:C,opacity:qV,...JC(i)})})}function zj(g){const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.teleportPointer??!1;return nA.jsxs(nA.Fragment,{children:[A!==!1&&nA.jsx(j.Suspense,{children:nA.jsx(bj,{...JC(A)})}),nA.jsxs(oY,{children:[I!==!1&&nA.jsx(jj,{...JC(I)}),C!==!1&&nA.jsx(Yr,{makeDefault:!0,minDistance:.2,...JC(C)}),i!==!1&&nA.jsx(rY,{...JC(i)})]})]})}function $j(g){var e;const A=g.model,I=g.grabPointer,C=g.rayPointer,i=g.touchPointer,B=g.teleportPointer??!1,Q=C===!1?!1:(e=JC(C))==null?void 0:e.rayModel;return nA.jsxs(nA.Fragment,{children:[A!==!1&&nA.jsx(j.Suspense,{children:nA.jsx(EY,{...JC(A)})}),nA.jsxs(oY,{children:[I!==!1&&nA.jsx(Vj,{...JC(I)}),i!==!1&&nA.jsx(Xj,{...JC(i)}),C!==!1&&nA.jsx(Yr,{makeDefault:!0,minDistance:.2,...JC(C),rayModel:Q===!1?!1:{maxLength:.2,...JC(Q)}}),B!==!1&&nA.jsx(rY,{...JC(B)})]})]})}function A5(g){return nA.jsx(Yr,{...g,rayModel:!1})}function I5(g){return nA.jsx(Yr,{...g,rayModel:!1})}function g5(g){return nA.jsx(Yr,{...g,cursorModel:!1,rayModel:!1})}function rY(g){const A=j.useContext(uQ);if(A==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const I=j.useRef(null),C=j.useRef(null),i=j.useMemo(()=>Nj(),[]),B=nY(C,A,{...g,linePoints:i,customFilter:fj(g)},"teleport");B0(B,A.inputSource,"select",A.events);const Q=g.rayModel,e=g.cursorModel,t=OE(o=>o.scene),E=j.useRef(null);return lC((o,s)=>{E.current!=null&&(E.current.visible=B.getEnabled()&&B.getButtonsDown().size>0);const r=C.current,l=I.current;r==null||l==null||pj(l,r,s*1e3)}),nA.jsxs(nA.Fragment,{children:[nA.jsx(FB,{ref:I,space:A.inputSource.targetRaySpace}),QM(nA.jsxs("group",{ref:C,children:[Q!==!1&&nA.jsx(Wj,{linePoints:i,pointer:B,opacity:rD,...JC(Q)}),e!==!1&&nA.jsx(vS,{ref:E,pointer:B,opacity:rD,...JC(e)})]}),t)]})}function JC(g){if(g!==!0)return g}function C5({children:g}){const A=zg(Q=>Q.originReferenceSpace),I=zg(Q=>Q.origin),C=Hj()==="visible",i=Jr(),B=j.useMemo(()=>Object.assign({},i,{getState(){return{...i.getState(),scene:I}}}),[I,i]);return I==null||A==null?null:nA.jsx(nA.Fragment,{children:pn.createPortal(nA.jsx(aS.Provider,{value:i,children:nA.jsxs(Lr.Provider,{value:A,children:[nA.jsxs("group",{matrixAutoUpdate:!1,visible:C,children:[nA.jsx(i5,{}),nA.jsx(B5,{}),nA.jsx(Q5,{}),nA.jsx(e5,{}),nA.jsx(t5,{})]}),nA.jsx(E5,{}),nA.jsx(o5,{}),g]})}),B,null)})}function i5(){const g=zg(I=>I.controllerStates);let A=zg(I=>I.controller);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.gripSpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx(zj,{...C})})})},PE(I))})})}function B5(){const g=zg(I=>I.handStates),A=zg(I=>I.hand);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.hand.get("wrist"),children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx($j,{...C})})})},PE(I))})})}function Q5(){const g=zg(I=>I.transientPointerStates),A=zg(I=>I.transientPointer);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>{const C=_e(A,I.inputSource.handedness,{});return C===!1?null:nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof C=="function"?nA.jsx(C,{}):nA.jsx(A5,{...C})})})},PE(I))})})}function e5(){const g=zg(I=>I.gazeStates),A=zg(I=>I.gaze);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof A=="function"?nA.jsx(A,{}):nA.jsx(I5,{...lY(A)})})})},PE(I)))})}function t5(){const g=zg(I=>I.screenInputStates),A=zg(I=>I.screenInput);return A===!1?null:nA.jsx(nA.Fragment,{children:g.map(I=>nA.jsx(FB,{space:I.inputSource.targetRaySpace,children:nA.jsx(uQ.Provider,{value:I,children:nA.jsx(j.Suspense,{children:typeof A=="function"?nA.jsx(A,{}):nA.jsx(g5,{...lY(A)})})})},PE(I)))})}function lY(g){if(g!==!0)return g}function E5(){const g=zg(I=>I.detectedMeshes),A=zg(I=>I.detectedMesh);if(A!==!1)return nA.jsx(nA.Fragment,{children:g.map(I=>{const C=jL(A,I.semanticLabel,!1);return C===!1?null:nA.jsx(FB,{space:I.meshSpace,children:nA.jsx(QY.Provider,{value:I,children:nA.jsx(j.Suspense,{children:nA.jsx(C,{})})})},PE(I))})})}function o5(){const g=zg(I=>I.detectedPlanes),A=zg(I=>I.detectedPlane);if(A!=null)return nA.jsx(nA.Fragment,{children:g.map(I=>{const C=jL(A,I.semanticLabel,!1);return C===!1?null:nA.jsx(FB,{space:I.planeSpace,children:nA.jsx(eY.Provider,{value:I,children:nA.jsx(j.Suspense,{children:nA.jsx(C,{})})})},PE(I))})})}function n5(g){return TV(g)}function s5({children:g,store:A}){A.setWebXRManager(OE(C=>C.gl.xr));const I=Jr();return j.useEffect(()=>{let C;return A.subscribe((i,B)=>{const Q=i.mode!=null,e=B.mode!=null;if(Q!==e){if(Q){const{camera:t,gl:E}=I.getState();C=t,I.setState({camera:E.xr.getCamera()});return}C!=null&&I.setState({camera:C})}})},[I,A]),lC((C,i,B)=>A.onBeforeFrame(C.scene,C.camera,B),-1e3),nA.jsxs(BY.Provider,{value:A,children:[nA.jsx(C5,{}),g]})}function e0(){const g=j.useContext(BY);if(g==null)throw new Error("XR features can only be used inside the component");return g}function zg(g=A=>A){return nM(e0(),g)}const FB=j.forwardRef(({space:g,children:A},I)=>{const C=j.useRef(null);return j.useImperativeHandle(I,()=>C.current,[]),l5(C,g,(i,B,Q)=>{C.current!=null&&(C.current.visible=Q!=null)}),nA.jsx("group",{xrSpace:g,visible:!1,matrixAutoUpdate:!1,ref:C,children:nA.jsx(Lr.Provider,{value:g,children:A})})});function a5(){const g=j.useContext(Lr);if(g==null)throw new Error("XR objects must be placed inside the XROrigin");return g}function r5(g){const A=j.useContext(Lr),I=zg(C=>A??C.originReferenceSpace);return j.useMemo(()=>I==null?void 0:mV(g,I),[g,I])}function l5(g,A,I){const C=r5(A);lC((i,B,Q)=>{g.current==null||C==null||(C(g.current.matrix,Q),I==null||I(i,B,Q))},-100)}j.forwardRef((g,A)=>{const I=c5(),C=h5(I);return nA.jsx("mesh",{ref:A,geometry:C,...g})});function c5(){const g=j.useContext(QY);if(g==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return g}function h5(g,A=!0){const[I,C]=j.useState(_F(g,void 0));return lC(()=>C(i=>_F(g,i))),j.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}j.forwardRef((g,A)=>{const I=D5(),C=S5(I);return nA.jsx("mesh",{ref:A,geometry:C,...g})});function D5(){const g=j.useContext(eY);if(g==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return g}function S5(g,A=!0){const[I,C]=j.useState(PF(g,void 0));return lC(()=>C(i=>PF(g,i))),j.useEffect(()=>{if(A)return()=>I.dispose()},[I]),I}const w5=j.forwardRef(({children:g,...A},I)=>{const C=OE(B=>B.gl.xr.getCamera()),i=zg(B=>B.originReferenceSpace);return i==null?null:nA.jsxs("group",{ref:I,...A,children:[nA.jsx("primitive",{object:C}),nA.jsx(Lr.Provider,{value:i,children:g})]})});function G5(g,A,I){const C=j.useRef(void 0);u5(A,I,j.useCallback(i=>C.current=i,[])),lC((i,B,Q)=>{g==null||Q==null||C.current==null||g(Q.getHitTestResults(C.current.source),C.current.getWorldMatrix)})}function u5(g,A,I){const C=e0();j.useEffect(()=>{let i,B=!1;const Q=g instanceof XRSpace?g:g.current;if(Q!=null)return Rj(C,Q,A).then(e=>{B||(i=e,I(e))}),()=>{I(void 0),B=!0,i==null||i.source.cancel()}},[C,g,A,I])}j.forwardRef((g,A)=>{const I=j.useRef(null);return j.useImperativeHandle(A,()=>I.current),G5(g.onResults,I,g.trackableType),nA.jsx("group",{...g,ref:I})});j.forwardRef((g,A)=>{const I=zg(B=>B.domOverlayRoot),{In:C,Out:i}=j.useMemo(GW,[]);return j.useEffect(()=>{const B=wk(I);return B.render(nA.jsx(i,{})),()=>B.unmount()},[I,i]),nA.jsx(C,{children:nA.jsx("div",{...g,ref:A})})});const cY=j.forwardRef(({store:g,mode:A,onError:I,children:C,...i},B)=>{const Q=nM(g,t=>t.session),e=Tj(A,I);return nA.jsx("button",{ref:B,...i,onClick:()=>Q!=null?Q.end():g.enterXR(A).catch(I),children:typeof C=="function"?C(e?Q!=null?"entered":"exited":"unsupported"):C})});j.forwardRef((g,A)=>nA.jsx(cY,{ref:A,mode:"immersive-ar",...g}));j.forwardRef((g,A)=>nA.jsx(cY,{ref:A,mode:"immersive-vr",...g}));const y5={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:g=>g.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:g=>g.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:g=>g.pointerType==="ray"},onSqueeze:{type:"click",filter:g=>g.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:g=>g.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:g=>g.pointerType==="grab"}};function TQ(g,A,I){const C=j.useRef(I);C.current=I,j.useEffect(()=>{const{current:i}=g;if(i==null)return;const B=y5[A],Q=typeof B=="string"?t=>{var E;return(E=C.current)==null?void 0:E.call(C,{intersection:t,intersections:[t],target:t.pointerState})}:t=>{var E;t instanceof ri&&!B.filter(t)||(E=C.current)==null||E.call(C,{intersection:t,intersections:[t],target:t.pointerState})},e=typeof B=="string"?B:B.type;return i.addEventListener(e,Q),()=>i.removeEventListener(e,Q)},[g,A])}const d5=j.forwardRef(({onHover:g,onBlur:A,onSelectStart:I,onSelectEnd:C,onSelect:i,onSqueezeStart:B,onSqueezeEnd:Q,onSqueeze:e,onMove:t,children:E},o)=>{const s=j.useRef(null);return j.useImperativeHandle(o,()=>s.current),TQ(s,"onHover",g),TQ(s,"onBlur",A),TQ(s,"onSelectStart",I),TQ(s,"onSelectEnd",C),TQ(s,"onSelect",i),TQ(s,"onSqueezeStart",B),TQ(s,"onSqueezeEnd",Q),TQ(s,"onSqueeze",e),TQ(s,"onMove",t),nA.jsx("group",{ref:s,children:E})});j.forwardRef(function({onSelectStart:A,onSelectEnd:I,children:C,...i},B){const Q=j.useRef(),e=j.useRef(null),t=j.useMemo(()=>new II,[]);return j.useImperativeHandle(B,()=>e.current),lC(()=>{const E=Q.current,o=e.current;!o||!E||(o.applyMatrix4(t),o.applyMatrix4(E.matrixWorld),o.updateMatrixWorld(),t.copy(E.matrixWorld).invert())}),nA.jsx(d5,{ref:e,onSelectStart:E=>{dV(E.target)&&(E.target.type==="controller"||E.target.type==="hand")&&E.target.object!=null&&(Q.current=E.target.object,t.copy(E.target.object.matrixWorld).invert(),A==null||A(E))},onSelectEnd:E=>{E.target.controller===Q.current&&(Q.current=void 0),I==null||I(E)},...i,children:C})});const k5=Symbol(),t0=Symbol(),Zs="a",ua="w";let M5=(g,A)=>new Proxy(g,A);const dd=Object.getPrototypeOf,kd=new WeakMap,hY=g=>g&&(kd.has(g)?kd.get(g):dd(g)===Object.prototype||dd(g)===Array.prototype),cD=g=>typeof g=="object"&&g!==null,p5=g=>{if(Array.isArray(g))return Array.from(g);const A=Object.getOwnPropertyDescriptors(g);return Object.values(A).forEach(I=>{I.configurable=!0}),Object.create(dd(g),A)},E0=g=>g[t0]||g,DY=(g,A,I,C)=>{if(!hY(g))return g;let i=C&&C.get(g);if(!i){const t=E0(g);i=(E=>Object.values(Object.getOwnPropertyDescriptors(E)).some(o=>!o.configurable&&!o.writable))(t)?[t,p5(t)]:[t],C==null||C.set(g,i)}const[B,Q]=i;let e=I&&I.get(B);return e&&e[1].f===!!Q||(e=((t,E)=>{const o={f:E};let s=!1;const r=(c,w)=>{if(!s){let D=o[Zs].get(t);if(D||(D={},o[Zs].set(t,D)),c===ua)D[ua]=!0;else{let h=D[c];h||(h=new Set,D[c]=h),h.add(w)}}},l={get:(c,w)=>w===t0?t:(r("k",w),DY(Reflect.get(c,w),o[Zs],o.c,o.t)),has:(c,w)=>w===k5?(s=!0,o[Zs].delete(t),!0):(r("h",w),Reflect.has(c,w)),getOwnPropertyDescriptor:(c,w)=>(r("o",w),Reflect.getOwnPropertyDescriptor(c,w)),ownKeys:c=>(r(ua),Reflect.ownKeys(c))};return E&&(l.set=l.deleteProperty=()=>!1),[l,o]})(B,!!Q),e[1].p=M5(Q||B,e[0]),I&&I.set(B,e)),e[1][Zs]=A,e[1].c=I,e[1].t=C,e[1].p},SY=(g,A,I,C,i=Object.is)=>{if(i(g,A))return!1;if(!cD(g)||!cD(A))return!0;const B=I.get(E0(g));if(!B)return!0;if(C){const e=C.get(g);if(e&&e.n===A)return e.g;C.set(g,{n:A,g:!1})}let Q=null;try{for(const e of B.h||[])if(Q=Reflect.has(g,e)!==Reflect.has(A,e),Q)return Q;if(B[ua]===!0){if(Q=((e,t)=>{const E=Reflect.ownKeys(e),o=Reflect.ownKeys(t);return E.length!==o.length||E.some((s,r)=>s!==o[r])})(g,A),Q)return Q}else for(const e of B.o||[])if(Q=!!Reflect.getOwnPropertyDescriptor(g,e)!=!!Reflect.getOwnPropertyDescriptor(A,e),Q)return Q;for(const e of B.k||[])if(Q=SY(g[e],A[e],I,C,i),Q)return Q;return Q===null&&(Q=!0),Q}finally{C&&C.set(g,{n:A,g:Q})}},U5=g=>hY(g)&&g[t0]||null,jF=(g,A=!0)=>{kd.set(g,A)},f5=(g,A,I)=>{const C=[],i=new WeakSet,B=(Q,e)=>{if(i.has(Q))return;cD(Q)&&i.add(Q);const t=cD(Q)&&A.get(E0(Q));if(t){var E,o;if((E=t.h)==null||E.forEach(r=>{const l=`:has(${String(r)})`;C.push(e?[...e,l]:[l])}),t[ua]===!0){const r=":ownKeys";C.push(e?[...e,r]:[r])}else{var s;(s=t.o)==null||s.forEach(r=>{const l=`:hasOwn(${String(r)})`;C.push(e?[...e,l]:[l])})}(o=t.k)==null||o.forEach(r=>{!("value"in(Object.getOwnPropertyDescriptor(Q,r)||{}))||B(Q[r],e?[...e,r]:[r])})}else e&&C.push(e)};return B(g),C};var hD={BASE_URL:"/xr/examples/pingpong/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Uu=g=>typeof g=="object"&&g!==null,xe=new WeakMap,Ih=new WeakSet,N5=(g=Object.is,A=(E,o)=>new Proxy(E,o),I=E=>Uu(E)&&!Ih.has(E)&&(Array.isArray(E)||!(Symbol.iterator in E))&&!(E instanceof WeakMap)&&!(E instanceof WeakSet)&&!(E instanceof Error)&&!(E instanceof Number)&&!(E instanceof Date)&&!(E instanceof String)&&!(E instanceof RegExp)&&!(E instanceof ArrayBuffer),C=E=>{switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:throw E}},i=new WeakMap,B=(E,o,s=C)=>{const r=i.get(E);if((r==null?void 0:r[0])===o)return r[1];const l=Array.isArray(E)?[]:Object.create(Object.getPrototypeOf(E));return jF(l,!0),i.set(E,[o,l]),Reflect.ownKeys(E).forEach(c=>{if(Object.getOwnPropertyDescriptor(l,c))return;const w=Reflect.get(E,c),{enumerable:D}=Reflect.getOwnPropertyDescriptor(E,c),h={value:w,enumerable:D,configurable:!0};if(Ih.has(w))jF(w,!1);else if(w instanceof Promise)delete h.value,h.get=()=>s(w);else if(xe.has(w)){const[G,u]=xe.get(w);h.value=B(G,u(),s)}Object.defineProperty(l,c,h)}),Object.preventExtensions(l)},Q=new WeakMap,e=[1,1],t=E=>{if(!Uu(E))throw new Error("object required");const o=Q.get(E);if(o)return o;let s=e[0];const r=new Set,l=(f,p=++e[0])=>{s!==p&&(s=p,r.forEach(m=>m(f,p)))};let c=e[1];const w=(f=++e[1])=>(c!==f&&!r.size&&(c=f,h.forEach(([p])=>{const m=p[1](f);m>s&&(s=m)})),s),D=f=>(p,m)=>{const q=[...p];q[1]=[f,...q[1]],l(q,m)},h=new Map,G=(f,p)=>{if((hD?"production":void 0)!=="production"&&h.has(f))throw new Error("prop listener already exists");if(r.size){const m=p[3](D(f));h.set(f,[p,m])}else h.set(f,[p])},u=f=>{var p;const m=h.get(f);m&&(h.delete(f),(p=m[1])==null||p.call(m))},d=f=>(r.add(f),r.size===1&&h.forEach(([m,q],L)=>{if((hD?"production":void 0)!=="production"&&q)throw new Error("remove already exists");const O=m[3](D(L));h.set(L,[m,O])}),()=>{r.delete(f),r.size===0&&h.forEach(([m,q],L)=>{q&&(q(),h.set(L,[m]))})}),F=Array.isArray(E)?[]:Object.create(Object.getPrototypeOf(E)),N=A(F,{deleteProperty(f,p){const m=Reflect.get(f,p);u(p);const q=Reflect.deleteProperty(f,p);return q&&l(["delete",[p],m]),q},set(f,p,m,q){const L=Reflect.has(f,p),O=Reflect.get(f,p,q);if(L&&(g(O,m)||Q.has(m)&&g(O,Q.get(m))))return!0;u(p),Uu(m)&&(m=U5(m)||m);let iA=m;if(m instanceof Promise)m.then(AA=>{m.status="fulfilled",m.value=AA,l(["resolve",[p],AA])}).catch(AA=>{m.status="rejected",m.reason=AA,l(["reject",[p],AA])});else{!xe.has(m)&&I(m)&&(iA=t(m));const AA=!Ih.has(iA)&&xe.get(iA);AA&&G(p,AA)}return Reflect.set(f,p,iA,q),l(["set",[p],m,O]),!0}});Q.set(E,N);const K=[F,w,B,d];return xe.set(N,K),Reflect.ownKeys(E).forEach(f=>{const p=Object.getOwnPropertyDescriptor(E,f);"value"in p&&(N[f]=E[f],delete p.value,delete p.writable),Object.defineProperty(F,f,p)}),N})=>[t,xe,Ih,g,A,I,C,i,B,Q,e],[F5]=N5();function R5(g={}){return F5(g)}function K5(g,A,I){const C=xe.get(g);(hD?"production":void 0)!=="production"&&!C&&console.warn("Please use proxy object");let i;const B=[],Q=C[3];let e=!1;const E=Q(o=>{B.push(o),i||(i=Promise.resolve().then(()=>{i=void 0,e&&A(B.splice(0))}))});return e=!0,()=>{e=!1,E()}}function XF(g,A){const I=xe.get(g);(hD?"production":void 0)!=="production"&&!I&&console.warn("Please use proxy object");const[C,i,B]=I;return B(C,i(),A)}var J5={BASE_URL:"/xr/examples/pingpong/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{use:zF}=MI,{useSyncExternalStore:q5}=QW,m5=(g,A)=>{const I=j.useRef();j.useEffect(()=>{I.current=f5(g,A)}),j.useDebugValue(I.current)},L5=new WeakMap;function Y5(g,A){const C=j.useRef(),i=j.useRef();let B=!0;const Q=q5(j.useCallback(E=>{const o=K5(g,E);return E(),o},[g,void 0]),()=>{const E=XF(g,zF);try{if(!B&&C.current&&i.current&&!SY(C.current,E,i.current,new WeakMap))return C.current}catch{}return E},()=>XF(g,zF));B=!1;const e=new WeakMap;j.useEffect(()=>{C.current=Q,i.current=e}),(J5?"production":void 0)!=="production"&&m5(Q,e);const t=j.useMemo(()=>new WeakMap,[]);return DY(Q,e,t,L5)}const fu=new Audio("ping.mp3"),Er=R5({count:0,api:{pong(g){console.log(g),fu.currentTime=0,fu.volume=Math.min(Math.max(0,g/20,0),1),fu.play(),g>10&&++Er.count},reset:()=>Er.count=0}});function H5(){const g=xS();return nA.jsxs(nA.Fragment,{children:[nA.jsx(j.Suspense,{children:nA.jsx(EY,{renderOrder:-1,colorWrite:!1})}),nA.jsx("group",{scale:.045,children:nA.jsx(j.Suspense,{children:nA.jsx(T5,{handedness:g.inputSource.handedness})})})]})}const $F=new T,AR=new gg;function T5({handedness:g}){const A=j.useRef(),I=j.useRef(),C=j.useRef(),{count:i}=Y5(Er),{nodes:B,materials:Q}=lS("pingpong.glb"),e=j.useCallback(t=>{Er.api.pong(t.totalForceMagnitude*1300)},[]);return lC(()=>{I.current.getWorldPosition($F),A.current.setTranslation($F),I.current.getWorldQuaternion(AR),A.current.setRotation(AR)}),nA.jsxs("group",{position:[0,-1,-1.6],"rotation-z":g==="left"?.6:-.6,"rotation-x":0,"rotation-y":g==="left"?-.7:.7,children:[nA.jsx("group",{ref:I,position:[.1,.3,-2.6],children:nA.jsx(YZ,{anchorX:"center",anchorY:"middle",rotation:[-Math.PI/2,Math.PI,0],position:[0,-.2,0],fontSize:10,scale:.15,children:i})}),nA.jsx(tr,{ccd:!0,canSleep:!1,ref:A,type:"kinematicPosition",colliders:!1,children:nA.jsx(XM,{onContactForce:e,args:[.15,1.9]})}),nA.jsx("group",{ref:C,scale:.15,children:nA.jsxs("group",{rotation:[0,-.04,0],scale:141.94,children:[nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.wood,geometry:B.mesh.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.side,geometry:B.mesh_1.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.foam,geometry:B.mesh_2.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.lower,geometry:B.mesh_3.geometry}),nA.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:Q.upper,geometry:B.mesh_4.geometry})]})})]})}const Nu=n5({hand:H5});function x5(){return nA.jsxs(nA.Fragment,{children:[nA.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1rem",position:"absolute",zIndex:1e4,bottom:"1rem",left:"50%",transform:"translate(-50%, 0)"},children:[nA.jsx("button",{style:{background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",boxShadow:"0px 0px 20px rgba(0,0,0,1)"},onClick:()=>Nu.enterAR(),children:"Enter AR"}),nA.jsx("button",{style:{background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",boxShadow:"0px 0px 20px rgba(0,0,0,1)"},onClick:()=>Nu.enterVR(),children:"Enter VR"})]}),nA.jsx(iP,{shadows:!0,dpr:[1,1.5],children:nA.jsx(n8,{maxCcdSubsteps:10,gravity:[0,-5,0],timeStep:"vary",children:nA.jsxs(s5,{store:Nu,children:[nA.jsx("color",{attach:"background",args:["#f0f0f0"]}),nA.jsx("ambientLight",{intensity:.5*Math.PI}),nA.jsx("spotLight",{decay:0,position:[-10,15,-5],angle:1,penumbra:1,intensity:2,castShadow:!0,"shadow-mapSize":1024,"shadow-bias":-1e-4}),nA.jsx(j.Suspense,{children:nA.jsx(v5,{})}),nA.jsx(w5,{})]})})})]})}function v5(){const g=j.useRef(),A=oM("crossp.jpg"),I=j.useCallback(()=>{Er.api.reset(),g.current.resetForces(!0),g.current.resetTorques(!0),g.current.setTranslation({x:0,y:2,z:-.5}),g.current.setAngvel({x:0,y:0,z:0}),g.current.setLinvel({x:0,y:2,z:0})},[]);return nA.jsxs(nA.Fragment,{children:[nA.jsxs(tr,{ccd:!0,ref:g,angularDamping:.1,restitution:1.5,canSleep:!1,colliders:!1,enabledTranslations:[!0,!0,!1],children:[nA.jsx(YL,{args:[.02]}),nA.jsxs("mesh",{castShadow:!0,receiveShadow:!0,children:[nA.jsx("sphereGeometry",{args:[.02,64,64]}),nA.jsx("meshStandardMaterial",{map:A})]})]}),nA.jsx(tr,{type:"fixed",colliders:!1,position:[0,-3,0],restitution:2.1,onCollisionEnter:I,children:nA.jsx(LL,{args:[1e3,2,1e3]})})]})}wk(document.getElementById("root")).render(nA.jsx(j.StrictMode,{children:nA.jsx(x5,{})}));export{ct as B,xn as C,fi as D,LC as E,sI as F,yB as G,YC as L,II as M,YI as O,GQ as P,gg as Q,Fr as R,Nr as S,QS as T,T as V,qq as W,Vg as a,pI as b,eg as c,Ur as d,SQ as e,Xh as f,or as g,iC as h,iS as i,nA as j,pB as k,wk as l,MI as o,j as r}; diff --git a/examples/pingpong/index.html b/examples/pingpong/index.html index c90e918..652f6be 100644 --- a/examples/pingpong/index.html +++ b/examples/pingpong/index.html @@ -4,7 +4,7 @@ Document - +
diff --git a/examples/pingpong/assets/emulate-D-6Vp1MH.js b/examples/rag-doll/assets/emulate-BJ1WIuRG.js similarity index 99% rename from examples/pingpong/assets/emulate-D-6Vp1MH.js rename to examples/rag-doll/assets/emulate-BJ1WIuRG.js index f371f25..296db27 100644 --- a/examples/pingpong/assets/emulate-D-6Vp1MH.js +++ b/examples/rag-doll/assets/emulate-BJ1WIuRG.js @@ -1,4 +1,4 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-KkaVz-OQ.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-B6JVeM_c.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; diff --git a/examples/rag-doll/assets/index-BPIO8-Qx.js b/examples/rag-doll/assets/index-B6JVeM_c.js similarity index 99% rename from examples/rag-doll/assets/index-BPIO8-Qx.js rename to examples/rag-doll/assets/index-B6JVeM_c.js index 704e212..4dcdd1c 100644 --- a/examples/rag-doll/assets/index-BPIO8-Qx.js +++ b/examples/rag-doll/assets/index-B6JVeM_c.js @@ -4106,4 +4106,4 @@ No matching component was found for: `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),e.fragmentShader=`varying float vFade; `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function GD(i,e,t,n){if(!t.getEnabled()){i.visible=!1;return}i.visible=!0;const s=t.getIntersection(),o=typeof n.color=="function"?n.color(t):n.color;Array.isArray(o)?e.color.set(...o):e.color.set(o??"white"),e.opacity=typeof n.opacity=="function"?n.opacity(t):n.opacity??.4;let r=n.maxLength??1;s!=null&&(r=Math.min(r,s.distance)),i.position.z=-r/2;const g=n.size??.005;i.scale.set(g,g,r),i.updateMatrix()}function yD(i,e,t,n,s,o={}){const r=u=>{u.inputSource===t&&i.down(Object.assign(u,{button:o.button??0}))},g=u=>{u.inputSource===t&&i.up(Object.assign(u,{button:o.button??0}))},a=`${n}start`,l=`${n}end`,I=s.length;for(let u=0;u{e.removeEventListener(a,r),e.removeEventListener(l,g)}}function BD(i){var e;return i.getButtonsDown().size>0?.6:UX(((e=i.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Rh(i){return i.getButtonsDown().size>0?.6:.4}function vD(i){var e;return UX(((e=i.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function UX(i,e,t,n,s){return n+Math.max(0,Math.min(1,(i-e)/(t-e)))*(s-n)}function ZD(i,e){return(t,n)=>{if(i===e)return t.identity(),!0;const s=typeof e=="function"?e():e;if(s==null)return!1;const o=n==null?void 0:n.getPose(i,s);return o==null?!1:(t.fromArray(o.transform.matrix),!0)}}function DX(i,e,t){if(e==null){t.copy(i.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(i.matrixWorld)}function wD(i,e,t,n){n==null||n.copy(i.matrix);const s=JX(i,n);return s!=null||e==null||t==null?s:(n!=null&&DX(i,e,n),t)}function JX({parent:i},e){if(i!=null)return e!=null&&e.premultiply(i.matrix),i.xrSpace??JX(i,e)}function RD(i,e,{anchors:t=!0,handTracking:n=!0,layers:s=!0,meshDetection:o=!0,planeDetection:r=!0,originReferenceSpace:g="local-floor",customSessionInit:a,depthSensing:l=!1,hitTest:I=!0,unbounded:u=!0,domOverlay:d=!0}={}){if(a!=null)return a;const A=[g],h=[];return d instanceof Element&&(d=!0),ir(t,"anchors",A,h),ir(n,"hand-tracking",A,h),ir(s,"layers",A,h),ir(o,"mesh-detection",A,h),ir(r,"plane-detection",A,h),ir(l,"depth-sensing",A,h),ir(d,"dom-overlay",A,h),ir(I,"hit-test",A,h),i!="immersive-vr"&&ir(u,"unbounded",A,h),{requiredFeatures:A,optionalFeatures:h,domOverlay:{root:e}}}function ir(i,e,t,n){if(i!==!1){if(i===!0){n.push(e);return}t.push(e)}}function og(i,e,t){return typeof i=="function"?i:(typeof i=="object"&&(e!=null&&SD(i,e)?i=i[e]:"default"in i&&(i=i.default)),i===!1?!1:i===!0?t:i??t)}function SD(i,e){return e in i}function PX(i,e,t){return i??(i=t),i===!1?!1:typeof i=="function"?i:e!=null&&e in i?i[e]??t:"default"in i?i.default??t:i}const OX={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function _R(i,e){var t,n;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(n=navigator.xr)==null?void 0:n.isSessionSupported("immersive-ar")]).then(([s,o])=>!o&&!s?dk(()=>import("./emulate-plYy4mhx.js"),[]):void 0).then(s=>{e&&window.alert("emulator started"),s==null||s.emulate(i===!0?"metaQuest3":i)})}function WD(i){const e=(i==null?void 0:i.emulate)??"metaQuest3";let t;if(e!=!1){window.location.hostname==="localhost"&&_R(e,!1);const d=A=>{A.altKey&&A.metaKey&&A.code==="KeyE"&&_R(e,!0)};window.addEventListener("keydown",d),t=()=>window.removeEventListener("keydown",d)}const n=(i==null?void 0:i.domOverlay)instanceof HTMLElement?i.domOverlay:document.createElement("div"),s=gX(()=>({...OX,controller:i==null?void 0:i.controller,hand:i==null?void 0:i.hand,gaze:i==null?void 0:i.gaze,screenInput:i==null?void 0:i.screenInput,transientPointer:i==null?void 0:i.transientPointer,detectedMesh:i==null?void 0:i.detectedMesh,detectedPlane:i==null?void 0:i.detectedPlane,domOverlayRoot:n}));let o;if(n.parentNode==null){const d=h=>{n.style.display=h.session!=null?"block":"none"},A=s.subscribe(d);d(s.getState()),document.body.appendChild(n),o=()=>{n.remove(),A()}}document.body.append(n);const r=AD({controller:d=>s.setState({controllerStates:[...s.getState().controllerStates,d]})},i),g=XD(s,r),a=MD(i==null?void 0:i.enterGrantedSession,d=>fA(n,d,i,u));let l;const I=[];let u;return Object.assign(s,{requestFrame(){return new Promise(d=>I.push(d))},setWebXRManager(d){if(u===d)return;u=d;const{foveation:A,originReferenceSpace:h="local-floor"}=i??{};d.setReferenceSpaceType(h),A!=null&&d.setFoveation(A),l==null||l(),l=VD(d,g)},setFrameRate(d){const{session:A}=s.getState();A!=null&&QX(A,d)},setHand(d,A){if(A==null){s.setState({hand:d});return}const h=s.getState().hand,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({hand:b})},setController(d,A){if(A==null){s.setState({controller:d});return}const h=s.getState().controller,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({controller:b})},setTransientPointer(d,A){if(A==null){s.setState({transientPointer:d});return}const h=s.getState().transientPointer,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({transientPointer:b})},setGaze(d){s.setState({gaze:d})},setScreenInput(d){s.setState({screenInput:d})},setDetectedPlane(d,A){if(A==null){s.setState({detectedPlane:d});return}const h=s.getState().detectedPlane,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({detectedPlane:b})},setDetectedMesh(d,A){if(A==null){s.setState({detectedMesh:d});return}const h=s.getState().detectedMesh,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({detectedMesh:b})},destroy(){t==null||t(),o==null||o(),l==null||l(),a==null||a(),g(void 0,void 0)},enterXR:d=>fA(n,d,i,u),enterAR:()=>fA(n,"immersive-ar",i,u),enterVR:()=>fA(n,"immersive-vr",i,u),onBeforeFrame(d,A,h){const{origin:b}=s.getState(),f=A.parent??d,p=(u==null?void 0:u.getReferenceSpace())??void 0;b!=f&&(f.xrSpace=p,s.setState({origin:f}));const{originReferenceSpace:G}=s.getState();if(p!=G&&(f.xrSpace=p,s.setState({originReferenceSpace:p})),h==null)return;u!=null&&HD(s,h,u);const y=I.length;for(let v=0;v component?"));const s=await navigator.xr.requestSession(e,RD(e,i,t));return QX(s,(t==null?void 0:t.frameRate)??"high"),xD(n,s,t),s}function xD(i,e,t){if(i==null)return;const n=XRWebGLLayer.getNativeFramebufferScaleFactor(e);let s=t==null?void 0:t.frameBufferScaling;typeof s=="function"&&(s=s(n)),typeof s=="string"&&(s=s==="high"?n:s==="mid"?1:.5),s!=null&&(i==null||i.setFramebufferScaleFactor(s)),i==null||i.setSession(e)}const UR=["immersive-ar","immersive-vr","inline"];function VD(i,e){const t=()=>{const n=i.getSession();e(n,n.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return i.addEventListener("sessionstart",t),()=>i.removeEventListener("sessionstart",t)}function MD(i=UR,e){var n;if(i===!1)return;i===!0&&(i=UR);const t=async()=>{var s;for(const o of i)await((s=navigator.xr)==null?void 0:s.isSessionSupported(o))&&e(o)};return(n=navigator.xr)==null||n.addEventListener("sessiongranted",t),()=>{var s;return(s=navigator.xr)==null?void 0:s.removeEventListener("sessiongranted",t)}}function XD(i,e){let t;return(n,s)=>{if(t==null||t(),n==null||s==null)return;const o=a=>i.setState(e(a.session,i.getState(),a.added,a.removed));n.addEventListener("inputsourceschange",o);const r=()=>i.setState({frameRate:n.frameRate,visibilityState:n.visibilityState}),g=()=>{t==null||t(),t=void 0,i.setState(OX)};n.addEventListener("end",g),n.addEventListener("frameratechange",r),n.addEventListener("visibilitychange",r),i.setState({...e(n,void 0,n.inputSources,void 0),frameRate:n.frameRate,visibilityState:n.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:s,session:n}),t=()=>{e(n,i.getState(),void 0,"all"),n.removeEventListener("end",g),n.removeEventListener("frameratechange",r),n.removeEventListener("visibilitychange",r),n.removeEventListener("inputsourceschange",o)}}}function HD(i,e,t){const n=t.getReferenceSpace(),{detectedMeshes:s,detectedPlanes:o,session:r,controllerStates:g,handStates:a}=i.getState();if(n==null||r==null)return;const l=DR(o,e.detectedPlanes),I=DR(s,e.detectedMeshes);(o!=l||s!=I)&&i.setState({detectedPlanes:l,detectedMeshes:I});const u=g.length;for(let A=0;A{t instanceof tn&&t.material instanceof on&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function LD(i,e,t){const n=[];for(const s in e.components){const o=e.components[s];let r=t[s];r==null&&(t[s]=r={state:"default"}),n.push(...Object.values(o.visualResponses).map(g=>zD(i,r,g)))}return()=>{const s=n.length;for(let o=0;o{};if(t.valueNodeProperty==="visibility")return()=>n.visible=t.states.includes(e.state);const s=i.getObjectByName(t.minNodeName),o=i.getObjectByName(t.maxNodeName);return s==null||o==null?()=>{}:()=>{const r=TD(e,t);n.quaternion.slerpQuaternions(s.quaternion,o.quaternion,r),n.position.lerpVectors(s.position,o.position,r),n.updateMatrix()}}function TD(i,{componentProperty:e,states:t}){const n=t.includes(i.state);switch(e){case"xAxis":return n?JR(i).x:.5;case"yAxis":return n?JR(i).y:.5;case"button":return n?i.button??0:0;case"state":return n?1:0}}const RI=new ce;function JR({xAxis:i=0,yAxis:e=0}){if(RI.lengthSq()>1){const n=Math.atan2(e,i);RI.set(Math.cos(n),Math.sin(n))}else RI.set(i,e);return RI.multiplyScalar(.5).addScalar(.5),RI}function ED({_listeners:i,__r3f:e}){return i!=null&&Object.keys(i).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function kD({_listeners:i,__r3f:e},t){if(i!=null&&t in i)return i[t];if(e==null)return;const n=e.handlers[_D[t]];if(n!=null)return[n]}const _D={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class xi{constructor(e,t,n,s,o,r=o.object,g=r){yt(this,"type");yt(this,"bubbles");yt(this,"nativeEvent");yt(this,"pointer");yt(this,"intersection");yt(this,"currentObject");yt(this,"object");yt(this,"stopPropagation");yt(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=n,this.pointer=s,this.intersection=o,this.currentObject=r,this.object=g}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:n,nativeEvent:s,pointer:o,intersection:r,target:g}=this;return new xi(t,n,s,o,r,e,g)}}class gB extends xi{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,s,o){super("wheel",!0,e,t,n,s,o)}retarget(e){const{type:t,bubbles:n,nativeEvent:s,pointer:o,intersection:r,target:g}=this;return new gB(s,o,r,e,g)}}function xs(i){jX(i,i.currentObject)}function jX(i,e){if(e==null)return;const t=kD(e,i.type);let n=!i.bubbles;if(t!=null&&t.length>0){const s=i.retarget(e),o=t.length;s.stopPropagation=()=>n=!0;let r=!1;s.stopImmediatePropagation=()=>{n=!0,r=!0};for(let g=0;g=0;g--){const a=this.pointerEnteredHelper[g];xs(new xi("pointerenter",!1,e,this,n,a))}if(n!=null&&xs(new xi("pointermove",!0,e,this,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const g=this.onFirstMove.length;for(let a=0;an){g.set(e.button,e.timeStamp);return}xs(new xi("dblclick",!0,e,this,this.intersection)),g.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&xs(new xi("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,n){if(!this.enabled)return;let s=this.intersection;if(n||(s=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&n){this.onFirstMove.push(this.cancel.bind(this,t));return}s!=null&&xs(new gB(t,this,s))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function $X(i,e,t,n){if(i==null)return;const s=t.indexOf(i);s!=-1?t.splice(s,1):n.push(i),e.push(i),$X(i.parent,e,t,n)}function UD(i,e,t,n,s){if(e==null)return!1;const o=e.get(t);return!(o==null||n-o>s||o!=i.get(t))}function cB(i,e,t){return e.face==null?!1:(i.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),i.applyMatrix4(t.matrixWorld),!0)}function DD(i,e,t,n,s,o){if(e==="none"||e==="listener"&&!i)return!1;if(t==="all")return!0;if(typeof t=="function")return t(n,s,o);let r,g;"deny"in t?(g=!0,r=t.deny):(g=!1,r=t.allow);let a;return Array.isArray(r)?a=r.includes(s):a=r===s,g?!a:a}function Sp(i,e,t,n,s,o=!1,r,g,a){const l=o||ED(i),I=i.pointerEvents??r,u=i.pointerEventsType??g,d=i.pointerEventsOrder??a;DD(l,I??"listener",u??"all",e,t,n)&&s(i,d);const h=i.children.length;for(let b=0;b0)&&(i=l,r=a)}return r}function JD(i,e=0,t,n=0){return e!=n?n-e:i.distance-t.distance}const or=new jC,PD=new Le,Xl=[];function OD(i,e,t,n,s,o,r,g){if(r!=null)return QD(i,e,r);let a,l;if(Sp(t,n,s,o,(I,u)=>{let d=0;const A=((a==null?void 0:a.details.lineIndex)??e.length-2)+2;for(let h=1;h0;n--){const s=e[n-1],o=e[n];if(Bb.origin.copy(s).applyMatrix4(i),Bb.direction.copy(o).applyMatrix4(i).sub(or.ray.origin).normalize(),Bb.intersectPlane(t,OR)!=null)return OR.clone()}}const vb=new jC,Zb=new X,QR=new Fs,qD=new Le,bA=[];function $D(i,e,t,n,s,o,r,g,a){if(g!=null)return eJ(i,e,t,g);let l,I;if(vb.ray.origin.copy(i),vb.ray.direction.copy(t).applyQuaternion(e),Sp(n,s,o,r,(u,d)=>{u.raycast(vb,bA);const A=IB(l,I,bA,d,a);A!=null&&(l=bA[A],I=d),bA.length=0}),l!=null)return Object.assign(l,{details:{type:"ray"},pointerPosition:i.clone(),pointerQuaternion:e.clone(),pointOnFace:l.point,localPoint:l.point.clone().applyMatrix4(qD.copy(l.object.matrixWorld).invert())})}const jR=new Vr;function eJ(i,e,t,{intersection:n,object:s}){if(n.details.type!="ray")return;Zb.copy(t).applyQuaternion(e),jR.set(i,Zb),cB(QR,n,s);const o=jR.intersectPlane(QR,new X)??n.point;return{...n,object:s,pointOnFace:o,point:Zb.clone().multiplyScalar(n.distance).add(i),pointerPosition:i.clone(),pointerQuaternion:e.clone()}}const wb=new Kn,GA=[];function eH(i,e,t,n,s,o,r,g,a){if(g!=null)return iJ(i,e,g);let l,I;if(wb.center.copy(i),wb.radius=t,Sp(n,s,o,r,(u,d)=>{nJ(wb,u,GA);const A=IB(l,I,GA,d,a);A!=null&&(l=GA[A],I=d),GA.length=0}),l!=null)return Object.assign(l,{details:{type:"sphere"},pointOnFace:l.point,pointerPosition:i.clone(),pointerQuaternion:e.clone(),localPoint:l.point.clone().applyMatrix4(Sh.copy(l.object.matrixWorld).invert())})}const yA=new Le;function tJ(i){return"spherecast"in i}function nJ(i,e,t){if(e.updateWorldMatrix(!0,!1),tJ(e)){e.spherecast(i,t);return}if(e instanceof mr){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let s=0;si.radius*i.radius)return;Rb.max(sJ);const r=lc.center.clone().sub(nS);r.divide(Rb),oJ(r);const g=BA.clone();return{distance:Math.sqrt(o),face:{a:0,b:0,c:0,materialIndex:0,normal:r},normal:r,point:g,instanceId:n,object:e}}function oJ(i){const e=Math.abs(i.x),t=Math.abs(i.y),n=Math.abs(i.z);if(e>=t&&e>=n){i.set(i.x<0?-1:1,0,0);return}if(t>=e&&t>=n){i.set(0,i.y<0?-1:1,0);return}i.set(0,0,i.z<0?-1:1)}const mG={radius:.07};function rJ(i,e,t=mG,n="grab"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I!=null)return I.updateWorldMatrix(!0,!1),s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),eH(s,o,t.radius??mG.radius,g,r,n,e,l,t)},void 0,void 0,void 0,t)}const gJ=new X(0,0,-1),aJ=new X,YI={direction:gJ,minDistance:0,linePoints:null};function lJ(i,e,t=YI,n="ray"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I==null)return;I.updateWorldMatrix(!0,!1);let u;const d=t.linePoints??YI.linePoints;if(d==null?(s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),u=$D(s,o,t.direction??YI.direction,g,r,n,e,l,t)):u=OD(I.matrixWorld,d,g,r,n,e,l,t),!(u==null||u.distance*I.getWorldScale(aJ).x<(t.minDistance??YI.minDistance)))return u},void 0,void 0,void 0,t)}const cc={button:0,downRadius:.03,hoverRadius:.1};function cJ(i,e,t=cc,n="touch"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I!=null)return I.updateWorldMatrix(!0,!1),s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),eH(s,o,t.hoverRadius??cc.hoverRadius,g,r,n,e,l,t)},IJ(t),void 0,void 0,t)}function IJ(i=cc){let e=!1;return t=>{if(!t.getEnabled())return;const n=t.getIntersection(),s=CJ(n,i.downRadius??cc.downRadius);if(s===e)return;const o={timeStamp:performance.now(),button:i.button??cc.button};s?t.down(o):t.up(o),e=s}}function CJ(i,e){return i==null?!1:i.distance<=e}let uJ=23412;function CB(){return uJ++}new X;new ce;let dJ=class{constructor(){yt(this,"pointers",[]);yt(this,"isDefaults",[]);yt(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var r,g;if(!this.enabled)return;const n=this.pointers.length;if(n===0)return;for(let a=0;a=i.lastChangedTime)return e;const t=new ut;return t.setIndex(new ct(i.indices,1)),t.setAttribute("position",new ct(i.vertices,3)),Object.assign(t,{creationTime:i.lastChangedTime})}function oS(i,e){return e!=null&&e.createdAt!=null&&e.createdAt>=i.lastChangedTime?e:Object.assign(AJ(i.polygon),{createdAt:i.lastChangedTime})}const WI=new VM,vA=new ce;function AJ(i){const e=new fr,t=i.map(({x:s,z:o})=>new ce(s,o));WI.setFromPoints(t),WI.getSize(vA);for(const s of t)s.sub(WI.min),s.divide(vA);e.setFromPoints(t);const n=new OC(e);return n.scale(vA.x,vA.y,1),n.translate(WI.min.x,WI.min.y,0),n.rotateX(Math.PI/2),n}new X;new X;new X;const xI=new Ki(0,0,0,"YXZ"),ZA=new Dt;function hJ(i,e,t){i.matrixWorld.decompose(e.position,ZA,e.scale),xI.setFromQuaternion(ZA),xI.z=0,xI.x=OA(xI.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),ZA.setFromEuler(xI),e.quaternion.slerp(ZA,t/100)}function pJ(i){return i.userData.teleportTarget===!0}function mJ(i={}){return e=>!(!pJ(e.object)||i.customFilter!=null&&!i.customFilter(e))}function fJ(){return new rp(new X(0,0,0),new X(0,0,-8),new X(0,-20,-15)).getPoints(20)}let bJ=class extends tn{constructor(t){const n=new ok,s=new Float32Array(t.length*3);for(let g=0;gg.distanceTo(t[a+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const s=t.getIntersection();if((s==null?void 0:s.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:o,lineIndex:r}=s.details,g=this.lineLengths[r];this.material.visibility=this.multiplier*(r+o/g)/this.lineLengths.length;const{color:a="white",opacity:l=.4,size:I=.01}=this.options;this.material.lineWidth=I,this.material.opacity=typeof l=="function"?l(t):l;const u=typeof a=="function"?a(t):a;Array.isArray(u)?this.material.color.set(...u):this.material.color.set(u)}};const wA=new Le,RA=new X,rS=new Dt;async function GJ(i,e,t=["point","plane","mesh"]){var a,l;let n,s,o;const r=i.getState();if(e instanceof XRSpace)s=e,o=r.origin;else{if(r.originReferenceSpace==null)return;o=e,s=wD(e,r.origin,r.originReferenceSpace,wA)??r.originReferenceSpace,s===r.originReferenceSpace&&DX(e,r.origin,wA),RA.setFromMatrixPosition(wA);const I={...RA};rS.setFromRotationMatrix(wA),RA.set(0,0,-1).applyQuaternion(rS);const u={...RA};n=new XRRay(I,u)}const g=await((l=(a=i.getState().session)==null?void 0:a.requestHitTestSource)==null?void 0:l.call(a,{space:s,entityTypes:Array.isArray(t)?t:[t],offsetRay:n}));if(g!=null)return{source:g,getWorldMatrix:yJ.bind(null,s,o)}}function yJ(i,e,t,n){const s=n.getPose(i);return s==null?!1:(t.fromArray(s.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new X(1,1,1);new X(1,1,1);new Le;new Le;new X;new X;const tH=new bU,nH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",BJ="generic-trigger";class vJ{constructor(e){yt(this,"baseAssetPath");yt(this,"defaultProfileId");yt(this,"profilesListPromise");yt(this,"profilePromisesMap",new Map);yt(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??nH,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??BJ}async load(e,t){const n=await this.loadProfile(e);for(const s in n.layouts)if(s.includes(t))return n.layouts[s];throw new Error(`No matching layout for "${t}", in profile ${n.profileId} with layouts ${Object.keys(n.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=gS(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,n=e.length;for(let o=0;oi.visibilityState)}function WJ(i,e){const t=E.useRef(e);t.current=e;const[n,s]=E.useMemo(()=>{let o;return[r=>{let g=!1;return navigator.xr==null?(o=!1,()=>{}):(navigator.xr.isSessionSupported(i).then(a=>{o=a,!g&&r()}).catch(a=>{var l;g||(l=t.current)==null||l.call(t,a)}),()=>g=!0)},()=>o]},[i]);return E.useSyncExternalStore(n,s)}E.forwardRef(({id:i,children:e,onPress:t,onRelease:n},s)=>{const o=uB(),[r,g]=E.useState(void 0);if(E.useImperativeHandle(s,()=>r,[r]),xJ(i,a=>a==="pressed"?t==null?void 0:t():n==null?void 0:n()),Wn(()=>{var a;return g((a=o.gamepad[i])==null?void 0:a.object)}),r!=null)return eB(e,r)});function xJ(i,e,t){const n=uB(),s=E.useRef();Wn(()=>{var r;const o=(r=n==null?void 0:n.gamepad[i])==null?void 0:r.state;o!=null&&o!=s.current&&e(o),s.current=o})}function uB(i){const e=E.useContext(_o);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const VJ=Symbol("loadXRControllerModel"),MJ=E.forwardRef((i,e)=>{const t=uB(),n=qy(YD,[t.layout,void 0,VJ]);KD(n,i),t.object=n,E.useImperativeHandle(e,()=>n,[n]);const s=E.useMemo(()=>LD(n,t.layout,t.gamepad),[n,t.layout,t.gamepad]);return Wn(s),D.jsx("primitive",{object:n})});function dB(i){const e=E.useContext(_o);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const XJ=Symbol("loadXRHandModel"),HJ=E.forwardRef((i,e)=>{const t=dB(),n=qy(gD,[t.assetPath,void 0,XJ]);aD(n,i),E.useImperativeHandle(e,()=>n,[n]);const s=iP(),o=E.useMemo(()=>CD(t.inputSource.hand,n,s),[t.inputSource,n,s]);return Wn((r,g,a)=>o(a)),D.jsx("primitive",{object:n})});E.forwardRef(({joint:i,children:e},t)=>{const n=dB();return D.jsx(Ds,{ref:t,space:n.inputSource.hand.get(i),children:e})});function gH({children:i}){const e=E.useMemo(()=>new dJ,[]);return lH(e),Wn(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),D.jsx(rH.Provider,{value:e,children:i})}function FJ(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,mG,t);const o=E.useMemo(()=>rJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}function aH(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,YI,t);const o=E.useMemo(()=>lJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}function NJ(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,cc,t);const o=E.useMemo(()=>cJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}const YJ=E.forwardRef((i,e)=>{const t=E.useMemo(()=>new bD,[]),n=E.useRef(null);return E.useImperativeHandle(e,()=>n.current,[]),Wn(()=>n.current!=null&&GD(n.current,t,i.pointer,i)),D.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:i.renderOrder??2,ref:n,material:t,children:D.jsx("boxGeometry",{})})}),Wp=E.forwardRef((i,e)=>{const t=E.useMemo(()=>new pD,[]),n=E.useRef(null);E.useImperativeHandle(e,()=>n.current,[]),Wn(()=>n.current!=null&&fD(n.current,t,i.pointer,i));const s=Gi(o=>o.scene);return eB(D.jsx("mesh",{renderOrder:i.renderOrder??1,ref:n,matrixAutoUpdate:!1,material:t,children:D.jsx("planeGeometry",{})}),s)});function AB(i,e,t,n){const s=Sn(o=>o.session);E.useEffect(()=>{if(s!=null)return yD(i,s,e,t,n)},[t,e,i,s,n])}function hB(i,e=!1){const t=E.useContext(rH);t==null?(lH(i),Wn(n=>i.move(n.scene,{timeStamp:performance.now()}),-50)):E.useEffect(()=>t.register(i,e),[t,i,e]),E.useEffect(()=>()=>i.exit({timeStamp:performance.now()}),[i])}function lH(i){const e=pB();E.useEffect(()=>hD(e,t=>i.setEnabled(t,{timeStamp:performance.now()})),[e,i])}const KJ=E.forwardRef(({pointer:i,linePoints:e,...t},n)=>{const s=E.useMemo(()=>new bJ(e),[e]);return E.useImperativeHandle(n,()=>s,[s]),s.options=t,Wn(()=>s.update(i)),D.jsx("primitive",{object:s})});function cH(i,e,t){const n=E.useContext(_o);if(n==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const s=E.useRef(null),o=FJ(s,n,t);AB(o,n.inputSource,i,n.events);const r=t.cursorModel;return D.jsx(Ds,{ref:s,space:e(n.inputSource),children:r!==!1&&D.jsx(Wp,{pointer:o,opacity:BD,...ii(r)})})}const LJ=cH.bind(null,"select",i=>i.hand.get("index-finger-tip")),zJ=cH.bind(null,"squeeze",i=>i.gripSpace);function iu(i){const e=E.useContext(_o);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=E.useRef(null),n=aH(t,e,i);AB(n,e.inputSource,"select",e.events);const s=i.rayModel,o=i.cursorModel;return D.jsxs(Ds,{ref:t,space:e.inputSource.targetRaySpace,children:[s!==!1&&D.jsx(YJ,{pointer:n,opacity:Rh,...ii(s)}),o!==!1&&D.jsx(Wp,{pointer:n,opacity:Rh,...ii(o)})]})}function TJ(i){const e=dB(),t=E.useRef(null),n=NJ(t,e,i),s=i.cursorModel;return D.jsx(Ds,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:s!==!1&&D.jsx(Wp,{pointer:n,opacity:vD,...ii(s)})})}function EJ(i){const e=i.model,t=i.grabPointer,n=i.rayPointer,s=i.teleportPointer??!1;return D.jsxs(D.Fragment,{children:[e!==!1&&D.jsx(E.Suspense,{children:D.jsx(MJ,{...ii(e)})}),D.jsxs(gH,{children:[t!==!1&&D.jsx(zJ,{...ii(t)}),n!==!1&&D.jsx(iu,{makeDefault:!0,minDistance:.2,...ii(n)}),s!==!1&&D.jsx(IH,{...ii(s)})]})]})}function kJ(i){var g;const e=i.model,t=i.grabPointer,n=i.rayPointer,s=i.touchPointer,o=i.teleportPointer??!1,r=n===!1?!1:(g=ii(n))==null?void 0:g.rayModel;return D.jsxs(D.Fragment,{children:[e!==!1&&D.jsx(E.Suspense,{children:D.jsx(HJ,{...ii(e)})}),D.jsxs(gH,{children:[t!==!1&&D.jsx(LJ,{...ii(t)}),s!==!1&&D.jsx(TJ,{...ii(s)}),n!==!1&&D.jsx(iu,{makeDefault:!0,minDistance:.2,...ii(n),rayModel:r===!1?!1:{maxLength:.2,...ii(r)}}),o!==!1&&D.jsx(IH,{...ii(o)})]})]})}function _J(i){return D.jsx(iu,{...i,rayModel:!1})}function UJ(i){return D.jsx(iu,{...i,rayModel:!1})}function DJ(i){return D.jsx(iu,{...i,cursorModel:!1,rayModel:!1})}function IH(i){const e=E.useContext(_o);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=E.useRef(null),n=E.useRef(null),s=E.useMemo(()=>fJ(),[]),o=aH(n,e,{...i,linePoints:s,customFilter:mJ(i)},"teleport");AB(o,e.inputSource,"select",e.events);const r=i.rayModel,g=i.cursorModel,a=Gi(I=>I.scene),l=E.useRef(null);return Wn((I,u)=>{l.current!=null&&(l.current.visible=o.getEnabled()&&o.getButtonsDown().size>0);const d=n.current,A=t.current;d==null||A==null||hJ(A,d,u*1e3)}),D.jsxs(D.Fragment,{children:[D.jsx(Ds,{ref:t,space:e.inputSource.targetRaySpace}),eB(D.jsxs("group",{ref:n,children:[r!==!1&&D.jsx(KJ,{linePoints:s,pointer:o,opacity:Rh,...ii(r)}),g!==!1&&D.jsx(Wp,{ref:l,pointer:o,opacity:Rh,...ii(g)})]}),a)]})}function ii(i){if(i!==!0)return i}function JJ({children:i}){const e=Sn(r=>r.originReferenceSpace),t=Sn(r=>r.origin),n=SJ()==="visible",s=$C(),o=E.useMemo(()=>Object.assign({},s,{getState(){return{...s.getState(),scene:t}}}),[t,s]);return t==null||e==null?null:D.jsx(D.Fragment,{children:yc.createPortal(D.jsx(Bp.Provider,{value:s,children:D.jsxs(nu.Provider,{value:e,children:[D.jsxs("group",{matrixAutoUpdate:!1,visible:n,children:[D.jsx(PJ,{}),D.jsx(OJ,{}),D.jsx(QJ,{}),D.jsx(jJ,{}),D.jsx(qJ,{})]}),D.jsx($J,{}),D.jsx(eP,{}),i]})}),o,null)})}function PJ(){const i=Sn(t=>t.controllerStates);let e=Sn(t=>t.controller);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.gripSpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(EJ,{...n})})})},Ua(t))})})}function OJ(){const i=Sn(t=>t.handStates),e=Sn(t=>t.hand);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.hand.get("wrist"),children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(kJ,{...n})})})},Ua(t))})})}function QJ(){const i=Sn(t=>t.transientPointerStates),e=Sn(t=>t.transientPointer);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(_J,{...n})})})},Ua(t))})})}function jJ(){const i=Sn(t=>t.gazeStates),e=Sn(t=>t.gaze);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof e=="function"?D.jsx(e,{}):D.jsx(UJ,{...CH(e)})})})},Ua(t)))})}function qJ(){const i=Sn(t=>t.screenInputStates),e=Sn(t=>t.screenInput);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof e=="function"?D.jsx(e,{}):D.jsx(DJ,{...CH(e)})})})},Ua(t)))})}function CH(i){if(i!==!0)return i}function $J(){const i=Sn(t=>t.detectedMeshes),e=Sn(t=>t.detectedMesh);if(e!==!1)return D.jsx(D.Fragment,{children:i.map(t=>{const n=PX(e,t.semanticLabel,!1);return n===!1?null:D.jsx(Ds,{space:t.meshSpace,children:D.jsx(sH.Provider,{value:t,children:D.jsx(E.Suspense,{children:D.jsx(n,{})})})},Ua(t))})})}function eP(){const i=Sn(t=>t.detectedPlanes),e=Sn(t=>t.detectedPlane);if(e!=null)return D.jsx(D.Fragment,{children:i.map(t=>{const n=PX(e,t.semanticLabel,!1);return n===!1?null:D.jsx(Ds,{space:t.planeSpace,children:D.jsx(oH.Provider,{value:t,children:D.jsx(E.Suspense,{children:D.jsx(n,{})})})},Ua(t))})})}function tP(i){return WD(i)}function nP({children:i,store:e}){e.setWebXRManager(Gi(n=>n.gl.xr));const t=$C();return E.useEffect(()=>{let n;return e.subscribe((s,o)=>{const r=s.mode!=null,g=o.mode!=null;if(r!==g){if(r){const{camera:a,gl:l}=t.getState();n=a,t.setState({camera:l.xr.getCamera()});return}n!=null&&t.setState({camera:n})}})},[t,e]),Wn((n,s,o)=>e.onBeforeFrame(n.scene,n.camera,o),-1e3),D.jsxs(iH.Provider,{value:e,children:[D.jsx(JJ,{}),i]})}function pB(){const i=E.useContext(iH);if(i==null)throw new Error("XR features can only be used inside the component");return i}function Sn(i=e=>e){return iB(pB(),i)}const Ds=E.forwardRef(({space:i,children:e},t)=>{const n=E.useRef(null);return E.useImperativeHandle(t,()=>n.current,[]),oP(n,i,(s,o,r)=>{n.current!=null&&(n.current.visible=r!=null)}),D.jsx("group",{xrSpace:i,visible:!1,matrixAutoUpdate:!1,ref:n,children:D.jsx(nu.Provider,{value:i,children:e})})});function iP(){const i=E.useContext(nu);if(i==null)throw new Error("XR objects must be placed inside the XROrigin");return i}function sP(i){const e=E.useContext(nu),t=Sn(n=>e??n.originReferenceSpace);return E.useMemo(()=>t==null?void 0:ZD(i,t),[i,t])}function oP(i,e,t){const n=sP(e);Wn((s,o,r)=>{i.current==null||n==null||(n(i.current.matrix,r),t==null||t(s,o,r))},-100)}E.forwardRef((i,e)=>{const t=rP(),n=gP(t);return D.jsx("mesh",{ref:e,geometry:n,...i})});function rP(){const i=E.useContext(sH);if(i==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return i}function gP(i,e=!0){const[t,n]=E.useState(sS(i,void 0));return Wn(()=>n(s=>sS(i,s))),E.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}E.forwardRef((i,e)=>{const t=aP(),n=lP(t);return D.jsx("mesh",{ref:e,geometry:n,...i})});function aP(){const i=E.useContext(oH);if(i==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return i}function lP(i,e=!0){const[t,n]=E.useState(oS(i,void 0));return Wn(()=>n(s=>oS(i,s))),E.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const cP=E.forwardRef(({children:i,...e},t)=>{const n=Gi(o=>o.gl.xr.getCamera()),s=Sn(o=>o.originReferenceSpace);return s==null?null:D.jsxs("group",{ref:t,...e,children:[D.jsx("primitive",{object:n}),D.jsx(nu.Provider,{value:s,children:i})]})});function IP(i,e,t){const n=E.useRef(void 0);CP(e,t,E.useCallback(s=>n.current=s,[])),Wn((s,o,r)=>{i==null||r==null||n.current==null||i(r.getHitTestResults(n.current.source),n.current.getWorldMatrix)})}function CP(i,e,t){const n=pB();E.useEffect(()=>{let s,o=!1;const r=i instanceof XRSpace?i:i.current;if(r!=null)return GJ(n,r,e).then(g=>{o||(s=g,t(g))}),()=>{t(void 0),o=!0,s==null||s.source.cancel()}},[n,i,e,t])}E.forwardRef((i,e)=>{const t=E.useRef(null);return E.useImperativeHandle(e,()=>t.current),IP(i.onResults,t,i.trackableType),D.jsx("group",{...i,ref:t})});E.forwardRef((i,e)=>{const t=Sn(o=>o.domOverlayRoot),{In:n,Out:s}=E.useMemo(Uk,[]);return E.useEffect(()=>{const o=uy(t);return o.render(D.jsx(s,{})),()=>o.unmount()},[t,s]),D.jsx(n,{children:D.jsx("div",{...i,ref:e})})});const uH=E.forwardRef(({store:i,mode:e,onError:t,children:n,...s},o)=>{const r=iB(i,a=>a.session),g=WJ(e,t);return D.jsx("button",{ref:o,...s,onClick:()=>r!=null?r.end():i.enterXR(e).catch(t),children:typeof n=="function"?n(g?r!=null?"entered":"exited":"unsupported"):n})});E.forwardRef((i,e)=>D.jsx(uH,{ref:e,mode:"immersive-ar",...i}));E.forwardRef((i,e)=>D.jsx(uH,{ref:e,mode:"immersive-vr",...i}));const uP={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:i=>i.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:i=>i.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:i=>i.pointerType==="ray"},onSqueeze:{type:"click",filter:i=>i.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:i=>i.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:i=>i.pointerType==="grab"}};function sr(i,e,t){const n=E.useRef(t);n.current=t,E.useEffect(()=>{const{current:s}=i;if(s==null)return;const o=uP[e],r=typeof o=="string"?a=>{var l;return(l=n.current)==null?void 0:l.call(n,{intersection:a,intersections:[a],target:a.pointerState})}:a=>{var l;a instanceof xi&&!o.filter(a)||(l=n.current)==null||l.call(n,{intersection:a,intersections:[a],target:a.pointerState})},g=typeof o=="string"?o:o.type;return s.addEventListener(g,r),()=>s.removeEventListener(g,r)},[i,e])}const dP=E.forwardRef(({onHover:i,onBlur:e,onSelectStart:t,onSelectEnd:n,onSelect:s,onSqueezeStart:o,onSqueezeEnd:r,onSqueeze:g,onMove:a,children:l},I)=>{const u=E.useRef(null);return E.useImperativeHandle(I,()=>u.current),sr(u,"onHover",i),sr(u,"onBlur",e),sr(u,"onSelectStart",t),sr(u,"onSelectEnd",n),sr(u,"onSelect",s),sr(u,"onSqueezeStart",o),sr(u,"onSqueezeEnd",r),sr(u,"onSqueeze",g),sr(u,"onMove",a),D.jsx("group",{ref:u,children:l})});E.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:n,...s},o){const r=E.useRef(),g=E.useRef(null),a=E.useMemo(()=>new Le,[]);return E.useImperativeHandle(o,()=>g.current),Wn(()=>{const l=r.current,I=g.current;!I||!l||(I.applyMatrix4(a),I.applyMatrix4(l.matrixWorld),I.updateMatrixWorld(),a.copy(l.matrixWorld).invert())}),D.jsx(dP,{ref:g,onSelectStart:l=>{uD(l.target)&&(l.target.type==="controller"||l.target.type==="hand")&&l.target.object!=null&&(r.current=l.target.object,a.copy(l.target.object.matrixWorld).invert(),e==null||e(l))},onSelectEnd:l=>{l.target.controller===r.current&&(r.current=void 0),t==null||t(l)},...s,children:n})});const lS=tP({hand:{touchPointer:!1}});function AP(){return D.jsxs(D.Fragment,{children:[D.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>lS.enterVR(),children:"Enter VR"}),D.jsxs(cE,{dpr:[1,2],shadows:!0,camera:{position:[-40,40,40],fov:25,near:1,far:100},children:[D.jsx(Ik,{}),D.jsxs(nP,{store:lS,children:[D.jsx("color",{attach:"background",args:["#171720"]}),D.jsx("fog",{attach:"fog",args:["#171720",60,90]}),D.jsx("ambientLight",{intensity:.2}),D.jsx("pointLight",{position:[-20,-5,-20],color:"red"}),D.jsx(E.Suspense,{children:D.jsxs(lU,{allowSleep:!1,iterations:15,gravity:[0,-200,0],children:[D.jsx(cU,{}),D.jsx(dU,{rotation:[-Math.PI/3,0,0]}),D.jsx(hP,{position:[0,-5,0],rotation:[-Math.PI/2,0,0]}),D.jsx(AU,{position:[0,0,-2.52]}),D.jsx(pU,{position:[8,0,0]}),D.jsx(hU,{position:[8,3,0]}),D.jsx(mU,{position:[0,15,0]})]})}),D.jsx("group",{position:[0,-5,0],children:D.jsx(cP,{scale:10})})]})]})]})}function hP(i){const[e]=$_(()=>({type:"Static",...i}));return D.jsxs("mesh",{ref:e,receiveShadow:!0,children:[D.jsx("planeGeometry",{args:[100,100]}),D.jsx("meshPhongMaterial",{color:"#878790",blur:[400,400],resolution:1024,mixBlur:1,mixStrength:3,depthScale:1,minDepthThreshold:.85,metalness:0,roughness:1})]})}uy(document.getElementById("root")).render(D.jsx(E.StrictMode,{children:D.jsx(AP,{})}));export{wg as B,La as C,Ns as D,Ki as E,Pe as F,Ls as G,gi as L,Le as M,wt as O,Ka as P,Dt as Q,jC as R,QC as S,hp as T,X as V,DV as W,Yn as a,ut as b,tn as c,PC as d,To as e,yh as f,Wh as g,cn as h,dp as i,D as j,uo as k,uy as l,qI as o,E as r}; + diffuseColor.a *= vFade;`)}}function GD(i,e,t,n){if(!t.getEnabled()){i.visible=!1;return}i.visible=!0;const s=t.getIntersection(),o=typeof n.color=="function"?n.color(t):n.color;Array.isArray(o)?e.color.set(...o):e.color.set(o??"white"),e.opacity=typeof n.opacity=="function"?n.opacity(t):n.opacity??.4;let r=n.maxLength??1;s!=null&&(r=Math.min(r,s.distance)),i.position.z=-r/2;const g=n.size??.005;i.scale.set(g,g,r),i.updateMatrix()}function yD(i,e,t,n,s,o={}){const r=u=>{u.inputSource===t&&i.down(Object.assign(u,{button:o.button??0}))},g=u=>{u.inputSource===t&&i.up(Object.assign(u,{button:o.button??0}))},a=`${n}start`,l=`${n}end`,I=s.length;for(let u=0;u{e.removeEventListener(a,r),e.removeEventListener(l,g)}}function BD(i){var e;return i.getButtonsDown().size>0?.6:UX(((e=i.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Rh(i){return i.getButtonsDown().size>0?.6:.4}function vD(i){var e;return UX(((e=i.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function UX(i,e,t,n,s){return n+Math.max(0,Math.min(1,(i-e)/(t-e)))*(s-n)}function ZD(i,e){return(t,n)=>{if(i===e)return t.identity(),!0;const s=typeof e=="function"?e():e;if(s==null)return!1;const o=n==null?void 0:n.getPose(i,s);return o==null?!1:(t.fromArray(o.transform.matrix),!0)}}function DX(i,e,t){if(e==null){t.copy(i.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(i.matrixWorld)}function wD(i,e,t,n){n==null||n.copy(i.matrix);const s=JX(i,n);return s!=null||e==null||t==null?s:(n!=null&&DX(i,e,n),t)}function JX({parent:i},e){if(i!=null)return e!=null&&e.premultiply(i.matrix),i.xrSpace??JX(i,e)}function RD(i,e,{anchors:t=!0,handTracking:n=!0,layers:s=!0,meshDetection:o=!0,planeDetection:r=!0,originReferenceSpace:g="local-floor",customSessionInit:a,depthSensing:l=!1,hitTest:I=!0,unbounded:u=!0,domOverlay:d=!0}={}){if(a!=null)return a;const A=[g],h=[];return d instanceof Element&&(d=!0),ir(t,"anchors",A,h),ir(n,"hand-tracking",A,h),ir(s,"layers",A,h),ir(o,"mesh-detection",A,h),ir(r,"plane-detection",A,h),ir(l,"depth-sensing",A,h),ir(d,"dom-overlay",A,h),ir(I,"hit-test",A,h),i!="immersive-vr"&&ir(u,"unbounded",A,h),{requiredFeatures:A,optionalFeatures:h,domOverlay:{root:e}}}function ir(i,e,t,n){if(i!==!1){if(i===!0){n.push(e);return}t.push(e)}}function og(i,e,t){return typeof i=="function"?i:(typeof i=="object"&&(e!=null&&SD(i,e)?i=i[e]:"default"in i&&(i=i.default)),i===!1?!1:i===!0?t:i??t)}function SD(i,e){return e in i}function PX(i,e,t){return i??(i=t),i===!1?!1:typeof i=="function"?i:e!=null&&e in i?i[e]??t:"default"in i?i.default??t:i}const OX={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function _R(i,e){var t,n;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(n=navigator.xr)==null?void 0:n.isSessionSupported("immersive-ar")]).then(([s,o])=>!o&&!s?dk(()=>import("./emulate-BJ1WIuRG.js"),[]):void 0).then(s=>{e&&window.alert("emulator started"),s==null||s.emulate(i===!0?"metaQuest3":i)})}function WD(i){const e=(i==null?void 0:i.emulate)??"metaQuest3";let t;if(e!=!1){window.location.hostname==="localhost"&&_R(e,!1);const d=A=>{A.altKey&&A.metaKey&&A.code==="KeyE"&&_R(e,!0)};window.addEventListener("keydown",d),t=()=>window.removeEventListener("keydown",d)}const n=(i==null?void 0:i.domOverlay)instanceof HTMLElement?i.domOverlay:document.createElement("div"),s=gX(()=>({...OX,controller:i==null?void 0:i.controller,hand:i==null?void 0:i.hand,gaze:i==null?void 0:i.gaze,screenInput:i==null?void 0:i.screenInput,transientPointer:i==null?void 0:i.transientPointer,detectedMesh:i==null?void 0:i.detectedMesh,detectedPlane:i==null?void 0:i.detectedPlane,domOverlayRoot:n}));let o;if(n.parentNode==null){const d=h=>{n.style.display=h.session!=null?"block":"none"},A=s.subscribe(d);d(s.getState()),document.body.appendChild(n),o=()=>{n.remove(),A()}}document.body.append(n);const r=AD({controller:d=>s.setState({controllerStates:[...s.getState().controllerStates,d]})},i),g=XD(s,r),a=MD(i==null?void 0:i.enterGrantedSession,d=>fA(n,d,i,u));let l;const I=[];let u;return Object.assign(s,{requestFrame(){return new Promise(d=>I.push(d))},setWebXRManager(d){if(u===d)return;u=d;const{foveation:A,originReferenceSpace:h="local-floor"}=i??{};d.setReferenceSpaceType(h),A!=null&&d.setFoveation(A),l==null||l(),l=VD(d,g)},setFrameRate(d){const{session:A}=s.getState();A!=null&&QX(A,d)},setHand(d,A){if(A==null){s.setState({hand:d});return}const h=s.getState().hand,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({hand:b})},setController(d,A){if(A==null){s.setState({controller:d});return}const h=s.getState().controller,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({controller:b})},setTransientPointer(d,A){if(A==null){s.setState({transientPointer:d});return}const h=s.getState().transientPointer,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({transientPointer:b})},setGaze(d){s.setState({gaze:d})},setScreenInput(d){s.setState({screenInput:d})},setDetectedPlane(d,A){if(A==null){s.setState({detectedPlane:d});return}const h=s.getState().detectedPlane,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({detectedPlane:b})},setDetectedMesh(d,A){if(A==null){s.setState({detectedMesh:d});return}const h=s.getState().detectedMesh,b={};typeof h=="object"&&Object.assign(b,h),Object.assign(b,{default:og(h,void 0,{}),[A]:d}),s.setState({detectedMesh:b})},destroy(){t==null||t(),o==null||o(),l==null||l(),a==null||a(),g(void 0,void 0)},enterXR:d=>fA(n,d,i,u),enterAR:()=>fA(n,"immersive-ar",i,u),enterVR:()=>fA(n,"immersive-vr",i,u),onBeforeFrame(d,A,h){const{origin:b}=s.getState(),f=A.parent??d,p=(u==null?void 0:u.getReferenceSpace())??void 0;b!=f&&(f.xrSpace=p,s.setState({origin:f}));const{originReferenceSpace:G}=s.getState();if(p!=G&&(f.xrSpace=p,s.setState({originReferenceSpace:p})),h==null)return;u!=null&&HD(s,h,u);const y=I.length;for(let v=0;v component?"));const s=await navigator.xr.requestSession(e,RD(e,i,t));return QX(s,(t==null?void 0:t.frameRate)??"high"),xD(n,s,t),s}function xD(i,e,t){if(i==null)return;const n=XRWebGLLayer.getNativeFramebufferScaleFactor(e);let s=t==null?void 0:t.frameBufferScaling;typeof s=="function"&&(s=s(n)),typeof s=="string"&&(s=s==="high"?n:s==="mid"?1:.5),s!=null&&(i==null||i.setFramebufferScaleFactor(s)),i==null||i.setSession(e)}const UR=["immersive-ar","immersive-vr","inline"];function VD(i,e){const t=()=>{const n=i.getSession();e(n,n.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return i.addEventListener("sessionstart",t),()=>i.removeEventListener("sessionstart",t)}function MD(i=UR,e){var n;if(i===!1)return;i===!0&&(i=UR);const t=async()=>{var s;for(const o of i)await((s=navigator.xr)==null?void 0:s.isSessionSupported(o))&&e(o)};return(n=navigator.xr)==null||n.addEventListener("sessiongranted",t),()=>{var s;return(s=navigator.xr)==null?void 0:s.removeEventListener("sessiongranted",t)}}function XD(i,e){let t;return(n,s)=>{if(t==null||t(),n==null||s==null)return;const o=a=>i.setState(e(a.session,i.getState(),a.added,a.removed));n.addEventListener("inputsourceschange",o);const r=()=>i.setState({frameRate:n.frameRate,visibilityState:n.visibilityState}),g=()=>{t==null||t(),t=void 0,i.setState(OX)};n.addEventListener("end",g),n.addEventListener("frameratechange",r),n.addEventListener("visibilitychange",r),i.setState({...e(n,void 0,n.inputSources,void 0),frameRate:n.frameRate,visibilityState:n.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:s,session:n}),t=()=>{e(n,i.getState(),void 0,"all"),n.removeEventListener("end",g),n.removeEventListener("frameratechange",r),n.removeEventListener("visibilitychange",r),n.removeEventListener("inputsourceschange",o)}}}function HD(i,e,t){const n=t.getReferenceSpace(),{detectedMeshes:s,detectedPlanes:o,session:r,controllerStates:g,handStates:a}=i.getState();if(n==null||r==null)return;const l=DR(o,e.detectedPlanes),I=DR(s,e.detectedMeshes);(o!=l||s!=I)&&i.setState({detectedPlanes:l,detectedMeshes:I});const u=g.length;for(let A=0;A{t instanceof tn&&t.material instanceof on&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function LD(i,e,t){const n=[];for(const s in e.components){const o=e.components[s];let r=t[s];r==null&&(t[s]=r={state:"default"}),n.push(...Object.values(o.visualResponses).map(g=>zD(i,r,g)))}return()=>{const s=n.length;for(let o=0;o{};if(t.valueNodeProperty==="visibility")return()=>n.visible=t.states.includes(e.state);const s=i.getObjectByName(t.minNodeName),o=i.getObjectByName(t.maxNodeName);return s==null||o==null?()=>{}:()=>{const r=TD(e,t);n.quaternion.slerpQuaternions(s.quaternion,o.quaternion,r),n.position.lerpVectors(s.position,o.position,r),n.updateMatrix()}}function TD(i,{componentProperty:e,states:t}){const n=t.includes(i.state);switch(e){case"xAxis":return n?JR(i).x:.5;case"yAxis":return n?JR(i).y:.5;case"button":return n?i.button??0:0;case"state":return n?1:0}}const RI=new ce;function JR({xAxis:i=0,yAxis:e=0}){if(RI.lengthSq()>1){const n=Math.atan2(e,i);RI.set(Math.cos(n),Math.sin(n))}else RI.set(i,e);return RI.multiplyScalar(.5).addScalar(.5),RI}function ED({_listeners:i,__r3f:e}){return i!=null&&Object.keys(i).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function kD({_listeners:i,__r3f:e},t){if(i!=null&&t in i)return i[t];if(e==null)return;const n=e.handlers[_D[t]];if(n!=null)return[n]}const _D={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class xi{constructor(e,t,n,s,o,r=o.object,g=r){yt(this,"type");yt(this,"bubbles");yt(this,"nativeEvent");yt(this,"pointer");yt(this,"intersection");yt(this,"currentObject");yt(this,"object");yt(this,"stopPropagation");yt(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=n,this.pointer=s,this.intersection=o,this.currentObject=r,this.object=g}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:n,nativeEvent:s,pointer:o,intersection:r,target:g}=this;return new xi(t,n,s,o,r,e,g)}}class gB extends xi{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,s,o){super("wheel",!0,e,t,n,s,o)}retarget(e){const{type:t,bubbles:n,nativeEvent:s,pointer:o,intersection:r,target:g}=this;return new gB(s,o,r,e,g)}}function xs(i){jX(i,i.currentObject)}function jX(i,e){if(e==null)return;const t=kD(e,i.type);let n=!i.bubbles;if(t!=null&&t.length>0){const s=i.retarget(e),o=t.length;s.stopPropagation=()=>n=!0;let r=!1;s.stopImmediatePropagation=()=>{n=!0,r=!0};for(let g=0;g=0;g--){const a=this.pointerEnteredHelper[g];xs(new xi("pointerenter",!1,e,this,n,a))}if(n!=null&&xs(new xi("pointermove",!0,e,this,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const g=this.onFirstMove.length;for(let a=0;an){g.set(e.button,e.timeStamp);return}xs(new xi("dblclick",!0,e,this,this.intersection)),g.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&xs(new xi("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,n){if(!this.enabled)return;let s=this.intersection;if(n||(s=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&n){this.onFirstMove.push(this.cancel.bind(this,t));return}s!=null&&xs(new gB(t,this,s))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function $X(i,e,t,n){if(i==null)return;const s=t.indexOf(i);s!=-1?t.splice(s,1):n.push(i),e.push(i),$X(i.parent,e,t,n)}function UD(i,e,t,n,s){if(e==null)return!1;const o=e.get(t);return!(o==null||n-o>s||o!=i.get(t))}function cB(i,e,t){return e.face==null?!1:(i.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),i.applyMatrix4(t.matrixWorld),!0)}function DD(i,e,t,n,s,o){if(e==="none"||e==="listener"&&!i)return!1;if(t==="all")return!0;if(typeof t=="function")return t(n,s,o);let r,g;"deny"in t?(g=!0,r=t.deny):(g=!1,r=t.allow);let a;return Array.isArray(r)?a=r.includes(s):a=r===s,g?!a:a}function Sp(i,e,t,n,s,o=!1,r,g,a){const l=o||ED(i),I=i.pointerEvents??r,u=i.pointerEventsType??g,d=i.pointerEventsOrder??a;DD(l,I??"listener",u??"all",e,t,n)&&s(i,d);const h=i.children.length;for(let b=0;b0)&&(i=l,r=a)}return r}function JD(i,e=0,t,n=0){return e!=n?n-e:i.distance-t.distance}const or=new jC,PD=new Le,Xl=[];function OD(i,e,t,n,s,o,r,g){if(r!=null)return QD(i,e,r);let a,l;if(Sp(t,n,s,o,(I,u)=>{let d=0;const A=((a==null?void 0:a.details.lineIndex)??e.length-2)+2;for(let h=1;h0;n--){const s=e[n-1],o=e[n];if(Bb.origin.copy(s).applyMatrix4(i),Bb.direction.copy(o).applyMatrix4(i).sub(or.ray.origin).normalize(),Bb.intersectPlane(t,OR)!=null)return OR.clone()}}const vb=new jC,Zb=new X,QR=new Fs,qD=new Le,bA=[];function $D(i,e,t,n,s,o,r,g,a){if(g!=null)return eJ(i,e,t,g);let l,I;if(vb.ray.origin.copy(i),vb.ray.direction.copy(t).applyQuaternion(e),Sp(n,s,o,r,(u,d)=>{u.raycast(vb,bA);const A=IB(l,I,bA,d,a);A!=null&&(l=bA[A],I=d),bA.length=0}),l!=null)return Object.assign(l,{details:{type:"ray"},pointerPosition:i.clone(),pointerQuaternion:e.clone(),pointOnFace:l.point,localPoint:l.point.clone().applyMatrix4(qD.copy(l.object.matrixWorld).invert())})}const jR=new Vr;function eJ(i,e,t,{intersection:n,object:s}){if(n.details.type!="ray")return;Zb.copy(t).applyQuaternion(e),jR.set(i,Zb),cB(QR,n,s);const o=jR.intersectPlane(QR,new X)??n.point;return{...n,object:s,pointOnFace:o,point:Zb.clone().multiplyScalar(n.distance).add(i),pointerPosition:i.clone(),pointerQuaternion:e.clone()}}const wb=new Kn,GA=[];function eH(i,e,t,n,s,o,r,g,a){if(g!=null)return iJ(i,e,g);let l,I;if(wb.center.copy(i),wb.radius=t,Sp(n,s,o,r,(u,d)=>{nJ(wb,u,GA);const A=IB(l,I,GA,d,a);A!=null&&(l=GA[A],I=d),GA.length=0}),l!=null)return Object.assign(l,{details:{type:"sphere"},pointOnFace:l.point,pointerPosition:i.clone(),pointerQuaternion:e.clone(),localPoint:l.point.clone().applyMatrix4(Sh.copy(l.object.matrixWorld).invert())})}const yA=new Le;function tJ(i){return"spherecast"in i}function nJ(i,e,t){if(e.updateWorldMatrix(!0,!1),tJ(e)){e.spherecast(i,t);return}if(e instanceof mr){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let s=0;si.radius*i.radius)return;Rb.max(sJ);const r=lc.center.clone().sub(nS);r.divide(Rb),oJ(r);const g=BA.clone();return{distance:Math.sqrt(o),face:{a:0,b:0,c:0,materialIndex:0,normal:r},normal:r,point:g,instanceId:n,object:e}}function oJ(i){const e=Math.abs(i.x),t=Math.abs(i.y),n=Math.abs(i.z);if(e>=t&&e>=n){i.set(i.x<0?-1:1,0,0);return}if(t>=e&&t>=n){i.set(0,i.y<0?-1:1,0);return}i.set(0,0,i.z<0?-1:1)}const mG={radius:.07};function rJ(i,e,t=mG,n="grab"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I!=null)return I.updateWorldMatrix(!0,!1),s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),eH(s,o,t.radius??mG.radius,g,r,n,e,l,t)},void 0,void 0,void 0,t)}const gJ=new X(0,0,-1),aJ=new X,YI={direction:gJ,minDistance:0,linePoints:null};function lJ(i,e,t=YI,n="ray"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I==null)return;I.updateWorldMatrix(!0,!1);let u;const d=t.linePoints??YI.linePoints;if(d==null?(s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),u=$D(s,o,t.direction??YI.direction,g,r,n,e,l,t)):u=OD(I.matrixWorld,d,g,r,n,e,l,t),!(u==null||u.distance*I.getWorldScale(aJ).x<(t.minDistance??YI.minDistance)))return u},void 0,void 0,void 0,t)}const cc={button:0,downRadius:.03,hoverRadius:.1};function cJ(i,e,t=cc,n="touch"){const s=new X,o=new Dt,r=CB();return new lB(r,n,e,(g,a,l)=>{const I=i.current;if(I!=null)return I.updateWorldMatrix(!0,!1),s.setFromMatrixPosition(I.matrixWorld),o.setFromRotationMatrix(I.matrixWorld),eH(s,o,t.hoverRadius??cc.hoverRadius,g,r,n,e,l,t)},IJ(t),void 0,void 0,t)}function IJ(i=cc){let e=!1;return t=>{if(!t.getEnabled())return;const n=t.getIntersection(),s=CJ(n,i.downRadius??cc.downRadius);if(s===e)return;const o={timeStamp:performance.now(),button:i.button??cc.button};s?t.down(o):t.up(o),e=s}}function CJ(i,e){return i==null?!1:i.distance<=e}let uJ=23412;function CB(){return uJ++}new X;new ce;let dJ=class{constructor(){yt(this,"pointers",[]);yt(this,"isDefaults",[]);yt(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var r,g;if(!this.enabled)return;const n=this.pointers.length;if(n===0)return;for(let a=0;a=i.lastChangedTime)return e;const t=new ut;return t.setIndex(new ct(i.indices,1)),t.setAttribute("position",new ct(i.vertices,3)),Object.assign(t,{creationTime:i.lastChangedTime})}function oS(i,e){return e!=null&&e.createdAt!=null&&e.createdAt>=i.lastChangedTime?e:Object.assign(AJ(i.polygon),{createdAt:i.lastChangedTime})}const WI=new VM,vA=new ce;function AJ(i){const e=new fr,t=i.map(({x:s,z:o})=>new ce(s,o));WI.setFromPoints(t),WI.getSize(vA);for(const s of t)s.sub(WI.min),s.divide(vA);e.setFromPoints(t);const n=new OC(e);return n.scale(vA.x,vA.y,1),n.translate(WI.min.x,WI.min.y,0),n.rotateX(Math.PI/2),n}new X;new X;new X;const xI=new Ki(0,0,0,"YXZ"),ZA=new Dt;function hJ(i,e,t){i.matrixWorld.decompose(e.position,ZA,e.scale),xI.setFromQuaternion(ZA),xI.z=0,xI.x=OA(xI.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),ZA.setFromEuler(xI),e.quaternion.slerp(ZA,t/100)}function pJ(i){return i.userData.teleportTarget===!0}function mJ(i={}){return e=>!(!pJ(e.object)||i.customFilter!=null&&!i.customFilter(e))}function fJ(){return new rp(new X(0,0,0),new X(0,0,-8),new X(0,-20,-15)).getPoints(20)}let bJ=class extends tn{constructor(t){const n=new ok,s=new Float32Array(t.length*3);for(let g=0;gg.distanceTo(t[a+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const s=t.getIntersection();if((s==null?void 0:s.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:o,lineIndex:r}=s.details,g=this.lineLengths[r];this.material.visibility=this.multiplier*(r+o/g)/this.lineLengths.length;const{color:a="white",opacity:l=.4,size:I=.01}=this.options;this.material.lineWidth=I,this.material.opacity=typeof l=="function"?l(t):l;const u=typeof a=="function"?a(t):a;Array.isArray(u)?this.material.color.set(...u):this.material.color.set(u)}};const wA=new Le,RA=new X,rS=new Dt;async function GJ(i,e,t=["point","plane","mesh"]){var a,l;let n,s,o;const r=i.getState();if(e instanceof XRSpace)s=e,o=r.origin;else{if(r.originReferenceSpace==null)return;o=e,s=wD(e,r.origin,r.originReferenceSpace,wA)??r.originReferenceSpace,s===r.originReferenceSpace&&DX(e,r.origin,wA),RA.setFromMatrixPosition(wA);const I={...RA};rS.setFromRotationMatrix(wA),RA.set(0,0,-1).applyQuaternion(rS);const u={...RA};n=new XRRay(I,u)}const g=await((l=(a=i.getState().session)==null?void 0:a.requestHitTestSource)==null?void 0:l.call(a,{space:s,entityTypes:Array.isArray(t)?t:[t],offsetRay:n}));if(g!=null)return{source:g,getWorldMatrix:yJ.bind(null,s,o)}}function yJ(i,e,t,n){const s=n.getPose(i);return s==null?!1:(t.fromArray(s.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new X(1,1,1);new X(0,0,0);new Le;new Le;new X;new X;const tH=new bU,nH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",BJ="generic-trigger";class vJ{constructor(e){yt(this,"baseAssetPath");yt(this,"defaultProfileId");yt(this,"profilesListPromise");yt(this,"profilePromisesMap",new Map);yt(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??nH,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??BJ}async load(e,t){const n=await this.loadProfile(e);for(const s in n.layouts)if(s.includes(t))return n.layouts[s];throw new Error(`No matching layout for "${t}", in profile ${n.profileId} with layouts ${Object.keys(n.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=gS(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,n=e.length;for(let o=0;oi.visibilityState)}function WJ(i,e){const t=E.useRef(e);t.current=e;const[n,s]=E.useMemo(()=>{let o;return[r=>{let g=!1;return navigator.xr==null?(o=!1,()=>{}):(navigator.xr.isSessionSupported(i).then(a=>{o=a,!g&&r()}).catch(a=>{var l;g||(l=t.current)==null||l.call(t,a)}),()=>g=!0)},()=>o]},[i]);return E.useSyncExternalStore(n,s)}E.forwardRef(({id:i,children:e,onPress:t,onRelease:n},s)=>{const o=uB(),[r,g]=E.useState(void 0);if(E.useImperativeHandle(s,()=>r,[r]),xJ(i,a=>a==="pressed"?t==null?void 0:t():n==null?void 0:n()),Wn(()=>{var a;return g((a=o.gamepad[i])==null?void 0:a.object)}),r!=null)return eB(e,r)});function xJ(i,e,t){const n=uB(),s=E.useRef();Wn(()=>{var r;const o=(r=n==null?void 0:n.gamepad[i])==null?void 0:r.state;o!=null&&o!=s.current&&e(o),s.current=o})}function uB(i){const e=E.useContext(_o);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const VJ=Symbol("loadXRControllerModel"),MJ=E.forwardRef((i,e)=>{const t=uB(),n=qy(YD,[t.layout,void 0,VJ]);KD(n,i),t.object=n,E.useImperativeHandle(e,()=>n,[n]);const s=E.useMemo(()=>LD(n,t.layout,t.gamepad),[n,t.layout,t.gamepad]);return Wn(s),D.jsx("primitive",{object:n})});function dB(i){const e=E.useContext(_o);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const XJ=Symbol("loadXRHandModel"),HJ=E.forwardRef((i,e)=>{const t=dB(),n=qy(gD,[t.assetPath,void 0,XJ]);aD(n,i),E.useImperativeHandle(e,()=>n,[n]);const s=iP(),o=E.useMemo(()=>CD(t.inputSource.hand,n,s),[t.inputSource,n,s]);return Wn((r,g,a)=>o(a)),D.jsx("primitive",{object:n})});E.forwardRef(({joint:i,children:e},t)=>{const n=dB();return D.jsx(Ds,{ref:t,space:n.inputSource.hand.get(i),children:e})});function gH({children:i}){const e=E.useMemo(()=>new dJ,[]);return lH(e),Wn(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),D.jsx(rH.Provider,{value:e,children:i})}function FJ(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,mG,t);const o=E.useMemo(()=>rJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}function aH(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,YI,t);const o=E.useMemo(()=>lJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}function NJ(i,e,t,n){const s=E.useMemo(()=>({}),[]);Object.assign(s,cc,t);const o=E.useMemo(()=>cJ(i,e,s,n),[i,e,s,n]);return hB(o,t==null?void 0:t.makeDefault),o}const YJ=E.forwardRef((i,e)=>{const t=E.useMemo(()=>new bD,[]),n=E.useRef(null);return E.useImperativeHandle(e,()=>n.current,[]),Wn(()=>n.current!=null&&GD(n.current,t,i.pointer,i)),D.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:i.renderOrder??2,ref:n,material:t,children:D.jsx("boxGeometry",{})})}),Wp=E.forwardRef((i,e)=>{const t=E.useMemo(()=>new pD,[]),n=E.useRef(null);E.useImperativeHandle(e,()=>n.current,[]),Wn(()=>n.current!=null&&fD(n.current,t,i.pointer,i));const s=Gi(o=>o.scene);return eB(D.jsx("mesh",{renderOrder:i.renderOrder??1,ref:n,matrixAutoUpdate:!1,material:t,children:D.jsx("planeGeometry",{})}),s)});function AB(i,e,t,n){const s=Sn(o=>o.session);E.useEffect(()=>{if(s!=null)return yD(i,s,e,t,n)},[t,e,i,s,n])}function hB(i,e=!1){const t=E.useContext(rH);t==null?(lH(i),Wn(n=>i.move(n.scene,{timeStamp:performance.now()}),-50)):E.useEffect(()=>t.register(i,e),[t,i,e]),E.useEffect(()=>()=>i.exit({timeStamp:performance.now()}),[i])}function lH(i){const e=pB();E.useEffect(()=>hD(e,t=>i.setEnabled(t,{timeStamp:performance.now()})),[e,i])}const KJ=E.forwardRef(({pointer:i,linePoints:e,...t},n)=>{const s=E.useMemo(()=>new bJ(e),[e]);return E.useImperativeHandle(n,()=>s,[s]),s.options=t,Wn(()=>s.update(i)),D.jsx("primitive",{object:s})});function cH(i,e,t){const n=E.useContext(_o);if(n==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const s=E.useRef(null),o=FJ(s,n,t);AB(o,n.inputSource,i,n.events);const r=t.cursorModel;return D.jsx(Ds,{ref:s,space:e(n.inputSource),children:r!==!1&&D.jsx(Wp,{pointer:o,opacity:BD,...ii(r)})})}const LJ=cH.bind(null,"select",i=>i.hand.get("index-finger-tip")),zJ=cH.bind(null,"squeeze",i=>i.gripSpace);function iu(i){const e=E.useContext(_o);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=E.useRef(null),n=aH(t,e,i);AB(n,e.inputSource,"select",e.events);const s=i.rayModel,o=i.cursorModel;return D.jsxs(Ds,{ref:t,space:e.inputSource.targetRaySpace,children:[s!==!1&&D.jsx(YJ,{pointer:n,opacity:Rh,...ii(s)}),o!==!1&&D.jsx(Wp,{pointer:n,opacity:Rh,...ii(o)})]})}function TJ(i){const e=dB(),t=E.useRef(null),n=NJ(t,e,i),s=i.cursorModel;return D.jsx(Ds,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:s!==!1&&D.jsx(Wp,{pointer:n,opacity:vD,...ii(s)})})}function EJ(i){const e=i.model,t=i.grabPointer,n=i.rayPointer,s=i.teleportPointer??!1;return D.jsxs(D.Fragment,{children:[e!==!1&&D.jsx(E.Suspense,{children:D.jsx(MJ,{...ii(e)})}),D.jsxs(gH,{children:[t!==!1&&D.jsx(zJ,{...ii(t)}),n!==!1&&D.jsx(iu,{makeDefault:!0,minDistance:.2,...ii(n)}),s!==!1&&D.jsx(IH,{...ii(s)})]})]})}function kJ(i){var g;const e=i.model,t=i.grabPointer,n=i.rayPointer,s=i.touchPointer,o=i.teleportPointer??!1,r=n===!1?!1:(g=ii(n))==null?void 0:g.rayModel;return D.jsxs(D.Fragment,{children:[e!==!1&&D.jsx(E.Suspense,{children:D.jsx(HJ,{...ii(e)})}),D.jsxs(gH,{children:[t!==!1&&D.jsx(LJ,{...ii(t)}),s!==!1&&D.jsx(TJ,{...ii(s)}),n!==!1&&D.jsx(iu,{makeDefault:!0,minDistance:.2,...ii(n),rayModel:r===!1?!1:{maxLength:.2,...ii(r)}}),o!==!1&&D.jsx(IH,{...ii(o)})]})]})}function _J(i){return D.jsx(iu,{...i,rayModel:!1})}function UJ(i){return D.jsx(iu,{...i,rayModel:!1})}function DJ(i){return D.jsx(iu,{...i,cursorModel:!1,rayModel:!1})}function IH(i){const e=E.useContext(_o);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=E.useRef(null),n=E.useRef(null),s=E.useMemo(()=>fJ(),[]),o=aH(n,e,{...i,linePoints:s,customFilter:mJ(i)},"teleport");AB(o,e.inputSource,"select",e.events);const r=i.rayModel,g=i.cursorModel,a=Gi(I=>I.scene),l=E.useRef(null);return Wn((I,u)=>{l.current!=null&&(l.current.visible=o.getEnabled()&&o.getButtonsDown().size>0);const d=n.current,A=t.current;d==null||A==null||hJ(A,d,u*1e3)}),D.jsxs(D.Fragment,{children:[D.jsx(Ds,{ref:t,space:e.inputSource.targetRaySpace}),eB(D.jsxs("group",{ref:n,children:[r!==!1&&D.jsx(KJ,{linePoints:s,pointer:o,opacity:Rh,...ii(r)}),g!==!1&&D.jsx(Wp,{ref:l,pointer:o,opacity:Rh,...ii(g)})]}),a)]})}function ii(i){if(i!==!0)return i}function JJ({children:i}){const e=Sn(r=>r.originReferenceSpace),t=Sn(r=>r.origin),n=SJ()==="visible",s=$C(),o=E.useMemo(()=>Object.assign({},s,{getState(){return{...s.getState(),scene:t}}}),[t,s]);return t==null||e==null?null:D.jsx(D.Fragment,{children:yc.createPortal(D.jsx(Bp.Provider,{value:s,children:D.jsxs(nu.Provider,{value:e,children:[D.jsxs("group",{matrixAutoUpdate:!1,visible:n,children:[D.jsx(PJ,{}),D.jsx(OJ,{}),D.jsx(QJ,{}),D.jsx(jJ,{}),D.jsx(qJ,{})]}),D.jsx($J,{}),D.jsx(eP,{}),i]})}),o,null)})}function PJ(){const i=Sn(t=>t.controllerStates);let e=Sn(t=>t.controller);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.gripSpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(EJ,{...n})})})},Ua(t))})})}function OJ(){const i=Sn(t=>t.handStates),e=Sn(t=>t.hand);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.hand.get("wrist"),children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(kJ,{...n})})})},Ua(t))})})}function QJ(){const i=Sn(t=>t.transientPointerStates),e=Sn(t=>t.transientPointer);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>{const n=og(e,t.inputSource.handedness,{});return n===!1?null:D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof n=="function"?D.jsx(n,{}):D.jsx(_J,{...n})})})},Ua(t))})})}function jJ(){const i=Sn(t=>t.gazeStates),e=Sn(t=>t.gaze);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof e=="function"?D.jsx(e,{}):D.jsx(UJ,{...CH(e)})})})},Ua(t)))})}function qJ(){const i=Sn(t=>t.screenInputStates),e=Sn(t=>t.screenInput);return e===!1?null:D.jsx(D.Fragment,{children:i.map(t=>D.jsx(Ds,{space:t.inputSource.targetRaySpace,children:D.jsx(_o.Provider,{value:t,children:D.jsx(E.Suspense,{children:typeof e=="function"?D.jsx(e,{}):D.jsx(DJ,{...CH(e)})})})},Ua(t)))})}function CH(i){if(i!==!0)return i}function $J(){const i=Sn(t=>t.detectedMeshes),e=Sn(t=>t.detectedMesh);if(e!==!1)return D.jsx(D.Fragment,{children:i.map(t=>{const n=PX(e,t.semanticLabel,!1);return n===!1?null:D.jsx(Ds,{space:t.meshSpace,children:D.jsx(sH.Provider,{value:t,children:D.jsx(E.Suspense,{children:D.jsx(n,{})})})},Ua(t))})})}function eP(){const i=Sn(t=>t.detectedPlanes),e=Sn(t=>t.detectedPlane);if(e!=null)return D.jsx(D.Fragment,{children:i.map(t=>{const n=PX(e,t.semanticLabel,!1);return n===!1?null:D.jsx(Ds,{space:t.planeSpace,children:D.jsx(oH.Provider,{value:t,children:D.jsx(E.Suspense,{children:D.jsx(n,{})})})},Ua(t))})})}function tP(i){return WD(i)}function nP({children:i,store:e}){e.setWebXRManager(Gi(n=>n.gl.xr));const t=$C();return E.useEffect(()=>{let n;return e.subscribe((s,o)=>{const r=s.mode!=null,g=o.mode!=null;if(r!==g){if(r){const{camera:a,gl:l}=t.getState();n=a,t.setState({camera:l.xr.getCamera()});return}n!=null&&t.setState({camera:n})}})},[t,e]),Wn((n,s,o)=>e.onBeforeFrame(n.scene,n.camera,o),-1e3),D.jsxs(iH.Provider,{value:e,children:[D.jsx(JJ,{}),i]})}function pB(){const i=E.useContext(iH);if(i==null)throw new Error("XR features can only be used inside the component");return i}function Sn(i=e=>e){return iB(pB(),i)}const Ds=E.forwardRef(({space:i,children:e},t)=>{const n=E.useRef(null);return E.useImperativeHandle(t,()=>n.current,[]),oP(n,i,(s,o,r)=>{n.current!=null&&(n.current.visible=r!=null)}),D.jsx("group",{xrSpace:i,visible:!1,matrixAutoUpdate:!1,ref:n,children:D.jsx(nu.Provider,{value:i,children:e})})});function iP(){const i=E.useContext(nu);if(i==null)throw new Error("XR objects must be placed inside the XROrigin");return i}function sP(i){const e=E.useContext(nu),t=Sn(n=>e??n.originReferenceSpace);return E.useMemo(()=>t==null?void 0:ZD(i,t),[i,t])}function oP(i,e,t){const n=sP(e);Wn((s,o,r)=>{i.current==null||n==null||(n(i.current.matrix,r),t==null||t(s,o,r))},-100)}E.forwardRef((i,e)=>{const t=rP(),n=gP(t);return D.jsx("mesh",{ref:e,geometry:n,...i})});function rP(){const i=E.useContext(sH);if(i==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return i}function gP(i,e=!0){const[t,n]=E.useState(sS(i,void 0));return Wn(()=>n(s=>sS(i,s))),E.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}E.forwardRef((i,e)=>{const t=aP(),n=lP(t);return D.jsx("mesh",{ref:e,geometry:n,...i})});function aP(){const i=E.useContext(oH);if(i==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return i}function lP(i,e=!0){const[t,n]=E.useState(oS(i,void 0));return Wn(()=>n(s=>oS(i,s))),E.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const cP=E.forwardRef(({children:i,...e},t)=>{const n=Gi(o=>o.gl.xr.getCamera()),s=Sn(o=>o.originReferenceSpace);return s==null?null:D.jsxs("group",{ref:t,...e,children:[D.jsx("primitive",{object:n}),D.jsx(nu.Provider,{value:s,children:i})]})});function IP(i,e,t){const n=E.useRef(void 0);CP(e,t,E.useCallback(s=>n.current=s,[])),Wn((s,o,r)=>{i==null||r==null||n.current==null||i(r.getHitTestResults(n.current.source),n.current.getWorldMatrix)})}function CP(i,e,t){const n=pB();E.useEffect(()=>{let s,o=!1;const r=i instanceof XRSpace?i:i.current;if(r!=null)return GJ(n,r,e).then(g=>{o||(s=g,t(g))}),()=>{t(void 0),o=!0,s==null||s.source.cancel()}},[n,i,e,t])}E.forwardRef((i,e)=>{const t=E.useRef(null);return E.useImperativeHandle(e,()=>t.current),IP(i.onResults,t,i.trackableType),D.jsx("group",{...i,ref:t})});E.forwardRef((i,e)=>{const t=Sn(o=>o.domOverlayRoot),{In:n,Out:s}=E.useMemo(Uk,[]);return E.useEffect(()=>{const o=uy(t);return o.render(D.jsx(s,{})),()=>o.unmount()},[t,s]),D.jsx(n,{children:D.jsx("div",{...i,ref:e})})});const uH=E.forwardRef(({store:i,mode:e,onError:t,children:n,...s},o)=>{const r=iB(i,a=>a.session),g=WJ(e,t);return D.jsx("button",{ref:o,...s,onClick:()=>r!=null?r.end():i.enterXR(e).catch(t),children:typeof n=="function"?n(g?r!=null?"entered":"exited":"unsupported"):n})});E.forwardRef((i,e)=>D.jsx(uH,{ref:e,mode:"immersive-ar",...i}));E.forwardRef((i,e)=>D.jsx(uH,{ref:e,mode:"immersive-vr",...i}));const uP={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:i=>i.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:i=>i.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:i=>i.pointerType==="ray"},onSqueeze:{type:"click",filter:i=>i.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:i=>i.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:i=>i.pointerType==="grab"}};function sr(i,e,t){const n=E.useRef(t);n.current=t,E.useEffect(()=>{const{current:s}=i;if(s==null)return;const o=uP[e],r=typeof o=="string"?a=>{var l;return(l=n.current)==null?void 0:l.call(n,{intersection:a,intersections:[a],target:a.pointerState})}:a=>{var l;a instanceof xi&&!o.filter(a)||(l=n.current)==null||l.call(n,{intersection:a,intersections:[a],target:a.pointerState})},g=typeof o=="string"?o:o.type;return s.addEventListener(g,r),()=>s.removeEventListener(g,r)},[i,e])}const dP=E.forwardRef(({onHover:i,onBlur:e,onSelectStart:t,onSelectEnd:n,onSelect:s,onSqueezeStart:o,onSqueezeEnd:r,onSqueeze:g,onMove:a,children:l},I)=>{const u=E.useRef(null);return E.useImperativeHandle(I,()=>u.current),sr(u,"onHover",i),sr(u,"onBlur",e),sr(u,"onSelectStart",t),sr(u,"onSelectEnd",n),sr(u,"onSelect",s),sr(u,"onSqueezeStart",o),sr(u,"onSqueezeEnd",r),sr(u,"onSqueeze",g),sr(u,"onMove",a),D.jsx("group",{ref:u,children:l})});E.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:n,...s},o){const r=E.useRef(),g=E.useRef(null),a=E.useMemo(()=>new Le,[]);return E.useImperativeHandle(o,()=>g.current),Wn(()=>{const l=r.current,I=g.current;!I||!l||(I.applyMatrix4(a),I.applyMatrix4(l.matrixWorld),I.updateMatrixWorld(),a.copy(l.matrixWorld).invert())}),D.jsx(dP,{ref:g,onSelectStart:l=>{uD(l.target)&&(l.target.type==="controller"||l.target.type==="hand")&&l.target.object!=null&&(r.current=l.target.object,a.copy(l.target.object.matrixWorld).invert(),e==null||e(l))},onSelectEnd:l=>{l.target.controller===r.current&&(r.current=void 0),t==null||t(l)},...s,children:n})});const lS=tP({hand:{touchPointer:!1}});function AP(){return D.jsxs(D.Fragment,{children:[D.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>lS.enterVR(),children:"Enter VR"}),D.jsxs(cE,{dpr:[1,2],shadows:!0,camera:{position:[-40,40,40],fov:25,near:1,far:100},children:[D.jsx(Ik,{}),D.jsxs(nP,{store:lS,children:[D.jsx("color",{attach:"background",args:["#171720"]}),D.jsx("fog",{attach:"fog",args:["#171720",60,90]}),D.jsx("ambientLight",{intensity:.2}),D.jsx("pointLight",{position:[-20,-5,-20],color:"red"}),D.jsx(E.Suspense,{children:D.jsxs(lU,{allowSleep:!1,iterations:15,gravity:[0,-200,0],children:[D.jsx(cU,{}),D.jsx(dU,{rotation:[-Math.PI/3,0,0]}),D.jsx(hP,{position:[0,-5,0],rotation:[-Math.PI/2,0,0]}),D.jsx(AU,{position:[0,0,-2.52]}),D.jsx(pU,{position:[8,0,0]}),D.jsx(hU,{position:[8,3,0]}),D.jsx(mU,{position:[0,15,0]})]})}),D.jsx("group",{position:[0,-5,0],children:D.jsx(cP,{scale:10})})]})]})]})}function hP(i){const[e]=$_(()=>({type:"Static",...i}));return D.jsxs("mesh",{ref:e,receiveShadow:!0,children:[D.jsx("planeGeometry",{args:[100,100]}),D.jsx("meshPhongMaterial",{color:"#878790",blur:[400,400],resolution:1024,mixBlur:1,mixStrength:3,depthScale:1,minDepthThreshold:.85,metalness:0,roughness:1})]})}uy(document.getElementById("root")).render(D.jsx(E.StrictMode,{children:D.jsx(AP,{})}));export{wg as B,La as C,Ns as D,Ki as E,Pe as F,Ls as G,gi as L,Le as M,wt as O,Ka as P,Dt as Q,jC as R,QC as S,hp as T,X as V,DV as W,Yn as a,ut as b,tn as c,PC as d,To as e,yh as f,Wh as g,cn as h,dp as i,D as j,uo as k,uy as l,qI as o,E as r}; diff --git a/examples/rag-doll/index.html b/examples/rag-doll/index.html index 5759c0d..5073728 100644 --- a/examples/rag-doll/index.html +++ b/examples/rag-doll/index.html @@ -4,7 +4,7 @@ Document - +
diff --git a/examples/room-with-shadows/assets/emulate-B3Stf41o.js b/examples/room-with-shadows/assets/emulate-NBfH5vpj.js similarity index 99% rename from examples/room-with-shadows/assets/emulate-B3Stf41o.js rename to examples/room-with-shadows/assets/emulate-NBfH5vpj.js index 4fbf3d7..c872c51 100644 --- a/examples/room-with-shadows/assets/emulate-B3Stf41o.js +++ b/examples/room-with-shadows/assets/emulate-NBfH5vpj.js @@ -1,4 +1,4 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-JGd9r4Iq.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-BNyAlFAk.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; diff --git a/examples/room-with-shadows/assets/index-JGd9r4Iq.js b/examples/room-with-shadows/assets/index-BNyAlFAk.js similarity index 99% rename from examples/room-with-shadows/assets/index-JGd9r4Iq.js rename to examples/room-with-shadows/assets/index-BNyAlFAk.js index 3942f4b..7eff4f3 100644 --- a/examples/room-with-shadows/assets/index-JGd9r4Iq.js +++ b/examples/room-with-shadows/assets/index-BNyAlFAk.js @@ -4300,4 +4300,4 @@ return PCSS(shadowMap, shadowCoord); `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),e.fragmentShader=`varying float vFade; `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function S8(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function M8(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,u=`${i}end`,f=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(u,a)}}function E8(n){var e;return n.getButtonsDown().size>0?.6:GL(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Rg(n){return n.getButtonsDown().size>0?.6:.4}function w8(n){var e;return GL(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function GL(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function T8(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function VL(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function C8(n,e,t,i){i==null||i.copy(n.matrix);const r=WL(n,i);return r!=null||e==null||t==null?r:(i!=null&&VL(n,e,i),t)}function WL({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??WL(n,e)}function R8(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:u=!1,hitTest:f=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Vs(t,"anchors",m,y),Vs(i,"hand-tracking",m,y),Vs(r,"layers",m,y),Vs(s,"mesh-detection",m,y),Vs(o,"plane-detection",m,y),Vs(u,"depth-sensing",m,y),Vs(p,"dom-overlay",m,y),Vs(f,"hit-test",m,y),n!="immersive-vr"&&Vs(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Vs(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function Wo(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&b8(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function b8(n,e){return e in n}function XL(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const jL={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function uR(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?H9(()=>import("./emulate-B3Stf41o.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n)})}function P8(n){const e="metaQuest3";let t;{window.location.hostname==="localhost"&&uR(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&uR(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=BL(()=>({...jL,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=g8({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=D8(r,o),l=L8(n==null?void 0:n.enterGrantedSession,p=>ym(i,p,n,d));let u;const f=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>f.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}={};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),u==null||u(),u=B8(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&JL(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({hand:x})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({controller:x})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({transientPointer:x})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({detectedPlane:x})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({detectedMesh:x})},destroy(){t==null||t(),s==null||s(),u==null||u(),l==null||l(),a(void 0,void 0)},enterXR:p=>ym(i,p,n,d),enterAR:()=>ym(i,"immersive-ar",n,d),enterVR:()=>ym(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:x}=r.getState(),_=m.parent??p,g=(d==null?void 0:d.getReferenceSpace())??void 0;x!=_&&(_.xrSpace=g,r.setState({origin:_}));const{originReferenceSpace:A}=r.getState();if(g!=A&&(_.xrSpace=g,r.setState({originReferenceSpace:g})),y==null)return;d!=null&&O8(r,y,d);const M=f.length;for(let E=0;E component?"));const r=await navigator.xr.requestSession(e,R8(e,n,t));return JL(r,"high"),I8(i,r),r}function I8(n,e,t){n!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(e),n==null||n.setSession(e))}const hR=["immersive-ar","immersive-vr","inline"];function B8(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function L8(n=hR,e){var i;if(n===!1)return;n===!0&&(n=hR);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function D8(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(jL)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function O8(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const u=fR(s,e.detectedPlanes),f=fR(r,e.detectedMeshes);(s!=u||r!=f)&&n.setState({detectedPlanes:u,detectedMeshes:f});const d=a.length;for(let m=0;m{t instanceof Kt&&t.material instanceof rn&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function z8(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>H8(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=G8(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function G8(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?dR(n).x:.5;case"yAxis":return i?dR(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const Th=new le;function dR({xAxis:n=0,yAxis:e=0}){if(Th.lengthSq()>1){const i=Math.atan2(e,n);Th.set(Math.cos(i),Math.sin(i))}else Th.set(n,e);return Th.multiplyScalar(.5).addScalar(.5),Th}function V8({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function W8({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[X8[t]];if(i!=null)return[i]}const X8={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};let ir=class KL{constructor(e,t,i,r,s,o=s.object,a=o){St(this,"type");St(this,"bubbles");St(this,"nativeEvent");St(this,"pointer");St(this,"intersection");St(this,"currentObject");St(this,"object");St(this,"stopPropagation");St(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new KL(t,i,r,s,o,e,a)}};class aM extends ir{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new aM(r,s,o,e,a)}}function wr(n){YL(n,n.currentObject)}function YL(n,e){if(e==null)return;const t=W8(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];wr(new ir("pointerenter",!1,e,this,i,l))}if(i!=null&&wr(new ir("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}wr(new ir("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&wr(new ir("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&wr(new aM(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function ZL(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),ZL(n.parent,e,t,i)}function j8(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function uM(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function J8(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function w0(n,e,t,i,r,s=!1,o,a,l){const u=s||V8(n),f=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;J8(u,f??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let x=0;x0)&&(n=u,o=l)}return o}function K8(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Xs=new Mu,Y8=new Fe,Mc=[];function Q8(n,e,t,i,r,s,o,a){if(o!=null)return Z8(n,e,o);let l,u;if(w0(t,i,r,s,(f,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(M_.origin.copy(r).applyMatrix4(n),M_.direction.copy(s).applyMatrix4(n).sub(Xs.ray.origin).normalize(),M_.intersectPlane(t,mR)!=null)return mR.clone()}}const E_=new Mu,w_=new L,gR=new $r,$8=new Fe,_m=[];function e6(n,e,t,i,r,s,o,a,l){if(a!=null)return t6(n,e,t,a);let u,f;if(E_.ray.origin.copy(n),E_.ray.direction.copy(t).applyQuaternion(e),w0(i,r,s,o,(d,p)=>{d.raycast(E_,_m);const m=hM(u,f,_m,p,l);m!=null&&(u=_m[m],f=p),_m.length=0}),u!=null)return Object.assign(u,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:u.point,localPoint:u.point.clone().applyMatrix4($8.copy(u.object.matrixWorld).invert())})}const vR=new fa;function t6(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;w_.copy(t).applyQuaternion(e),vR.set(n,w_),uM(gR,i,r);const s=vR.intersectPlane(gR,new L)??i.point;return{...i,object:r,pointOnFace:s,point:w_.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const T_=new Tn,xm=[];function qL(n,e,t,i,r,s,o,a,l){if(a!=null)return r6(n,e,a);let u,f;if(T_.center.copy(n),T_.radius=t,w0(i,r,s,o,(d,p)=>{i6(T_,d,xm);const m=hM(u,f,xm,p,l);m!=null&&(u=xm[m],f=p),xm.length=0}),u!=null)return Object.assign(u,{details:{type:"sphere"},pointOnFace:u.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:u.point.clone().applyMatrix4(bg.copy(u.object.matrixWorld).invert())})}const Am=new Fe;function n6(n){return"spherecast"in n}function i6(n,e,t){if(e.updateWorldMatrix(!0,!1),n6(e)){e.spherecast(n,t);return}if(e instanceof jf){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;C_.max(s6);const o=qc.center.clone().sub(SR);o.divide(C_),o6(o);const a=Sm.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function o6(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const yA={radius:.07};function a6(n,e,t=yA,i="grab"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f!=null)return f.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),qL(r,s,t.radius??yA.radius,a,o,i,e,u,t)},void 0,void 0,void 0,t)}const l6=new L(0,0,-1),c6=new L,Fh={direction:l6,minDistance:0,linePoints:null};function u6(n,e,t=Fh,i="ray"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f==null)return;f.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Fh.linePoints;if(p==null?(r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),d=e6(r,s,t.direction??Fh.direction,a,o,i,e,u,t)):d=Q8(f.matrixWorld,p,a,o,i,e,u,t),!(d==null||d.distance*f.getWorldScale(c6).x<(t.minDistance??Fh.minDistance)))return d},void 0,void 0,void 0,t)}const $c={button:0,downRadius:.03,hoverRadius:.1};function h6(n,e,t=$c,i="touch"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f!=null)return f.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),qL(r,s,t.hoverRadius??$c.hoverRadius,a,o,i,e,u,t)},f6(t),void 0,void 0,t)}function f6(n=$c){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=d6(i,n.downRadius??$c.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??$c.button};r?t.down(s):t.up(s),e=r}}function d6(n,e){return n==null?!1:n.distance<=e}let p6=23412;function fM(){return p6++}new L;new le;let m6=class{constructor(){St(this,"pointers",[]);St(this,"isDefaults",[]);St(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new ot;return t.setIndex(new st(n.indices,1)),t.setAttribute("position",new st(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function wR(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(g6(n.polygon),{createdAt:n.lastChangedTime})}const Rh=new YB,Mm=new le;function g6(n){const e=new ia,t=n.map(({x:r,z:s})=>new le(r,s));Rh.setFromPoints(t),Rh.getSize(Mm);for(const r of t)r.sub(Rh.min),r.divide(Mm);e.setFromPoints(t);const i=new Qf(e);return i.scale(Mm.x,Mm.y,1),i.translate(Rh.min.x,Rh.min.y,0),i.rotateX(Math.PI/2),i}new L;new L;new L;const bh=new Bi(0,0,0,"YXZ"),Em=new Ot;function v6(n,e,t){n.matrixWorld.decompose(e.position,Em,e.scale),bh.setFromQuaternion(Em),bh.z=0,bh.x=Km(bh.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),Em.setFromEuler(bh),e.quaternion.slerp(Em,t/100)}function y6(n){return n.userData.teleportTarget===!0}function _6(n={}){return e=>!(!y6(e.object)||n.customFilter!=null&&!n.customFilter(e))}function x6(){return new o0(new L(0,0,0),new L(0,0,-8),new L(0,-20,-15)).getPoints(20)}let A6=class extends Kt{constructor(t){const i=new b9,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:u=.4,size:f=.01}=this.options;this.material.lineWidth=f,this.material.opacity=typeof u=="function"?u(t):u;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const wm=new Fe,Tm=new L,TR=new Ot;async function S6(n,e,t=["point","plane","mesh"]){var l,u;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=C8(e,o.origin,o.originReferenceSpace,wm)??o.originReferenceSpace,r===o.originReferenceSpace&&VL(e,o.origin,wm),Tm.setFromMatrixPosition(wm);const f={...Tm};TR.setFromRotationMatrix(wm),Tm.set(0,0,-1).applyQuaternion(TR);const d={...Tm};i=new XRRay(f,d)}const a=await((u=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:u.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:M6.bind(null,r,s)}}function M6(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new L(1,1,1);new L(1,1,1);new Fe;new Fe;new L;new L;const $L=new A5,e2="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",E6="generic-trigger";class w6{constructor(e){St(this,"baseAssetPath");St(this,"defaultProfileId");St(this,"profilesListPromise");St(this,"profilePromisesMap",new Map);St(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??e2,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??E6}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=CR(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;sn.visibilityState)}function P6(n,e){const t=H.useRef(e);t.current=e;const[i,r]=H.useMemo(()=>{let s;return[o=>{let a=!1;return navigator.xr==null?(s=!1,()=>{}):(navigator.xr.isSessionSupported(n).then(l=>{s=l,!a&&o()}).catch(l=>{var u;a||(u=t.current)==null||u.call(t,l)}),()=>a=!0)},()=>s]},[n]);return H.useSyncExternalStore(i,r)}H.forwardRef(({id:n,children:e,onPress:t,onRelease:i},r)=>{const s=dM(),[o,a]=H.useState(void 0);if(H.useImperativeHandle(r,()=>o,[o]),I6(n,l=>l==="pressed"?t==null?void 0:t():i==null?void 0:i()),Wn(()=>{var l;return a((l=s.gamepad[n])==null?void 0:l.object)}),o!=null)return nM(e,o)});function I6(n,e,t){const i=dM(),r=H.useRef();Wn(()=>{var o;const s=(o=i==null?void 0:i.gamepad[n])==null?void 0:o.state;s!=null&&s!=r.current&&e(s),r.current=s})}function dM(n){const e=H.useContext(bs);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const B6=Symbol("loadXRControllerModel"),L6=H.forwardRef((n,e)=>{const t=dM(),i=eM(U8,[t.layout,void 0,B6]);k8(i,n),t.object=i,H.useImperativeHandle(e,()=>i,[i]);const r=H.useMemo(()=>z8(i,t.layout,t.gamepad),[i,t.layout,t.gamepad]);return Wn(r),X.jsx("primitive",{object:i})});function pM(n){const e=H.useContext(bs);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const D6=Symbol("loadXRHandModel"),O6=H.forwardRef((n,e)=>{const t=pM(),i=eM(l8,[t.assetPath,void 0,D6]);c8(i,n),H.useImperativeHandle(e,()=>i,[i]);const r=rW(),s=H.useMemo(()=>d8(t.inputSource.hand,i,r),[t.inputSource,i,r]);return Wn((o,a,l)=>s(l)),X.jsx("primitive",{object:i})});H.forwardRef(({joint:n,children:e},t)=>{const i=pM();return X.jsx(Ur,{ref:t,space:i.inputSource.hand.get(n),children:e})});function s2({children:n}){const e=H.useMemo(()=>new m6,[]);return a2(e),Wn(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),X.jsx(r2.Provider,{value:e,children:n})}function F6(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,yA,t);const s=H.useMemo(()=>a6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}function o2(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,Fh,t);const s=H.useMemo(()=>u6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}function N6(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,$c,t);const s=H.useMemo(()=>h6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}const U6=H.forwardRef((n,e)=>{const t=H.useMemo(()=>new A8,[]),i=H.useRef(null);return H.useImperativeHandle(e,()=>i.current,[]),Wn(()=>i.current!=null&&S8(i.current,t,n.pointer,n)),X.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:n.renderOrder??2,ref:i,material:t,children:X.jsx("boxGeometry",{})})}),T0=H.forwardRef((n,e)=>{const t=H.useMemo(()=>new y8,[]),i=H.useRef(null);H.useImperativeHandle(e,()=>i.current,[]),Wn(()=>i.current!=null&&x8(i.current,t,n.pointer,n));const r=bi(s=>s.scene);return nM(X.jsx("mesh",{renderOrder:n.renderOrder??1,ref:i,matrixAutoUpdate:!1,material:t,children:X.jsx("planeGeometry",{})}),r)});function mM(n,e,t,i){const r=Cn(s=>s.session);H.useEffect(()=>{if(r!=null)return M8(n,r,e,t,i)},[t,e,n,r,i])}function gM(n,e=!1){const t=H.useContext(r2);t==null?(a2(n),Wn(i=>n.move(i.scene,{timeStamp:performance.now()}),-50)):H.useEffect(()=>t.register(n,e),[t,n,e]),H.useEffect(()=>()=>n.exit({timeStamp:performance.now()}),[n])}function a2(n){const e=vM();H.useEffect(()=>v8(e,t=>n.setEnabled(t,{timeStamp:performance.now()})),[e,n])}const k6=H.forwardRef(({pointer:n,linePoints:e,...t},i)=>{const r=H.useMemo(()=>new A6(e),[e]);return H.useImperativeHandle(i,()=>r,[r]),r.options=t,Wn(()=>r.update(n)),X.jsx("primitive",{object:r})});function l2(n,e,t){const i=H.useContext(bs);if(i==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const r=H.useRef(null),s=F6(r,i,t);mM(s,i.inputSource,n,i.events);const o=t.cursorModel;return X.jsx(Ur,{ref:r,space:e(i.inputSource),children:o!==!1&&X.jsx(T0,{pointer:s,opacity:E8,...ri(o)})})}const z6=l2.bind(null,"select",n=>n.hand.get("index-finger-tip")),H6=l2.bind(null,"squeeze",n=>n.gripSpace);function id(n){const e=H.useContext(bs);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=H.useRef(null),i=o2(t,e,n);mM(i,e.inputSource,"select",e.events);const r=n.rayModel,s=n.cursorModel;return X.jsxs(Ur,{ref:t,space:e.inputSource.targetRaySpace,children:[r!==!1&&X.jsx(U6,{pointer:i,opacity:Rg,...ri(r)}),s!==!1&&X.jsx(T0,{pointer:i,opacity:Rg,...ri(s)})]})}function G6(n){const e=pM(),t=H.useRef(null),i=N6(t,e,n),r=n.cursorModel;return X.jsx(Ur,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:r!==!1&&X.jsx(T0,{pointer:i,opacity:w8,...ri(r)})})}function V6(n){const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.teleportPointer??!1;return X.jsxs(X.Fragment,{children:[e!==!1&&X.jsx(H.Suspense,{children:X.jsx(L6,{...ri(e)})}),X.jsxs(s2,{children:[t!==!1&&X.jsx(H6,{...ri(t)}),i!==!1&&X.jsx(id,{makeDefault:!0,minDistance:.2,...ri(i)}),r!==!1&&X.jsx(c2,{...ri(r)})]})]})}function W6(n){var a;const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.touchPointer,s=n.teleportPointer??!1,o=i===!1?!1:(a=ri(i))==null?void 0:a.rayModel;return X.jsxs(X.Fragment,{children:[e!==!1&&X.jsx(H.Suspense,{children:X.jsx(O6,{...ri(e)})}),X.jsxs(s2,{children:[t!==!1&&X.jsx(z6,{...ri(t)}),r!==!1&&X.jsx(G6,{...ri(r)}),i!==!1&&X.jsx(id,{makeDefault:!0,minDistance:.2,...ri(i),rayModel:o===!1?!1:{maxLength:.2,...ri(o)}}),s!==!1&&X.jsx(c2,{...ri(s)})]})]})}function X6(n){return X.jsx(id,{...n,rayModel:!1})}function j6(n){return X.jsx(id,{...n,rayModel:!1})}function J6(n){return X.jsx(id,{...n,cursorModel:!1,rayModel:!1})}function c2(n){const e=H.useContext(bs);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=H.useRef(null),i=H.useRef(null),r=H.useMemo(()=>x6(),[]),s=o2(i,e,{...n,linePoints:r,customFilter:_6(n)},"teleport");mM(s,e.inputSource,"select",e.events);const o=n.rayModel,a=n.cursorModel,l=bi(f=>f.scene),u=H.useRef(null);return Wn((f,d)=>{u.current!=null&&(u.current.visible=s.getEnabled()&&s.getButtonsDown().size>0);const p=i.current,m=t.current;p==null||m==null||v6(m,p,d*1e3)}),X.jsxs(X.Fragment,{children:[X.jsx(Ur,{ref:t,space:e.inputSource.targetRaySpace}),nM(X.jsxs("group",{ref:i,children:[o!==!1&&X.jsx(k6,{linePoints:r,pointer:s,opacity:Rg,...ri(o)}),a!==!1&&X.jsx(T0,{ref:u,pointer:s,opacity:Rg,...ri(a)})]}),l)]})}function ri(n){if(n!==!0)return n}function K6({children:n}){const e=Cn(o=>o.originReferenceSpace),t=Cn(o=>o.origin),i=b6()==="visible",r=$f(),s=H.useMemo(()=>Object.assign({},r,{getState(){return{...r.getState(),scene:t}}}),[t,r]);return t==null||e==null?null:X.jsx(X.Fragment,{children:hu.createPortal(X.jsx(M0.Provider,{value:r,children:X.jsxs(nd.Provider,{value:e,children:[X.jsxs("group",{matrixAutoUpdate:!1,visible:i,children:[X.jsx(Y6,{}),X.jsx(Q6,{}),X.jsx(Z6,{}),X.jsx(q6,{}),X.jsx($6,{})]}),X.jsx(eW,{}),X.jsx(tW,{}),n]})}),s,null)})}function Y6(){const n=Cn(t=>t.controllerStates);let e=Cn(t=>t.controller);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.gripSpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(V6,{...i})})})},bl(t))})})}function Q6(){const n=Cn(t=>t.handStates),e=Cn(t=>t.hand);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.hand.get("wrist"),children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(W6,{...i})})})},bl(t))})})}function Z6(){const n=Cn(t=>t.transientPointerStates),e=Cn(t=>t.transientPointer);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(X6,{...i})})})},bl(t))})})}function q6(){const n=Cn(t=>t.gazeStates),e=Cn(t=>t.gaze);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof e=="function"?X.jsx(e,{}):X.jsx(j6,{...u2(e)})})})},bl(t)))})}function $6(){const n=Cn(t=>t.screenInputStates),e=Cn(t=>t.screenInput);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof e=="function"?X.jsx(e,{}):X.jsx(J6,{...u2(e)})})})},bl(t)))})}function u2(n){if(n!==!0)return n}function eW(){const n=Cn(t=>t.detectedMeshes),e=Cn(t=>t.detectedMesh);if(e!==!1)return X.jsx(X.Fragment,{children:n.map(t=>{const i=XL(e,t.semanticLabel,!1);return i===!1?null:X.jsx(Ur,{space:t.meshSpace,children:X.jsx(n2.Provider,{value:t,children:X.jsx(H.Suspense,{children:X.jsx(i,{})})})},bl(t))})})}function tW(){const n=Cn(t=>t.detectedPlanes),e=Cn(t=>t.detectedPlane);if(e!=null)return X.jsx(X.Fragment,{children:n.map(t=>{const i=XL(e,t.semanticLabel,!1);return i===!1?null:X.jsx(Ur,{space:t.planeSpace,children:X.jsx(i2.Provider,{value:t,children:X.jsx(H.Suspense,{children:X.jsx(i,{})})})},bl(t))})})}function nW(n){return P8(n)}function iW({children:n,store:e}){e.setWebXRManager(bi(i=>i.gl.xr));const t=$f();return H.useEffect(()=>{let i;return e.subscribe((r,s)=>{const o=r.mode!=null,a=s.mode!=null;if(o!==a){if(o){const{camera:l,gl:u}=t.getState();i=l,t.setState({camera:u.xr.getCamera()});return}i!=null&&t.setState({camera:i})}})},[t,e]),Wn((i,r,s)=>e.onBeforeFrame(i.scene,i.camera,s),-1e3),X.jsxs(t2.Provider,{value:e,children:[X.jsx(K6,{}),n]})}function vM(){const n=H.useContext(t2);if(n==null)throw new Error("XR features can only be used inside the component");return n}function Cn(n=e=>e){return oM(vM(),n)}const Ur=H.forwardRef(({space:n,children:e},t)=>{const i=H.useRef(null);return H.useImperativeHandle(t,()=>i.current,[]),oW(i,n,(r,s,o)=>{i.current!=null&&(i.current.visible=o!=null)}),X.jsx("group",{xrSpace:n,visible:!1,matrixAutoUpdate:!1,ref:i,children:X.jsx(nd.Provider,{value:n,children:e})})});function rW(){const n=H.useContext(nd);if(n==null)throw new Error("XR objects must be placed inside the XROrigin");return n}function sW(n){const e=H.useContext(nd),t=Cn(i=>e??i.originReferenceSpace);return H.useMemo(()=>t==null?void 0:T8(n,t),[n,t])}function oW(n,e,t){const i=sW(e);Wn((r,s,o)=>{n.current==null||i==null||(i(n.current.matrix,o),t==null||t(r,s,o))},-100)}H.forwardRef((n,e)=>{const t=aW(),i=lW(t);return X.jsx("mesh",{ref:e,geometry:i,...n})});function aW(){const n=H.useContext(n2);if(n==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return n}function lW(n,e=!0){const[t,i]=H.useState(ER(n,void 0));return Wn(()=>i(r=>ER(n,r))),H.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}H.forwardRef((n,e)=>{const t=cW(),i=uW(t);return X.jsx("mesh",{ref:e,geometry:i,...n})});function cW(){const n=H.useContext(i2);if(n==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return n}function uW(n,e=!0){const[t,i]=H.useState(wR(n,void 0));return Wn(()=>i(r=>wR(n,r))),H.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const hW=H.forwardRef(({children:n,...e},t)=>{const i=bi(s=>s.gl.xr.getCamera()),r=Cn(s=>s.originReferenceSpace);return r==null?null:X.jsxs("group",{ref:t,...e,children:[X.jsx("primitive",{object:i}),X.jsx(nd.Provider,{value:r,children:n})]})});function fW(n,e,t){const i=H.useRef(void 0);dW(e,t,H.useCallback(r=>i.current=r,[])),Wn((r,s,o)=>{n==null||o==null||i.current==null||n(o.getHitTestResults(i.current.source),i.current.getWorldMatrix)})}function dW(n,e,t){const i=vM();H.useEffect(()=>{let r,s=!1;const o=n instanceof XRSpace?n:n.current;if(o!=null)return S6(i,o,e).then(a=>{s||(r=a,t(a))}),()=>{t(void 0),s=!0,r==null||r.source.cancel()}},[i,n,e,t])}H.forwardRef((n,e)=>{const t=H.useRef(null);return H.useImperativeHandle(e,()=>t.current),fW(n.onResults,t,n.trackableType),X.jsx("group",{...n,ref:t})});H.forwardRef((n,e)=>{const t=Cn(s=>s.domOverlayRoot),{In:i,Out:r}=H.useMemo(y5,[]);return H.useEffect(()=>{const s=dS(t);return s.render(X.jsx(r,{})),()=>s.unmount()},[t,r]),X.jsx(i,{children:X.jsx("div",{...n,ref:e})})});const h2=H.forwardRef(({store:n,mode:e,onError:t,children:i,...r},s)=>{const o=oM(n,l=>l.session),a=P6(e,t);return X.jsx("button",{ref:s,...r,onClick:()=>o!=null?o.end():n.enterXR(e).catch(t),children:typeof i=="function"?i(a?o!=null?"entered":"exited":"unsupported"):i})});H.forwardRef((n,e)=>X.jsx(h2,{ref:e,mode:"immersive-ar",...n}));H.forwardRef((n,e)=>X.jsx(h2,{ref:e,mode:"immersive-vr",...n}));const pW={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:n=>n.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:n=>n.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:n=>n.pointerType==="ray"},onSqueeze:{type:"click",filter:n=>n.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:n=>n.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:n=>n.pointerType==="grab"}};function Ws(n,e,t){const i=H.useRef(t);i.current=t,H.useEffect(()=>{const{current:r}=n;if(r==null)return;const s=pW[e],o=typeof s=="string"?l=>{var u;return(u=i.current)==null?void 0:u.call(i,{intersection:l,intersections:[l],target:l.pointerState})}:l=>{var u;l instanceof ir&&!s.filter(l)||(u=i.current)==null||u.call(i,{intersection:l,intersections:[l],target:l.pointerState})},a=typeof s=="string"?s:s.type;return r.addEventListener(a,o),()=>r.removeEventListener(a,o)},[n,e])}const mW=H.forwardRef(({onHover:n,onBlur:e,onSelectStart:t,onSelectEnd:i,onSelect:r,onSqueezeStart:s,onSqueezeEnd:o,onSqueeze:a,onMove:l,children:u},f)=>{const d=H.useRef(null);return H.useImperativeHandle(f,()=>d.current),Ws(d,"onHover",n),Ws(d,"onBlur",e),Ws(d,"onSelectStart",t),Ws(d,"onSelectEnd",i),Ws(d,"onSelect",r),Ws(d,"onSqueezeStart",s),Ws(d,"onSqueezeEnd",o),Ws(d,"onSqueeze",a),Ws(d,"onMove",l),X.jsx("group",{ref:d,children:u})});H.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:i,...r},s){const o=H.useRef(),a=H.useRef(null),l=H.useMemo(()=>new Fe,[]);return H.useImperativeHandle(s,()=>a.current),Wn(()=>{const u=o.current,f=a.current;!f||!u||(f.applyMatrix4(l),f.applyMatrix4(u.matrixWorld),f.updateMatrixWorld(),l.copy(u.matrixWorld).invert())}),X.jsx(mW,{ref:a,onSelectStart:u=>{p8(u.target)&&(u.target.type==="controller"||u.target.type==="hand")&&u.target.object!=null&&(o.current=u.target.object,l.copy(u.target.object.matrixWorld).invert(),e==null||e(u))},onSelectEnd:u=>{u.target.controller===o.current&&(o.current=void 0),t==null||t(u)},...r,children:i})});function gW(){const n=H.useRef();return Wn((e,t)=>{zV.dampE(n.current.rotation,[e.pointer.y*Math.PI/50,e.pointer.x*Math.PI/20,0],.2,t)}),X.jsx("group",{ref:n,children:X.jsx("directionalLight",{position:[5,5,-8],castShadow:!0,intensity:5,"shadow-mapSize":2048,"shadow-bias":-.001,children:X.jsx("orthographicCamera",{attach:"shadow-camera",args:[-8.5,8.5,8.5,-8.5,.1,20]})})})}const bR=nW();function vW(){return X.jsxs(X.Fragment,{children:[X.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>bR.enterVR(),children:"Enter VR"}),X.jsx(uV,{shadows:!0,camera:{position:[5,2,10],fov:50},children:X.jsxs(iW,{store:bR,children:[X.jsx(V9,{}),X.jsx(U9,{makeDefault:!0}),X.jsx("color",{attach:"background",args:["#d0d0d0"]}),X.jsx("fog",{attach:"fog",args:["#d0d0d0",8,35]}),X.jsx("ambientLight",{intensity:.4}),X.jsx(gW,{}),X.jsx(_5,{scale:.5,position:[0,-1,0]}),X.jsx(R_,{}),X.jsx(R_,{position:[2,4,-8],scale:.9}),X.jsx(R_,{position:[-2,2,-8],scale:.8}),X.jsx(j9,{inclination:.52,scale:20}),X.jsx(hW,{scale:2,position:[-3.5,-1.85,3.5]})]})})]})}function R_({color:n="hotpink",floatIntensity:e=15,position:t=[0,5,-8],scale:i=1}){return X.jsx(W9,{floatIntensity:e,children:X.jsxs("mesh",{castShadow:!0,position:t,scale:i,children:[X.jsx("sphereGeometry",{}),X.jsx("meshBasicMaterial",{color:n,roughness:1})]})})}dS(document.getElementById("root")).render(X.jsx(H.StrictMode,{children:X.jsx(vW,{})}));export{mo as B,Su as C,Pr as D,Bi as E,We as F,Lr as G,ai as L,Fe as M,Et as O,Sl as P,Ot as Q,Mu as R,Zf as S,g0 as T,L as V,uB as W,Fn as a,ot as b,Kt as c,Yf as d,Cs as e,Ag as f,Pg as g,Ln as h,p0 as i,X as j,rs as k,dS as l,Zh as o,H as r}; + diffuseColor.a *= vFade;`)}}function S8(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function M8(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,u=`${i}end`,f=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(u,a)}}function E8(n){var e;return n.getButtonsDown().size>0?.6:GL(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Rg(n){return n.getButtonsDown().size>0?.6:.4}function w8(n){var e;return GL(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function GL(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function T8(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function VL(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function C8(n,e,t,i){i==null||i.copy(n.matrix);const r=WL(n,i);return r!=null||e==null||t==null?r:(i!=null&&VL(n,e,i),t)}function WL({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??WL(n,e)}function R8(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:u=!1,hitTest:f=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Vs(t,"anchors",m,y),Vs(i,"hand-tracking",m,y),Vs(r,"layers",m,y),Vs(s,"mesh-detection",m,y),Vs(o,"plane-detection",m,y),Vs(u,"depth-sensing",m,y),Vs(p,"dom-overlay",m,y),Vs(f,"hit-test",m,y),n!="immersive-vr"&&Vs(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Vs(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function Wo(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&b8(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function b8(n,e){return e in n}function XL(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const jL={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function uR(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?H9(()=>import("./emulate-NBfH5vpj.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n)})}function P8(n){const e="metaQuest3";let t;{window.location.hostname==="localhost"&&uR(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&uR(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=BL(()=>({...jL,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=g8({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=D8(r,o),l=L8(n==null?void 0:n.enterGrantedSession,p=>ym(i,p,n,d));let u;const f=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>f.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}={};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),u==null||u(),u=B8(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&JL(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({hand:x})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({controller:x})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({transientPointer:x})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({detectedPlane:x})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Wo(y,void 0,{}),[m]:p}),r.setState({detectedMesh:x})},destroy(){t==null||t(),s==null||s(),u==null||u(),l==null||l(),a(void 0,void 0)},enterXR:p=>ym(i,p,n,d),enterAR:()=>ym(i,"immersive-ar",n,d),enterVR:()=>ym(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:x}=r.getState(),_=m.parent??p,g=(d==null?void 0:d.getReferenceSpace())??void 0;x!=_&&(_.xrSpace=g,r.setState({origin:_}));const{originReferenceSpace:A}=r.getState();if(g!=A&&(_.xrSpace=g,r.setState({originReferenceSpace:g})),y==null)return;d!=null&&O8(r,y,d);const M=f.length;for(let E=0;E component?"));const r=await navigator.xr.requestSession(e,R8(e,n,t));return JL(r,"high"),I8(i,r),r}function I8(n,e,t){n!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(e),n==null||n.setSession(e))}const hR=["immersive-ar","immersive-vr","inline"];function B8(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function L8(n=hR,e){var i;if(n===!1)return;n===!0&&(n=hR);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function D8(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(jL)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function O8(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const u=fR(s,e.detectedPlanes),f=fR(r,e.detectedMeshes);(s!=u||r!=f)&&n.setState({detectedPlanes:u,detectedMeshes:f});const d=a.length;for(let m=0;m{t instanceof Kt&&t.material instanceof rn&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function z8(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>H8(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=G8(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function G8(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?dR(n).x:.5;case"yAxis":return i?dR(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const Th=new le;function dR({xAxis:n=0,yAxis:e=0}){if(Th.lengthSq()>1){const i=Math.atan2(e,n);Th.set(Math.cos(i),Math.sin(i))}else Th.set(n,e);return Th.multiplyScalar(.5).addScalar(.5),Th}function V8({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function W8({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[X8[t]];if(i!=null)return[i]}const X8={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};let ir=class KL{constructor(e,t,i,r,s,o=s.object,a=o){St(this,"type");St(this,"bubbles");St(this,"nativeEvent");St(this,"pointer");St(this,"intersection");St(this,"currentObject");St(this,"object");St(this,"stopPropagation");St(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new KL(t,i,r,s,o,e,a)}};class aM extends ir{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new aM(r,s,o,e,a)}}function wr(n){YL(n,n.currentObject)}function YL(n,e){if(e==null)return;const t=W8(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];wr(new ir("pointerenter",!1,e,this,i,l))}if(i!=null&&wr(new ir("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}wr(new ir("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&wr(new ir("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&wr(new aM(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function ZL(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),ZL(n.parent,e,t,i)}function j8(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function uM(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function J8(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function w0(n,e,t,i,r,s=!1,o,a,l){const u=s||V8(n),f=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;J8(u,f??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let x=0;x0)&&(n=u,o=l)}return o}function K8(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Xs=new Mu,Y8=new Fe,Mc=[];function Q8(n,e,t,i,r,s,o,a){if(o!=null)return Z8(n,e,o);let l,u;if(w0(t,i,r,s,(f,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(M_.origin.copy(r).applyMatrix4(n),M_.direction.copy(s).applyMatrix4(n).sub(Xs.ray.origin).normalize(),M_.intersectPlane(t,mR)!=null)return mR.clone()}}const E_=new Mu,w_=new L,gR=new $r,$8=new Fe,_m=[];function e6(n,e,t,i,r,s,o,a,l){if(a!=null)return t6(n,e,t,a);let u,f;if(E_.ray.origin.copy(n),E_.ray.direction.copy(t).applyQuaternion(e),w0(i,r,s,o,(d,p)=>{d.raycast(E_,_m);const m=hM(u,f,_m,p,l);m!=null&&(u=_m[m],f=p),_m.length=0}),u!=null)return Object.assign(u,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:u.point,localPoint:u.point.clone().applyMatrix4($8.copy(u.object.matrixWorld).invert())})}const vR=new fa;function t6(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;w_.copy(t).applyQuaternion(e),vR.set(n,w_),uM(gR,i,r);const s=vR.intersectPlane(gR,new L)??i.point;return{...i,object:r,pointOnFace:s,point:w_.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const T_=new Tn,xm=[];function qL(n,e,t,i,r,s,o,a,l){if(a!=null)return r6(n,e,a);let u,f;if(T_.center.copy(n),T_.radius=t,w0(i,r,s,o,(d,p)=>{i6(T_,d,xm);const m=hM(u,f,xm,p,l);m!=null&&(u=xm[m],f=p),xm.length=0}),u!=null)return Object.assign(u,{details:{type:"sphere"},pointOnFace:u.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:u.point.clone().applyMatrix4(bg.copy(u.object.matrixWorld).invert())})}const Am=new Fe;function n6(n){return"spherecast"in n}function i6(n,e,t){if(e.updateWorldMatrix(!0,!1),n6(e)){e.spherecast(n,t);return}if(e instanceof jf){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;C_.max(s6);const o=qc.center.clone().sub(SR);o.divide(C_),o6(o);const a=Sm.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function o6(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const yA={radius:.07};function a6(n,e,t=yA,i="grab"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f!=null)return f.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),qL(r,s,t.radius??yA.radius,a,o,i,e,u,t)},void 0,void 0,void 0,t)}const l6=new L(0,0,-1),c6=new L,Fh={direction:l6,minDistance:0,linePoints:null};function u6(n,e,t=Fh,i="ray"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f==null)return;f.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Fh.linePoints;if(p==null?(r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),d=e6(r,s,t.direction??Fh.direction,a,o,i,e,u,t)):d=Q8(f.matrixWorld,p,a,o,i,e,u,t),!(d==null||d.distance*f.getWorldScale(c6).x<(t.minDistance??Fh.minDistance)))return d},void 0,void 0,void 0,t)}const $c={button:0,downRadius:.03,hoverRadius:.1};function h6(n,e,t=$c,i="touch"){const r=new L,s=new Ot,o=fM();return new cM(o,i,e,(a,l,u)=>{const f=n.current;if(f!=null)return f.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(f.matrixWorld),s.setFromRotationMatrix(f.matrixWorld),qL(r,s,t.hoverRadius??$c.hoverRadius,a,o,i,e,u,t)},f6(t),void 0,void 0,t)}function f6(n=$c){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=d6(i,n.downRadius??$c.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??$c.button};r?t.down(s):t.up(s),e=r}}function d6(n,e){return n==null?!1:n.distance<=e}let p6=23412;function fM(){return p6++}new L;new le;let m6=class{constructor(){St(this,"pointers",[]);St(this,"isDefaults",[]);St(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new ot;return t.setIndex(new st(n.indices,1)),t.setAttribute("position",new st(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function wR(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(g6(n.polygon),{createdAt:n.lastChangedTime})}const Rh=new YB,Mm=new le;function g6(n){const e=new ia,t=n.map(({x:r,z:s})=>new le(r,s));Rh.setFromPoints(t),Rh.getSize(Mm);for(const r of t)r.sub(Rh.min),r.divide(Mm);e.setFromPoints(t);const i=new Qf(e);return i.scale(Mm.x,Mm.y,1),i.translate(Rh.min.x,Rh.min.y,0),i.rotateX(Math.PI/2),i}new L;new L;new L;const bh=new Bi(0,0,0,"YXZ"),Em=new Ot;function v6(n,e,t){n.matrixWorld.decompose(e.position,Em,e.scale),bh.setFromQuaternion(Em),bh.z=0,bh.x=Km(bh.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),Em.setFromEuler(bh),e.quaternion.slerp(Em,t/100)}function y6(n){return n.userData.teleportTarget===!0}function _6(n={}){return e=>!(!y6(e.object)||n.customFilter!=null&&!n.customFilter(e))}function x6(){return new o0(new L(0,0,0),new L(0,0,-8),new L(0,-20,-15)).getPoints(20)}let A6=class extends Kt{constructor(t){const i=new b9,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:u=.4,size:f=.01}=this.options;this.material.lineWidth=f,this.material.opacity=typeof u=="function"?u(t):u;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const wm=new Fe,Tm=new L,TR=new Ot;async function S6(n,e,t=["point","plane","mesh"]){var l,u;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=C8(e,o.origin,o.originReferenceSpace,wm)??o.originReferenceSpace,r===o.originReferenceSpace&&VL(e,o.origin,wm),Tm.setFromMatrixPosition(wm);const f={...Tm};TR.setFromRotationMatrix(wm),Tm.set(0,0,-1).applyQuaternion(TR);const d={...Tm};i=new XRRay(f,d)}const a=await((u=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:u.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:M6.bind(null,r,s)}}function M6(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new L(1,1,1);new L(0,0,0);new Fe;new Fe;new L;new L;const $L=new A5,e2="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",E6="generic-trigger";class w6{constructor(e){St(this,"baseAssetPath");St(this,"defaultProfileId");St(this,"profilesListPromise");St(this,"profilePromisesMap",new Map);St(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??e2,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??E6}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=CR(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;sn.visibilityState)}function P6(n,e){const t=H.useRef(e);t.current=e;const[i,r]=H.useMemo(()=>{let s;return[o=>{let a=!1;return navigator.xr==null?(s=!1,()=>{}):(navigator.xr.isSessionSupported(n).then(l=>{s=l,!a&&o()}).catch(l=>{var u;a||(u=t.current)==null||u.call(t,l)}),()=>a=!0)},()=>s]},[n]);return H.useSyncExternalStore(i,r)}H.forwardRef(({id:n,children:e,onPress:t,onRelease:i},r)=>{const s=dM(),[o,a]=H.useState(void 0);if(H.useImperativeHandle(r,()=>o,[o]),I6(n,l=>l==="pressed"?t==null?void 0:t():i==null?void 0:i()),Wn(()=>{var l;return a((l=s.gamepad[n])==null?void 0:l.object)}),o!=null)return nM(e,o)});function I6(n,e,t){const i=dM(),r=H.useRef();Wn(()=>{var o;const s=(o=i==null?void 0:i.gamepad[n])==null?void 0:o.state;s!=null&&s!=r.current&&e(s),r.current=s})}function dM(n){const e=H.useContext(bs);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const B6=Symbol("loadXRControllerModel"),L6=H.forwardRef((n,e)=>{const t=dM(),i=eM(U8,[t.layout,void 0,B6]);k8(i,n),t.object=i,H.useImperativeHandle(e,()=>i,[i]);const r=H.useMemo(()=>z8(i,t.layout,t.gamepad),[i,t.layout,t.gamepad]);return Wn(r),X.jsx("primitive",{object:i})});function pM(n){const e=H.useContext(bs);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const D6=Symbol("loadXRHandModel"),O6=H.forwardRef((n,e)=>{const t=pM(),i=eM(l8,[t.assetPath,void 0,D6]);c8(i,n),H.useImperativeHandle(e,()=>i,[i]);const r=rW(),s=H.useMemo(()=>d8(t.inputSource.hand,i,r),[t.inputSource,i,r]);return Wn((o,a,l)=>s(l)),X.jsx("primitive",{object:i})});H.forwardRef(({joint:n,children:e},t)=>{const i=pM();return X.jsx(Ur,{ref:t,space:i.inputSource.hand.get(n),children:e})});function s2({children:n}){const e=H.useMemo(()=>new m6,[]);return a2(e),Wn(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),X.jsx(r2.Provider,{value:e,children:n})}function F6(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,yA,t);const s=H.useMemo(()=>a6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}function o2(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,Fh,t);const s=H.useMemo(()=>u6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}function N6(n,e,t,i){const r=H.useMemo(()=>({}),[]);Object.assign(r,$c,t);const s=H.useMemo(()=>h6(n,e,r,i),[n,e,r,i]);return gM(s,t==null?void 0:t.makeDefault),s}const U6=H.forwardRef((n,e)=>{const t=H.useMemo(()=>new A8,[]),i=H.useRef(null);return H.useImperativeHandle(e,()=>i.current,[]),Wn(()=>i.current!=null&&S8(i.current,t,n.pointer,n)),X.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:n.renderOrder??2,ref:i,material:t,children:X.jsx("boxGeometry",{})})}),T0=H.forwardRef((n,e)=>{const t=H.useMemo(()=>new y8,[]),i=H.useRef(null);H.useImperativeHandle(e,()=>i.current,[]),Wn(()=>i.current!=null&&x8(i.current,t,n.pointer,n));const r=bi(s=>s.scene);return nM(X.jsx("mesh",{renderOrder:n.renderOrder??1,ref:i,matrixAutoUpdate:!1,material:t,children:X.jsx("planeGeometry",{})}),r)});function mM(n,e,t,i){const r=Cn(s=>s.session);H.useEffect(()=>{if(r!=null)return M8(n,r,e,t,i)},[t,e,n,r,i])}function gM(n,e=!1){const t=H.useContext(r2);t==null?(a2(n),Wn(i=>n.move(i.scene,{timeStamp:performance.now()}),-50)):H.useEffect(()=>t.register(n,e),[t,n,e]),H.useEffect(()=>()=>n.exit({timeStamp:performance.now()}),[n])}function a2(n){const e=vM();H.useEffect(()=>v8(e,t=>n.setEnabled(t,{timeStamp:performance.now()})),[e,n])}const k6=H.forwardRef(({pointer:n,linePoints:e,...t},i)=>{const r=H.useMemo(()=>new A6(e),[e]);return H.useImperativeHandle(i,()=>r,[r]),r.options=t,Wn(()=>r.update(n)),X.jsx("primitive",{object:r})});function l2(n,e,t){const i=H.useContext(bs);if(i==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const r=H.useRef(null),s=F6(r,i,t);mM(s,i.inputSource,n,i.events);const o=t.cursorModel;return X.jsx(Ur,{ref:r,space:e(i.inputSource),children:o!==!1&&X.jsx(T0,{pointer:s,opacity:E8,...ri(o)})})}const z6=l2.bind(null,"select",n=>n.hand.get("index-finger-tip")),H6=l2.bind(null,"squeeze",n=>n.gripSpace);function id(n){const e=H.useContext(bs);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=H.useRef(null),i=o2(t,e,n);mM(i,e.inputSource,"select",e.events);const r=n.rayModel,s=n.cursorModel;return X.jsxs(Ur,{ref:t,space:e.inputSource.targetRaySpace,children:[r!==!1&&X.jsx(U6,{pointer:i,opacity:Rg,...ri(r)}),s!==!1&&X.jsx(T0,{pointer:i,opacity:Rg,...ri(s)})]})}function G6(n){const e=pM(),t=H.useRef(null),i=N6(t,e,n),r=n.cursorModel;return X.jsx(Ur,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:r!==!1&&X.jsx(T0,{pointer:i,opacity:w8,...ri(r)})})}function V6(n){const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.teleportPointer??!1;return X.jsxs(X.Fragment,{children:[e!==!1&&X.jsx(H.Suspense,{children:X.jsx(L6,{...ri(e)})}),X.jsxs(s2,{children:[t!==!1&&X.jsx(H6,{...ri(t)}),i!==!1&&X.jsx(id,{makeDefault:!0,minDistance:.2,...ri(i)}),r!==!1&&X.jsx(c2,{...ri(r)})]})]})}function W6(n){var a;const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.touchPointer,s=n.teleportPointer??!1,o=i===!1?!1:(a=ri(i))==null?void 0:a.rayModel;return X.jsxs(X.Fragment,{children:[e!==!1&&X.jsx(H.Suspense,{children:X.jsx(O6,{...ri(e)})}),X.jsxs(s2,{children:[t!==!1&&X.jsx(z6,{...ri(t)}),r!==!1&&X.jsx(G6,{...ri(r)}),i!==!1&&X.jsx(id,{makeDefault:!0,minDistance:.2,...ri(i),rayModel:o===!1?!1:{maxLength:.2,...ri(o)}}),s!==!1&&X.jsx(c2,{...ri(s)})]})]})}function X6(n){return X.jsx(id,{...n,rayModel:!1})}function j6(n){return X.jsx(id,{...n,rayModel:!1})}function J6(n){return X.jsx(id,{...n,cursorModel:!1,rayModel:!1})}function c2(n){const e=H.useContext(bs);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=H.useRef(null),i=H.useRef(null),r=H.useMemo(()=>x6(),[]),s=o2(i,e,{...n,linePoints:r,customFilter:_6(n)},"teleport");mM(s,e.inputSource,"select",e.events);const o=n.rayModel,a=n.cursorModel,l=bi(f=>f.scene),u=H.useRef(null);return Wn((f,d)=>{u.current!=null&&(u.current.visible=s.getEnabled()&&s.getButtonsDown().size>0);const p=i.current,m=t.current;p==null||m==null||v6(m,p,d*1e3)}),X.jsxs(X.Fragment,{children:[X.jsx(Ur,{ref:t,space:e.inputSource.targetRaySpace}),nM(X.jsxs("group",{ref:i,children:[o!==!1&&X.jsx(k6,{linePoints:r,pointer:s,opacity:Rg,...ri(o)}),a!==!1&&X.jsx(T0,{ref:u,pointer:s,opacity:Rg,...ri(a)})]}),l)]})}function ri(n){if(n!==!0)return n}function K6({children:n}){const e=Cn(o=>o.originReferenceSpace),t=Cn(o=>o.origin),i=b6()==="visible",r=$f(),s=H.useMemo(()=>Object.assign({},r,{getState(){return{...r.getState(),scene:t}}}),[t,r]);return t==null||e==null?null:X.jsx(X.Fragment,{children:hu.createPortal(X.jsx(M0.Provider,{value:r,children:X.jsxs(nd.Provider,{value:e,children:[X.jsxs("group",{matrixAutoUpdate:!1,visible:i,children:[X.jsx(Y6,{}),X.jsx(Q6,{}),X.jsx(Z6,{}),X.jsx(q6,{}),X.jsx($6,{})]}),X.jsx(eW,{}),X.jsx(tW,{}),n]})}),s,null)})}function Y6(){const n=Cn(t=>t.controllerStates);let e=Cn(t=>t.controller);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.gripSpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(V6,{...i})})})},bl(t))})})}function Q6(){const n=Cn(t=>t.handStates),e=Cn(t=>t.hand);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.hand.get("wrist"),children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(W6,{...i})})})},bl(t))})})}function Z6(){const n=Cn(t=>t.transientPointerStates),e=Cn(t=>t.transientPointer);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>{const i=Wo(e,t.inputSource.handedness,{});return i===!1?null:X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof i=="function"?X.jsx(i,{}):X.jsx(X6,{...i})})})},bl(t))})})}function q6(){const n=Cn(t=>t.gazeStates),e=Cn(t=>t.gaze);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof e=="function"?X.jsx(e,{}):X.jsx(j6,{...u2(e)})})})},bl(t)))})}function $6(){const n=Cn(t=>t.screenInputStates),e=Cn(t=>t.screenInput);return e===!1?null:X.jsx(X.Fragment,{children:n.map(t=>X.jsx(Ur,{space:t.inputSource.targetRaySpace,children:X.jsx(bs.Provider,{value:t,children:X.jsx(H.Suspense,{children:typeof e=="function"?X.jsx(e,{}):X.jsx(J6,{...u2(e)})})})},bl(t)))})}function u2(n){if(n!==!0)return n}function eW(){const n=Cn(t=>t.detectedMeshes),e=Cn(t=>t.detectedMesh);if(e!==!1)return X.jsx(X.Fragment,{children:n.map(t=>{const i=XL(e,t.semanticLabel,!1);return i===!1?null:X.jsx(Ur,{space:t.meshSpace,children:X.jsx(n2.Provider,{value:t,children:X.jsx(H.Suspense,{children:X.jsx(i,{})})})},bl(t))})})}function tW(){const n=Cn(t=>t.detectedPlanes),e=Cn(t=>t.detectedPlane);if(e!=null)return X.jsx(X.Fragment,{children:n.map(t=>{const i=XL(e,t.semanticLabel,!1);return i===!1?null:X.jsx(Ur,{space:t.planeSpace,children:X.jsx(i2.Provider,{value:t,children:X.jsx(H.Suspense,{children:X.jsx(i,{})})})},bl(t))})})}function nW(n){return P8(n)}function iW({children:n,store:e}){e.setWebXRManager(bi(i=>i.gl.xr));const t=$f();return H.useEffect(()=>{let i;return e.subscribe((r,s)=>{const o=r.mode!=null,a=s.mode!=null;if(o!==a){if(o){const{camera:l,gl:u}=t.getState();i=l,t.setState({camera:u.xr.getCamera()});return}i!=null&&t.setState({camera:i})}})},[t,e]),Wn((i,r,s)=>e.onBeforeFrame(i.scene,i.camera,s),-1e3),X.jsxs(t2.Provider,{value:e,children:[X.jsx(K6,{}),n]})}function vM(){const n=H.useContext(t2);if(n==null)throw new Error("XR features can only be used inside the component");return n}function Cn(n=e=>e){return oM(vM(),n)}const Ur=H.forwardRef(({space:n,children:e},t)=>{const i=H.useRef(null);return H.useImperativeHandle(t,()=>i.current,[]),oW(i,n,(r,s,o)=>{i.current!=null&&(i.current.visible=o!=null)}),X.jsx("group",{xrSpace:n,visible:!1,matrixAutoUpdate:!1,ref:i,children:X.jsx(nd.Provider,{value:n,children:e})})});function rW(){const n=H.useContext(nd);if(n==null)throw new Error("XR objects must be placed inside the XROrigin");return n}function sW(n){const e=H.useContext(nd),t=Cn(i=>e??i.originReferenceSpace);return H.useMemo(()=>t==null?void 0:T8(n,t),[n,t])}function oW(n,e,t){const i=sW(e);Wn((r,s,o)=>{n.current==null||i==null||(i(n.current.matrix,o),t==null||t(r,s,o))},-100)}H.forwardRef((n,e)=>{const t=aW(),i=lW(t);return X.jsx("mesh",{ref:e,geometry:i,...n})});function aW(){const n=H.useContext(n2);if(n==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return n}function lW(n,e=!0){const[t,i]=H.useState(ER(n,void 0));return Wn(()=>i(r=>ER(n,r))),H.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}H.forwardRef((n,e)=>{const t=cW(),i=uW(t);return X.jsx("mesh",{ref:e,geometry:i,...n})});function cW(){const n=H.useContext(i2);if(n==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return n}function uW(n,e=!0){const[t,i]=H.useState(wR(n,void 0));return Wn(()=>i(r=>wR(n,r))),H.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const hW=H.forwardRef(({children:n,...e},t)=>{const i=bi(s=>s.gl.xr.getCamera()),r=Cn(s=>s.originReferenceSpace);return r==null?null:X.jsxs("group",{ref:t,...e,children:[X.jsx("primitive",{object:i}),X.jsx(nd.Provider,{value:r,children:n})]})});function fW(n,e,t){const i=H.useRef(void 0);dW(e,t,H.useCallback(r=>i.current=r,[])),Wn((r,s,o)=>{n==null||o==null||i.current==null||n(o.getHitTestResults(i.current.source),i.current.getWorldMatrix)})}function dW(n,e,t){const i=vM();H.useEffect(()=>{let r,s=!1;const o=n instanceof XRSpace?n:n.current;if(o!=null)return S6(i,o,e).then(a=>{s||(r=a,t(a))}),()=>{t(void 0),s=!0,r==null||r.source.cancel()}},[i,n,e,t])}H.forwardRef((n,e)=>{const t=H.useRef(null);return H.useImperativeHandle(e,()=>t.current),fW(n.onResults,t,n.trackableType),X.jsx("group",{...n,ref:t})});H.forwardRef((n,e)=>{const t=Cn(s=>s.domOverlayRoot),{In:i,Out:r}=H.useMemo(y5,[]);return H.useEffect(()=>{const s=dS(t);return s.render(X.jsx(r,{})),()=>s.unmount()},[t,r]),X.jsx(i,{children:X.jsx("div",{...n,ref:e})})});const h2=H.forwardRef(({store:n,mode:e,onError:t,children:i,...r},s)=>{const o=oM(n,l=>l.session),a=P6(e,t);return X.jsx("button",{ref:s,...r,onClick:()=>o!=null?o.end():n.enterXR(e).catch(t),children:typeof i=="function"?i(a?o!=null?"entered":"exited":"unsupported"):i})});H.forwardRef((n,e)=>X.jsx(h2,{ref:e,mode:"immersive-ar",...n}));H.forwardRef((n,e)=>X.jsx(h2,{ref:e,mode:"immersive-vr",...n}));const pW={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:n=>n.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:n=>n.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:n=>n.pointerType==="ray"},onSqueeze:{type:"click",filter:n=>n.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:n=>n.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:n=>n.pointerType==="grab"}};function Ws(n,e,t){const i=H.useRef(t);i.current=t,H.useEffect(()=>{const{current:r}=n;if(r==null)return;const s=pW[e],o=typeof s=="string"?l=>{var u;return(u=i.current)==null?void 0:u.call(i,{intersection:l,intersections:[l],target:l.pointerState})}:l=>{var u;l instanceof ir&&!s.filter(l)||(u=i.current)==null||u.call(i,{intersection:l,intersections:[l],target:l.pointerState})},a=typeof s=="string"?s:s.type;return r.addEventListener(a,o),()=>r.removeEventListener(a,o)},[n,e])}const mW=H.forwardRef(({onHover:n,onBlur:e,onSelectStart:t,onSelectEnd:i,onSelect:r,onSqueezeStart:s,onSqueezeEnd:o,onSqueeze:a,onMove:l,children:u},f)=>{const d=H.useRef(null);return H.useImperativeHandle(f,()=>d.current),Ws(d,"onHover",n),Ws(d,"onBlur",e),Ws(d,"onSelectStart",t),Ws(d,"onSelectEnd",i),Ws(d,"onSelect",r),Ws(d,"onSqueezeStart",s),Ws(d,"onSqueezeEnd",o),Ws(d,"onSqueeze",a),Ws(d,"onMove",l),X.jsx("group",{ref:d,children:u})});H.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:i,...r},s){const o=H.useRef(),a=H.useRef(null),l=H.useMemo(()=>new Fe,[]);return H.useImperativeHandle(s,()=>a.current),Wn(()=>{const u=o.current,f=a.current;!f||!u||(f.applyMatrix4(l),f.applyMatrix4(u.matrixWorld),f.updateMatrixWorld(),l.copy(u.matrixWorld).invert())}),X.jsx(mW,{ref:a,onSelectStart:u=>{p8(u.target)&&(u.target.type==="controller"||u.target.type==="hand")&&u.target.object!=null&&(o.current=u.target.object,l.copy(u.target.object.matrixWorld).invert(),e==null||e(u))},onSelectEnd:u=>{u.target.controller===o.current&&(o.current=void 0),t==null||t(u)},...r,children:i})});function gW(){const n=H.useRef();return Wn((e,t)=>{zV.dampE(n.current.rotation,[e.pointer.y*Math.PI/50,e.pointer.x*Math.PI/20,0],.2,t)}),X.jsx("group",{ref:n,children:X.jsx("directionalLight",{position:[5,5,-8],castShadow:!0,intensity:5,"shadow-mapSize":2048,"shadow-bias":-.001,children:X.jsx("orthographicCamera",{attach:"shadow-camera",args:[-8.5,8.5,8.5,-8.5,.1,20]})})})}const bR=nW();function vW(){return X.jsxs(X.Fragment,{children:[X.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>bR.enterVR(),children:"Enter VR"}),X.jsx(uV,{shadows:!0,camera:{position:[5,2,10],fov:50},children:X.jsxs(iW,{store:bR,children:[X.jsx(V9,{}),X.jsx(U9,{makeDefault:!0}),X.jsx("color",{attach:"background",args:["#d0d0d0"]}),X.jsx("fog",{attach:"fog",args:["#d0d0d0",8,35]}),X.jsx("ambientLight",{intensity:.4}),X.jsx(gW,{}),X.jsx(_5,{scale:.5,position:[0,-1,0]}),X.jsx(R_,{}),X.jsx(R_,{position:[2,4,-8],scale:.9}),X.jsx(R_,{position:[-2,2,-8],scale:.8}),X.jsx(j9,{inclination:.52,scale:20}),X.jsx(hW,{scale:2,position:[-3.5,-1.85,3.5]})]})})]})}function R_({color:n="hotpink",floatIntensity:e=15,position:t=[0,5,-8],scale:i=1}){return X.jsx(W9,{floatIntensity:e,children:X.jsxs("mesh",{castShadow:!0,position:t,scale:i,children:[X.jsx("sphereGeometry",{}),X.jsx("meshBasicMaterial",{color:n,roughness:1})]})})}dS(document.getElementById("root")).render(X.jsx(H.StrictMode,{children:X.jsx(vW,{})}));export{mo as B,Su as C,Pr as D,Bi as E,We as F,Lr as G,ai as L,Fe as M,Et as O,Sl as P,Ot as Q,Mu as R,Zf as S,g0 as T,L as V,uB as W,Fn as a,ot as b,Kt as c,Yf as d,Cs as e,Ag as f,Pg as g,Ln as h,p0 as i,X as j,rs as k,dS as l,Zh as o,H as r}; diff --git a/examples/room-with-shadows/index.html b/examples/room-with-shadows/index.html index 4b180b1..fd04710 100644 --- a/examples/room-with-shadows/index.html +++ b/examples/room-with-shadows/index.html @@ -4,7 +4,7 @@ Document - +
diff --git a/examples/stage/assets/emulate-Cko4tTGd.js b/examples/stage/assets/emulate-Cko4tTGd.js new file mode 100644 index 0000000..a1001c3 --- /dev/null +++ b/examples/stage/assets/emulate-Cko4tTGd.js @@ -0,0 +1,819 @@ +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-BZrPM0HJ.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; + --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; + --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; +} + +svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} + +.svg-inline--fa { + display: var(--fa-display, inline-block); + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +.svg-inline--fa.fa-2xs { + vertical-align: 0.1em; +} +.svg-inline--fa.fa-xs { + vertical-align: 0em; +} +.svg-inline--fa.fa-sm { + vertical-align: -0.0714285705em; +} +.svg-inline--fa.fa-lg { + vertical-align: -0.2em; +} +.svg-inline--fa.fa-xl { + vertical-align: -0.25em; +} +.svg-inline--fa.fa-2xl { + vertical-align: -0.3125em; +} +.svg-inline--fa.fa-pull-left { + margin-right: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-pull-right { + margin-left: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-li { + width: var(--fa-li-width, 2em); + top: 0.25em; +} +.svg-inline--fa.fa-fw { + width: var(--fa-fw-width, 1.25em); +} + +.fa-layers svg.svg-inline--fa { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; +} + +.fa-layers-counter, .fa-layers-text { + display: inline-block; + position: absolute; + text-align: center; +} + +.fa-layers { + display: inline-block; + height: 1em; + position: relative; + text-align: center; + vertical-align: -0.125em; + width: 1em; +} +.fa-layers svg.svg-inline--fa { + transform-origin: center center; +} + +.fa-layers-text { + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + transform-origin: center center; +} + +.fa-layers-counter { + background-color: var(--fa-counter-background-color, #ff253a); + border-radius: var(--fa-counter-border-radius, 1em); + box-sizing: border-box; + color: var(--fa-inverse, #fff); + line-height: var(--fa-counter-line-height, 1); + max-width: var(--fa-counter-max-width, 5em); + min-width: var(--fa-counter-min-width, 1.5em); + overflow: hidden; + padding: var(--fa-counter-padding, 0.25em 0.5em); + right: var(--fa-right, 0); + text-overflow: ellipsis; + top: var(--fa-top, 0); + transform: scale(var(--fa-counter-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-bottom-right { + bottom: var(--fa-bottom, 0); + right: var(--fa-right, 0); + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom right; +} + +.fa-layers-bottom-left { + bottom: var(--fa-bottom, 0); + left: var(--fa-left, 0); + right: auto; + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom left; +} + +.fa-layers-top-right { + top: var(--fa-top, 0); + right: var(--fa-right, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-top-left { + left: var(--fa-left, 0); + right: auto; + top: var(--fa-top, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top left; +} + +.fa-1x { + font-size: 1em; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-6x { + font-size: 6em; +} + +.fa-7x { + font-size: 7em; +} + +.fa-8x { + font-size: 8em; +} + +.fa-9x { + font-size: 9em; +} + +.fa-10x { + font-size: 10em; +} + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; +} + +.fa-xs { + font-size: 0.75em; + line-height: 0.0833333337em; + vertical-align: 0.125em; +} + +.fa-sm { + font-size: 0.875em; + line-height: 0.0714285718em; + vertical-align: 0.0535714295em; +} + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; +} + +.fa-xl { + font-size: 1.5em; + line-height: 0.0416666682em; + vertical-align: -0.125em; +} + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; +} + +.fa-fw { + text-align: center; + width: 1.25em; +} + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + left: calc(-1 * var(--fa-li-width, 2em)); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; +} + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); +} + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); +} + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); +} + +.fa-beat { + animation-name: fa-beat; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-bounce { + animation-name: fa-bounce; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); +} + +.fa-fade { + animation-name: fa-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-beat-fade { + animation-name: fa-beat-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-flip { + animation-name: fa-flip; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-shake { + animation-name: fa-shake; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin { + animation-name: fa-spin; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 2s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin-reverse { + --fa-animation-direction: reverse; +} + +.fa-pulse, +.fa-spin-pulse { + animation-name: fa-spin; + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, steps(8)); +} + +@media (prefers-reduced-motion: reduce) { + .fa-beat, +.fa-bounce, +.fa-fade, +.fa-beat-fade, +.fa-flip, +.fa-pulse, +.fa-shake, +.fa-spin, +.fa-spin-pulse { + animation-delay: -1ms; + animation-duration: 1ms; + animation-iteration-count: 1; + transition-delay: 0s; + transition-duration: 0s; + } +} +@keyframes fa-beat { + 0%, 90% { + transform: scale(1); + } + 45% { + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@keyframes fa-bounce { + 0% { + transform: scale(1, 1) translateY(0); + } + 10% { + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + transform: scale(1, 1) translateY(0); + } + 100% { + transform: scale(1, 1) translateY(0); + } +} +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@keyframes fa-flip { + 50% { + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@keyframes fa-shake { + 0% { + transform: rotate(-15deg); + } + 4% { + transform: rotate(15deg); + } + 8%, 24% { + transform: rotate(-18deg); + } + 12%, 28% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-22deg); + } + 20% { + transform: rotate(22deg); + } + 32% { + transform: rotate(-12deg); + } + 36% { + transform: rotate(12deg); + } + 40%, 100% { + transform: rotate(0deg); + } +} +@keyframes fa-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +.fa-rotate-90 { + transform: rotate(90deg); +} + +.fa-rotate-180 { + transform: rotate(180deg); +} + +.fa-rotate-270 { + transform: rotate(270deg); +} + +.fa-flip-horizontal { + transform: scale(-1, 1); +} + +.fa-flip-vertical { + transform: scale(1, -1); +} + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + transform: scale(-1, -1); +} + +.fa-rotate-by { + transform: rotate(var(--fa-rotate-angle, 0)); +} + +.fa-stack { + display: inline-block; + vertical-align: middle; + height: 2em; + position: relative; + width: 2.5em; +} + +.fa-stack-1x, +.fa-stack-2x { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: var(--fa-stack-z-index, auto); +} + +.svg-inline--fa.fa-stack-1x { + height: 1em; + width: 1.25em; +} +.svg-inline--fa.fa-stack-2x { + height: 2em; + width: 2.5em; +} + +.fa-inverse { + color: var(--fa-inverse, #fff); +} + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.svg-inline--fa .fa-primary { + fill: var(--fa-primary-color, currentColor); + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa .fa-secondary { + fill: var(--fa-secondary-color, currentColor); + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-primary { + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-secondary { + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa mask .fa-primary, +.svg-inline--fa mask .fa-secondary { + fill: black; +} + +.fad.fa-inverse, +.fa-duotone.fa-inverse { + color: var(--fa-inverse, #fff); +}`;function Fa(){const e=Ia,t=Ra,n=P.cssPrefix,r=P.replacementClass;let i=g1;if(n!==e||r!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(o,".".concat(r))}return i}let as=!1;function wr(){P.autoAddCss&&!as&&(u1(Fa()),as=!0)}var y1={mixout(){return{dom:{css:Fa,insertCss:wr}}},hooks(){return{beforeDOMElementCreation(){wr()},beforeI2svg(){wr()}}}};const Xe=rt||{};Xe[Ze]||(Xe[Ze]={});Xe[Ze].styles||(Xe[Ze].styles={});Xe[Ze].hooks||(Xe[Ze].hooks={});Xe[Ze].shims||(Xe[Ze].shims=[]);var Ne=Xe[Ze];const za=[],Na=function(){Z.removeEventListener("DOMContentLoaded",Na),Bn=1,za.map(e=>e())};let Bn=!1;Be&&(Bn=(Z.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Z.readyState),Bn||Z.addEventListener("DOMContentLoaded",Na));function v1(e){Be&&(Bn?setTimeout(e,0):za.push(e))}function gn(e){const{tag:t,attributes:n={},children:r=[]}=e;return typeof e=="string"?Ca(e):"<".concat(t," ").concat(h1(n),">").concat(r.map(gn).join(""),"")}function os(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var br=function(t,n,r,i){var a=Object.keys(t),s=a.length,o=n,l,c,u;for(r===void 0?(l=1,u=t[a[0]]):(l=0,u=r);l=55296&&i<=56319&&n=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function ls(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return!!r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function Vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:r=!1}=n,i=ls(t);typeof Ne.hooks.addPack=="function"&&!r?Ne.hooks.addPack(e,ls(t)):Ne.styles[e]={...Ne.styles[e]||{},...i},e==="fas"&&Vr("fa",t)}const{styles:ut,shims:b1}=Ne,S1={[W]:Object.values(gt[W]),[Se]:Object.values(gt[Se]),[Me]:Object.values(gt[Me])};let mi=null,Da={},$a={},Va={},qa={},Ha={};const M1={[W]:Object.keys(mt[W]),[Se]:Object.keys(mt[Se]),[Me]:Object.keys(mt[Me])};function k1(e){return~o1.indexOf(e)}function E1(e,t){const n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!k1(i)?i:null}const Za=()=>{const e=r=>br(ut,(i,a,s)=>(i[s]=br(a,r,{}),i),{});Da=e((r,i,a)=>(i[3]&&(r[i[3]]=a),i[2]&&i[2].filter(o=>typeof o=="number").forEach(o=>{r[o.toString(16)]=a}),r)),$a=e((r,i,a)=>(r[a]=a,i[2]&&i[2].filter(o=>typeof o=="string").forEach(o=>{r[o]=a}),r)),Ha=e((r,i,a)=>{const s=i[2];return r[a]=a,s.forEach(o=>{r[o]=a}),r});const t="far"in ut||P.autoFetchSvg,n=br(b1,(r,i)=>{const a=i[0];let s=i[1];const o=i[2];return s==="far"&&!t&&(s="fas"),typeof a=="string"&&(r.names[a]={prefix:s,iconName:o}),typeof a=="number"&&(r.unicodes[a.toString(16)]={prefix:s,iconName:o}),r},{names:{},unicodes:{}});Va=n.names,qa=n.unicodes,mi=ar(P.styleDefault,{family:P.familyDefault})};f1(e=>{mi=ar(e.styleDefault,{family:P.familyDefault})});Za();function gi(e,t){return(Da[e]||{})[t]}function P1(e,t){return($a[e]||{})[t]}function nt(e,t){return(Ha[e]||{})[t]}function Xa(e){return Va[e]||{prefix:null,iconName:null}}function A1(e){const t=qa[e],n=gi("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function it(){return mi}const yi=()=>({prefix:null,iconName:null,rest:[]});function ar(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=W}=t,r=mt[n][e],i=cn[n][e]||cn[n][r],a=e in Ne.styles?e:null;return i||a||null}const I1={[W]:Object.keys(gt[W]),[Se]:Object.keys(gt[Se]),[Me]:Object.keys(gt[Me])};function or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=t,r={[W]:"".concat(P.cssPrefix,"-").concat(W),[Se]:"".concat(P.cssPrefix,"-").concat(Se),[Me]:"".concat(P.cssPrefix,"-").concat(Me)};let i=null,a=W;const s=F0.filter(l=>l!==Ea);s.forEach(l=>{(e.includes(r[l])||e.some(c=>I1[l].includes(c)))&&(a=l)});const o=e.reduce((l,c)=>{const u=E1(P.cssPrefix,c);if(ut[c]?(c=S1[a].includes(c)?n1[a][c]:c,i=c,l.prefix=c):M1[a].indexOf(c)>-1?(i=c,l.prefix=ar(c,{family:a})):u?l.iconName=u:c!==P.replacementClass&&!s.some(h=>c===r[h])&&l.rest.push(c),!n&&l.prefix&&l.iconName){const h=i==="fa"?Xa(l.iconName):{},p=nt(l.prefix,l.iconName);h.prefix&&(i=null),l.iconName=h.iconName||p||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!ut.far&&ut.fas&&!P.autoFetchSvg&&(l.prefix="fas")}return l},yi());return(e.includes("fa-brands")||e.includes("fab"))&&(o.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(o.prefix="fad"),!o.prefix&&a===Se&&(ut.fass||P.autoFetchSvg)&&(o.prefix="fass",o.iconName=nt(o.prefix,o.iconName)||o.iconName),!o.prefix&&a===Me&&(ut.fasds||P.autoFetchSvg)&&(o.prefix="fasds",o.iconName=nt(o.prefix,o.iconName)||o.iconName),(o.prefix==="fa"||i==="fa")&&(o.prefix=it()||"fas"),o}class R1{constructor(){this.definitions={}}add(){for(var t=arguments.length,n=new Array(t),r=0;r{this.definitions[a]={...this.definitions[a]||{},...i[a]},Vr(a,i[a]);const s=gt[W][a];s&&Vr(s,i[a]),Za()})}reset(){this.definitions={}}_pullDefinitions(t,n){const r=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(r).map(i=>{const{prefix:a,iconName:s,icon:o}=r[i],l=o[2];t[a]||(t[a]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(t[a][c]=o)}),t[a][s]=o}),t}}let cs=[],Pt={};const Rt={},O1=Object.keys(Rt);function L1(e,t){let{mixoutsTo:n}=t;return cs=e,Pt={},Object.keys(Rt).forEach(r=>{O1.indexOf(r)===-1&&delete Rt[r]}),cs.forEach(r=>{const i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(a=>{typeof i[a]=="function"&&(n[a]=i[a]),typeof i[a]=="object"&&Object.keys(i[a]).forEach(s=>{n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){const a=r.hooks();Object.keys(a).forEach(s=>{Pt[s]||(Pt[s]=[]),Pt[s].push(a[s])})}r.provides&&r.provides(Rt)}),n}function qr(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i{t=s.apply(null,[t,...r])}),t}function St(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{a.apply(null,n)})}function st(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Rt[e]?Rt[e].apply(null,t):void 0}function Hr(e){e.prefix==="fa"&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||it();if(t)return t=nt(n,t)||t,os(Ba.definitions,n,t)||os(Ne.styles,n,t)}const Ba=new R1,T1=()=>{P.autoReplaceSvg=!1,P.observeMutations=!1,St("noAuto")},j1={i2svg:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Be?(St("beforeI2svg",e),st("pseudoElements2svg",e),st("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;P.autoReplaceSvg===!1&&(P.autoReplaceSvg=!0),P.observeMutations=!0,v1(()=>{C1({autoReplaceSvgRoot:t}),St("watch",e)})}},_1={icon:e=>{if(e===null)return null;if(typeof e=="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:nt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){const t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],n=ar(e[0]);return{prefix:n,iconName:nt(n,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(P.cssPrefix,"-"))>-1||e.match(r1))){const t=or(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||it(),iconName:nt(t.prefix,t.iconName)||t.iconName}}if(typeof e=="string"){const t=it();return{prefix:t,iconName:nt(t,e)||e}}}},Ee={noAuto:T1,config:P,dom:j1,parse:_1,library:Ba,findIconDefinition:Hr,toHtml:gn},C1=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t=Z}=e;(Object.keys(Ne.styles).length>0||P.autoFetchSvg)&&Be&&P.autoReplaceSvg&&Ee.dom.i2svg({node:t})};function lr(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(n=>gn(n))}}),Object.defineProperty(e,"node",{get:function(){if(!Be)return;const n=Z.createElement("div");return n.innerHTML=e.html,n.children}}),e}function F1(e){let{children:t,main:n,mask:r,attributes:i,styles:a,transform:s}=e;if(pi(s)&&n.found&&!r.found){const{width:o,height:l}=n,c={x:o/l/2,y:.5};i.style=sr({...a,"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")})}return[{tag:"svg",attributes:i,children:t}]}function z1(e){let{prefix:t,iconName:n,children:r,attributes:i,symbol:a}=e;const s=a===!0?"".concat(t,"-").concat(P.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:s},children:r}]}]}function vi(e){const{icons:{main:t,mask:n},prefix:r,iconName:i,transform:a,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:p,height:g}=n.found?n:t,x=r==="fak",v=[P.replacementClass,i?"".concat(P.cssPrefix,"-").concat(i):""].filter(k=>u.classes.indexOf(k)===-1).filter(k=>k!==""||!!k).concat(u.classes).join(" ");let d={children:[],attributes:{...u.attributes,"data-prefix":r,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(g)}};const y=x&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/g*16*.0625,"em")}:{};h&&(d.attributes[bt]=""),o&&(d.children.push({tag:"title",attributes:{id:d.attributes["aria-labelledby"]||"title-".concat(c||fn())},children:[o]}),delete d.attributes.title);const b={...d,prefix:r,iconName:i,main:t,mask:n,maskId:l,transform:a,symbol:s,styles:{...y,...u.styles}},{children:w,attributes:M}=n.found&&t.found?st("generateAbstractMask",b)||{children:[],attributes:{}}:st("generateAbstractIcon",b)||{children:[],attributes:{}};return b.children=w,b.attributes=M,s?z1(b):F1(b)}function fs(e){const{content:t,width:n,height:r,transform:i,title:a,extra:s,watchable:o=!1}=e,l={...s.attributes,...a?{title:a}:{},class:s.classes.join(" ")};o&&(l[bt]="");const c={...s.styles};pi(i)&&(c.transform=m1({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);const u=sr(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function N1(e){const{content:t,title:n,extra:r}=e,i={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},a=sr(r.styles);a.length>0&&(i.style=a);const s=[];return s.push({tag:"span",attributes:i,children:[t]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}const{styles:Sr}=Ne;function Zr(e){const t=e[0],n=e[1],[r]=e.slice(4);let i=null;return Array.isArray(r)?i={tag:"g",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.GROUP)},children:[{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.PRIMARY),fill:"currentColor",d:r[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:t,height:n,icon:i}}const D1={found:!1,width:512,height:512};function $1(e,t){!Oa&&!P.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Xr(e,t){let n=t;return t==="fa"&&P.styleDefault!==null&&(t=it()),new Promise((r,i)=>{if(n==="fa"){const a=Xa(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&Sr[t]&&Sr[t][e]){const a=Sr[t][e];return r(Zr(a))}$1(e,t),r({...D1,icon:P.showMissingIcons&&e?st("missingIconAbstract")||{}:{}})})}const us=()=>{},Br=P.measurePerformance&&En&&En.mark&&En.measure?En:{mark:us,measure:us},Gt='FA "6.6.0"',V1=e=>(Br.mark("".concat(Gt," ").concat(e," begins")),()=>Ya(e)),Ya=e=>{Br.mark("".concat(Gt," ").concat(e," ends")),Br.measure("".concat(Gt," ").concat(e),"".concat(Gt," ").concat(e," begins"),"".concat(Gt," ").concat(e," ends"))};var xi={begin:V1,end:Ya};const Tn=()=>{};function ds(e){return typeof(e.getAttribute?e.getAttribute(bt):null)=="string"}function q1(e){const t=e.getAttribute?e.getAttribute(ui):null,n=e.getAttribute?e.getAttribute(di):null;return t&&n}function H1(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(P.replacementClass)}function Z1(){return P.autoReplaceSvg===!0?jn.replace:jn[P.autoReplaceSvg]||jn.replace}function X1(e){return Z.createElementNS("http://www.w3.org/2000/svg",e)}function B1(e){return Z.createElement(e)}function Wa(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=e.tag==="svg"?X1:B1}=t;if(typeof e=="string")return Z.createTextNode(e);const r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(a){r.setAttribute(a,e.attributes[a])}),(e.children||[]).forEach(function(a){r.appendChild(Wa(a,{ceFn:n}))}),r}function Y1(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}const jn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(n=>{t.parentNode.insertBefore(Wa(n),t)}),t.getAttribute(bt)===null&&P.keepOriginalSource){let n=Z.createComment(Y1(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~hi(t).indexOf(P.replacementClass))return jn.replace(e);const r=new RegExp("".concat(P.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const a=n[0].attributes.class.split(" ").reduce((s,o)=>(o===P.replacementClass||o.match(r)?s.toSvg.push(o):s.toNode.push(o),s),{toNode:[],toSvg:[]});n[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",a.toNode.join(" "))}const i=n.map(a=>gn(a)).join(` +`);t.setAttribute(bt,""),t.innerHTML=i}};function hs(e){e()}function Qa(e,t){const n=typeof t=="function"?t:Tn;if(e.length===0)n();else{let r=hs;P.mutateApproach===e1&&(r=rt.requestAnimationFrame||hs),r(()=>{const i=Z1(),a=xi.begin("mutate");e.map(i),a(),n()})}}let wi=!1;function Ga(){wi=!0}function Yr(){wi=!1}let Yn=null;function ps(e){if(!ns||!P.observeMutations)return;const{treeCallback:t=Tn,nodeCallback:n=Tn,pseudoElementsCallback:r=Tn,observeMutationsRoot:i=Z}=e;Yn=new ns(a=>{if(wi)return;const s=it();Nt(a).forEach(o=>{if(o.type==="childList"&&o.addedNodes.length>0&&!ds(o.addedNodes[0])&&(P.searchPseudoElements&&r(o.target),t(o.target)),o.type==="attributes"&&o.target.parentNode&&P.searchPseudoElements&&r(o.target.parentNode),o.type==="attributes"&&ds(o.target)&&~a1.indexOf(o.attributeName))if(o.attributeName==="class"&&q1(o.target)){const{prefix:l,iconName:c}=or(hi(o.target));o.target.setAttribute(ui,l||s),c&&o.target.setAttribute(di,c)}else H1(o.target)&&n(o.target)})}),Be&&Yn.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function W1(){Yn&&Yn.disconnect()}function Q1(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce((r,i)=>{const a=i.split(":"),s=a[0],o=a.slice(1);return s&&o.length>0&&(r[s]=o.join(":").trim()),r},{})),n}function G1(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"";let i=or(hi(e));return i.prefix||(i.prefix=it()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=P1(i.prefix,e.innerText)||gi(i.prefix,$r(e.innerText))),!i.iconName&&P.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function U1(e){const t=Nt(e.attributes).reduce((i,a)=>(i.name!=="class"&&i.name!=="style"&&(i[a.name]=a.value),i),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return P.autoA11y&&(n?t["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(r||fn()):(t["aria-hidden"]="true",t.focusable="false")),t}function K1(){return{iconName:null,title:null,titleId:null,prefix:null,transform:ze,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:i}=G1(e),a=U1(e),s=qr("parseNodeAttributes",{},e);let o=t.styleParser?Q1(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:r,transform:ze,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:o,attributes:a},...s}}const{styles:J1}=Ne;function Ua(e){const t=P.autoReplaceSvg==="nest"?ms(e,{styleParser:!1}):ms(e);return~t.extra.classes.indexOf(ja)?st("generateLayersText",e,t):st("generateSvgReplacementMutation",e,t)}let De=new Set;La.map(e=>{De.add("fa-".concat(e))});Object.keys(mt[W]).map(De.add.bind(De));Object.keys(mt[Se]).map(De.add.bind(De));Object.keys(mt[Me]).map(De.add.bind(De));De=[...De];function gs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Be)return Promise.resolve();const n=Z.documentElement.classList,r=u=>n.add("".concat(ss,"-").concat(u)),i=u=>n.remove("".concat(ss,"-").concat(u)),a=P.autoFetchSvg?De:La.map(u=>"fa-".concat(u)).concat(Object.keys(J1));a.includes("fa")||a.push("fa");const s=[".".concat(ja,":not([").concat(bt,"])")].concat(a.map(u=>".".concat(u,":not([").concat(bt,"])"))).join(", ");if(s.length===0)return Promise.resolve();let o=[];try{o=Nt(e.querySelectorAll(s))}catch{}if(o.length>0)r("pending"),i("complete");else return Promise.resolve();const l=xi.begin("onTree"),c=o.reduce((u,h)=>{try{const p=Ua(h);p&&u.push(p)}catch(p){Oa||p.name==="MissingIcon"&&console.error(p)}return u},[]);return new Promise((u,h)=>{Promise.all(c).then(p=>{Qa(p,()=>{r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),l(),u()})}).catch(p=>{l(),h(p)})})}function el(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ua(e).then(n=>{n&&Qa([n],t)})}function tl(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(t||{}).icon?t:Hr(t||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:Hr(i||{})),e(r,{...n,mask:i})}}const nl=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,symbol:r=!1,mask:i=null,maskId:a=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:p,icon:g}=e;return lr({type:"icon",...e},()=>(St("beforeDOMElementCreation",{iconDefinition:e,params:t}),P.autoA11y&&(s?c["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(o||fn()):(c["aria-hidden"]="true",c.focusable="false")),vi({icons:{main:Zr(g),mask:i?Zr(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:p,transform:{...ze,...n},symbol:r,title:s,maskId:a,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var rl={mixout(){return{icon:tl(nl)}},hooks(){return{mutationObserverCallbacks(e){return e.treeCallback=gs,e.nodeCallback=el,e}}},provides(e){e.i2svg=function(t){const{node:n=Z,callback:r=()=>{}}=t;return gs(n,r)},e.generateSvgReplacementMutation=function(t,n){const{iconName:r,title:i,titleId:a,prefix:s,transform:o,symbol:l,mask:c,maskId:u,extra:h}=n;return new Promise((p,g)=>{Promise.all([Xr(r,s),c.iconName?Xr(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(x=>{let[v,d]=x;p([t,vi({icons:{main:v,mask:d},prefix:s,iconName:r,transform:o,symbol:l,maskId:u,title:i,titleId:a,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){let{children:n,attributes:r,main:i,transform:a,styles:s}=t;const o=sr(s);o.length>0&&(r.style=o);let l;return pi(a)&&(l=st("generateAbstractTransformGrouping",{main:i,transform:a,containerWidth:i.width,iconWidth:i.width})),n.push(l||i.icon),{children:n,attributes:r}}}},il={mixout(){return{layer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=t;return lr({type:"layer"},()=>{St("beforeDOMElementCreation",{assembler:e,params:t});let r=[];return e(i=>{Array.isArray(i)?i.map(a=>{r=r.concat(a.abstract)}):r=r.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(P.cssPrefix,"-layers"),...n].join(" ")},children:r}]})}}}},sl={mixout(){return{counter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:r=[],attributes:i={},styles:a={}}=t;return lr({type:"counter",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),N1({content:e.toString(),title:n,extra:{attributes:i,styles:a,classes:["".concat(P.cssPrefix,"-layers-counter"),...r]}})))}}}},al={mixout(){return{text(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,title:r=null,classes:i=[],attributes:a={},styles:s={}}=t;return lr({type:"text",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),fs({content:e,transform:{...ze,...n},title:r,extra:{attributes:a,styles:s,classes:["".concat(P.cssPrefix,"-layers-text"),...i]}})))}}},provides(e){e.generateLayersText=function(t,n){const{title:r,transform:i,extra:a}=n;let s=null,o=null;if(ka){const l=parseInt(getComputedStyle(t).fontSize,10),c=t.getBoundingClientRect();s=c.width/l,o=c.height/l}return P.autoA11y&&!r&&(a.attributes["aria-hidden"]="true"),Promise.resolve([t,fs({content:t.innerHTML,width:s,height:o,transform:i,title:r,extra:a,watchable:!0})])}}};const ol=new RegExp('"',"ug"),ys=[1105920,1112319],vs={FontAwesome:{normal:"fas",400:"fas"},...q0,...V0,...G0},Wr=Object.keys(vs).reduce((e,t)=>(e[t.toLowerCase()]=vs[t],e),{}),ll=Object.keys(Wr).reduce((e,t)=>{const n=Wr[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e},{});function cl(e){const t=e.replace(ol,""),n=w1(t,0),r=n>=ys[0]&&n<=ys[1],i=t.length===2?t[0]===t[1]:!1;return{value:$r(i?t[0]:t),isSecondary:r||i}}function fl(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),i=isNaN(r)?"normal":r;return(Wr[n]||{})[i]||ll[n]}function xs(e,t){const n="".concat(J0).concat(t.replace(":","-"));return new Promise((r,i)=>{if(e.getAttribute(n)!==null)return r();const s=Nt(e.children).filter(p=>p.getAttribute(Fr)===t)[0],o=rt.getComputedStyle(e,t),l=o.getPropertyValue("font-family"),c=l.match(i1),u=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!c)return e.removeChild(s),r();if(c&&h!=="none"&&h!==""){const p=o.getPropertyValue("content");let g=fl(l,u);const{value:x,isSecondary:v}=cl(p),d=c[0].startsWith("FontAwesome");let y=gi(g,x),b=y;if(d){const w=A1(x);w.iconName&&w.prefix&&(y=w.iconName,g=w.prefix)}if(y&&!v&&(!s||s.getAttribute(ui)!==g||s.getAttribute(di)!==b)){e.setAttribute(n,b),s&&e.removeChild(s);const w=K1(),{extra:M}=w;M.attributes[Fr]=t,Xr(y,g).then(k=>{const E=vi({...w,icons:{main:k,mask:yi()},prefix:g,iconName:b,extra:M,watchable:!0}),R=Z.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(R,e.firstChild):e.appendChild(R),R.outerHTML=E.map(re=>gn(re)).join(` +`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function ul(e){return Promise.all([xs(e,"::before"),xs(e,"::after")])}function dl(e){return e.parentNode!==document.head&&!~t1.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Fr)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function ws(e){if(Be)return new Promise((t,n)=>{const r=Nt(e.querySelectorAll("*")).filter(dl).map(ul),i=xi.begin("searchPseudoElements");Ga(),Promise.all(r).then(()=>{i(),Yr(),t()}).catch(()=>{i(),Yr(),n()})})}var hl={hooks(){return{mutationObserverCallbacks(e){return e.pseudoElementsCallback=ws,e}}},provides(e){e.pseudoElements2svg=function(t){const{node:n=Z}=t;P.searchPseudoElements&&ws(n)}}};let bs=!1;var pl={mixout(){return{dom:{unwatch(){Ga(),bs=!0}}}},hooks(){return{bootstrap(){ps(qr("mutationObserverCallbacks",{}))},noAuto(){W1()},watch(e){const{observeMutationsRoot:t}=e;bs?Yr():ps(qr("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}};const Ss=e=>{let t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce((n,r)=>{const i=r.toLowerCase().split("-"),a=i[0];let s=i.slice(1).join("-");if(a&&s==="h")return n.flipX=!0,n;if(a&&s==="v")return n.flipY=!0,n;if(s=parseFloat(s),isNaN(s))return n;switch(a){case"grow":n.size=n.size+s;break;case"shrink":n.size=n.size-s;break;case"left":n.x=n.x-s;break;case"right":n.x=n.x+s;break;case"up":n.y=n.y-s;break;case"down":n.y=n.y+s;break;case"rotate":n.rotate=n.rotate+s;break}return n},t)};var ml={mixout(){return{parse:{transform:e=>Ss(e)}}},hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=Ss(n)),e}}},provides(e){e.generateAbstractTransformGrouping=function(t){let{main:n,transform:r,containerWidth:i,iconWidth:a}=t;const s={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(r.x*32,", ").concat(r.y*32,") "),l="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),c="rotate(".concat(r.rotate," 0 0)"),u={transform:"".concat(o," ").concat(l," ").concat(c)},h={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:u,path:h};return{tag:"g",attributes:{...p.outer},children:[{tag:"g",attributes:{...p.inner},children:[{tag:n.icon.tag,children:n.icon.children,attributes:{...n.icon.attributes,...p.path}}]}]}}}};const Mr={x:0,y:0,width:"100%",height:"100%"};function Ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function gl(e){return e.tag==="g"?e.children:[e]}var yl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),r=n?or(n.split(" ").map(i=>i.trim())):yi();return r.prefix||(r.prefix=it()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides(e){e.generateAbstractMask=function(t){let{children:n,attributes:r,main:i,mask:a,maskId:s,transform:o}=t;const{width:l,icon:c}=i,{width:u,icon:h}=a,p=p1({transform:o,containerWidth:u,iconWidth:l}),g={tag:"rect",attributes:{...Mr,fill:"white"}},x=c.children?{children:c.children.map(Ms)}:{},v={tag:"g",attributes:{...p.inner},children:[Ms({tag:c.tag,attributes:{...c.attributes,...p.path},...x})]},d={tag:"g",attributes:{...p.outer},children:[v]},y="mask-".concat(s||fn()),b="clip-".concat(s||fn()),w={tag:"mask",attributes:{...Mr,id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[g,d]},M={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:gl(h)},w]};return n.push(M,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")"),...Mr}}),{children:n,attributes:r}}}},vl={provides(e){let t=!1;rt.matchMedia&&(t=rt.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const n=[],r={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:{...r,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const a={...i,attributeName:"opacity"},s={tag:"circle",attributes:{...r,cx:"256",cy:"364",r:"28"},children:[]};return t||s.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...a,values:"1;0;1;1;0;1;"}}),n.push(s),n.push({tag:"path",attributes:{...r,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...a,values:"1;0;0;0;0;1;"}}]}),t||n.push({tag:"path",attributes:{...r,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...a,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},xl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),r=n===null?!1:n===""?!0:n;return e.symbol=r,e}}}},wl=[y1,rl,il,sl,al,hl,pl,ml,yl,vl,xl];L1(wl,{mixoutsTo:Ee});Ee.noAuto;Ee.config;Ee.library;Ee.dom;const Qr=Ee.parse;Ee.findIconDefinition;Ee.toHtml;const bl=Ee.icon;Ee.layer;Ee.text;Ee.counter;function ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Ml(e,t){if(e==null)return{};var n=Sl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gr(e){return kl(e)||El(e)||Pl(e)||Al()}function kl(e){if(Array.isArray(e))return Ur(e)}function El(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pl(e,t){if(e){if(typeof e=="string")return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(l){return Ja(e,l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.attrs.className=u,delete t.attributes.class;break;case"style":l.attrs.style=Tl(u);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?l.attrs[c.toLowerCase()]=u:l.attrs[Ka(c)]=u}return l},{attrs:{}}),a=n.style,s=a===void 0?{}:a,o=Ml(n,Ol);return i.attrs.style=Ce(Ce({},i.attrs.style),s),e.apply(void 0,[t.tag,Ce(Ce({},i.attrs),o)].concat(Gr(r)))}var eo=!1;try{eo=!0}catch{}function jl(){if(!eo&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Es(e){if(e&&Wn(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Qr.icon)return Qr.icon(e);if(e===null)return null;if(e&&Wn(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function kr(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?At({},e,t):{}}var Ps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},un=xt.forwardRef(function(e,t){var n=Ce(Ce({},Ps),e),r=n.icon,i=n.mask,a=n.symbol,s=n.className,o=n.title,l=n.titleId,c=n.maskId,u=Es(r),h=kr("classes",[].concat(Gr(Il(n)),Gr((s||"").split(" ")))),p=kr("transform",typeof n.transform=="string"?Qr.transform(n.transform):n.transform),g=kr("mask",Es(i)),x=bl(u,Ce(Ce(Ce(Ce({},h),p),g),{},{symbol:a,title:o,titleId:l,maskId:c}));if(!x)return jl("Could not find icon",u),null;var v=x.abstract,d={ref:t};return Object.keys(n).forEach(function(y){Ps.hasOwnProperty(y)||(d[y]=n[y])}),_l(v[0],d)});un.displayName="FontAwesomeIcon";un.propTypes={beat:C.bool,border:C.bool,beatFade:C.bool,bounce:C.bool,className:C.string,fade:C.bool,flash:C.bool,mask:C.oneOfType([C.object,C.array,C.string]),maskId:C.string,fixedWidth:C.bool,inverse:C.bool,flip:C.oneOf([!0,!1,"horizontal","vertical","both"]),icon:C.oneOfType([C.object,C.array,C.string]),listItem:C.bool,pull:C.oneOf(["right","left"]),pulse:C.bool,rotation:C.oneOf([0,90,180,270]),shake:C.bool,size:C.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:C.bool,spinPulse:C.bool,spinReverse:C.bool,symbol:C.oneOfType([C.bool,C.string]),title:C.string,titleId:C.string,transform:C.oneOfType([C.string,C.object]),swapOpacity:C.bool};var _l=Ja.bind(null,xt.createElement),me=function(){return me=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?ae(Dt,--Ie):0,jt--,ee===10&&(jt=1,fr--),ee}function Le(){return ee=Ie2||Jr(ee)>3?"":" "}function Zl(e,t){for(;--t&&Le()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return dr(e,Cn()+(t<6&&yt()==32&&Le()==32))}function ei(e){for(;Le();)switch(ee){case e:return Ie;case 34:case 39:e!==34&&e!==39&&ei(ee);break;case 40:e===41&&ei(e);break;case 92:Le();break}return Ie}function Xl(e,t){for(;Le()&&e+ee!==57;)if(e+ee===84&&yt()===47)break;return"/*"+dr(t,Ie-1)+"*"+Si(e===47?e:Le())}function Bl(e){for(;!Jr(yt());)Le();return dr(e,Ie)}function Yl(e){return ql(Fn("",null,null,null,[""],e=Vl(e),0,[0],e))}function Fn(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,h=s,p=0,g=0,x=0,v=1,d=1,y=1,b=0,w="",M=i,k=a,E=r,R=w;d;)switch(x=b,b=Le()){case 40:if(x!=108&&ae(R,h-1)==58){_n(R+=j(Er(b),"&","&\f"),"&\f",ro(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:R+=Er(b);break;case 9:case 10:case 13:case 32:R+=Hl(x);break;case 92:R+=Zl(Cn()-1,7);continue;case 47:switch(yt()){case 42:case 47:Ut(Wl(Xl(Le(),Cn()),t,n,l),l);break;default:R+="/"}break;case 123*v:o[c++]=Fe(R)*y;case 125*v:case 59:case 0:switch(b){case 0:case 125:d=0;case 59+u:y==-1&&(R=j(R,/\f/g,"")),g>0&&Fe(R)-h&&Ut(g>32?Rs(R+";",r,n,h-1,l):Rs(j(R," ","")+";",r,n,h-2,l),l);break;case 59:R+=";";default:if(Ut(E=Is(R,t,n,c,u,i,o,w,M=[],k=[],h,a),a),b===123)if(u===0)Fn(R,t,E,E,M,a,h,o,k);else switch(p===99&&ae(R,3)===110?100:p){case 100:case 108:case 109:case 115:Fn(e,E,E,r&&Ut(Is(e,E,E,0,0,i,o,w,i,M=[],h,k),k),i,k,h,o,r?M:k);break;default:Fn(R,E,E,E,[""],k,0,o,k)}}c=u=g=0,v=y=1,w=R="",h=s;break;case 58:h=1+Fe(R),g=x;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&$l()==125)continue}switch(R+=Si(b),b*v){case 38:y=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Fe(R)-1)*y,y=1;break;case 64:yt()===45&&(R+=Er(Le())),p=yt(),u=h=Fe(w=R+=Bl(Cn())),b++;break;case 45:x===45&&Fe(R)==2&&(v=0)}}return a}function Is(e,t,n,r,i,a,s,o,l,c,u,h){for(var p=i-1,g=i===0?a:[""],x=so(g),v=0,d=0,y=0;v0?g[b]+" "+w:j(w,/&\f/g,g[b])))&&(l[y++]=M);return ur(e,t,n,i===0?cr:o,l,c,u,h)}function Wl(e,t,n,r){return ur(e,t,n,to,Si(Dl()),Tt(e,2,-2),0,r)}function Rs(e,t,n,r,i){return ur(e,t,n,bi,Tt(e,0,r),Tt(e,r+1,-1),r,i)}function oo(e,t,n){switch(zl(e,t)){case 5103:return N+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return N+e+e;case 4789:return rn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return N+e+rn+e+q+e+e;case 5936:switch(ae(e,t+11)){case 114:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return N+e+q+e+e;case 6165:return N+e+q+"flex-"+e+e;case 5187:return N+e+j(e,/(\w+).+(:[^]+)/,N+"box-$1$2"+q+"flex-$1$2")+e;case 5443:return N+e+q+"flex-item-"+j(e,/flex-|-self/g,"")+(Ve(e,/flex-|baseline/)?"":q+"grid-row-"+j(e,/flex-|-self/g,""))+e;case 4675:return N+e+q+"flex-line-pack"+j(e,/align-content|flex-|-self/g,"")+e;case 5548:return N+e+q+j(e,"shrink","negative")+e;case 5292:return N+e+q+j(e,"basis","preferred-size")+e;case 6060:return N+"box-"+j(e,"-grow","")+N+e+q+j(e,"grow","positive")+e;case 4554:return N+j(e,/([^-])(transform)/g,"$1"+N+"$2")+e;case 6187:return j(j(j(e,/(zoom-|grab)/,N+"$1"),/(image-set)/,N+"$1"),e,"")+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,N+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,N+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+N+e+e;case 4200:if(!Ve(e,/flex-|baseline/))return q+"grid-column-align"+Tt(e,t)+e;break;case 2592:case 3360:return q+j(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Ve(r.props,/grid-\w+-end/)})?~_n(e+(n=n[t].value),"span",0)?e:q+j(e,"-start","")+e+q+"grid-row-span:"+(~_n(n,"span",0)?Ve(n,/\d+/):+Ve(n,/\d+/)-+Ve(e,/\d+/))+";":q+j(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Ve(r.props,/grid-\w+-start/)})?e:q+j(j(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,N+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Fe(e)-1-t>6)switch(ae(e,t+1)){case 109:if(ae(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+rn+(ae(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_n(e,"stretch",0)?oo(j(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return j(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,s,o,l,c){return q+i+":"+a+c+(s?q+i+"-span:"+(o?l:+l-+a)+c:"")+e});case 4949:if(ae(e,t+6)===121)return j(e,":",":"+N)+e;break;case 6444:switch(ae(e,ae(e,14)===45?18:11)){case 120:return j(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+N+(ae(e,14)===45?"inline-":"")+"box$3$1"+N+"$2$3$1"+q+"$2box$3")+e;case 100:return j(e,":",":"+q)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return j(e,"scroll-","scroll-snap-")+e}return e}function Gn(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case bi:e.return=oo(e.value,e.length,n);return;case no:return Gn([et(e,{value:j(e.value,"@","@"+N)})],r);case cr:if(e.length)return Nl(n=e.props,function(i){switch(Ve(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":kt(et(e,{props:[j(i,/:(read-\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break;case"::placeholder":kt(et(e,{props:[j(i,/:(plac\w+)/,":"+N+"input-$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,q+"input-$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break}return""})}}var Jl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},we={},_t=typeof process<"u"&&we!==void 0&&(we.REACT_APP_SC_ATTR||we.SC_ATTR)||"data-styled",lo="active",co="data-styled-version",hr="6.1.12",Mi=`/*!sc*/ +`,Un=typeof window<"u"&&"HTMLElement"in window,ec=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==""?we.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&we.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.SC_DISABLE_SPEEDY!==void 0&&we.SC_DISABLE_SPEEDY!==""&&we.SC_DISABLE_SPEEDY!=="false"&&we.SC_DISABLE_SPEEDY),pr=Object.freeze([]),Ct=Object.freeze({});function tc(e,t,n){return n===void 0&&(n=Ct),e.theme!==n.theme&&e.theme||t||n.theme}var fo=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),nc=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,rc=/(^-|-$)/g;function Os(e){return e.replace(nc,"-").replace(rc,"")}var ic=/(a)(d)/gi,Pn=52,Ls=function(e){return String.fromCharCode(e+(e>25?39:97))};function ti(e){var t,n="";for(t=Math.abs(e);t>Pn;t=t/Pn|0)n=Ls(t%Pn)+n;return(Ls(t%Pn)+n).replace(ic,"$1-$2")}var Pr,uo=5381,It=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ho=function(e){return It(uo,e)};function sc(e){return ti(ho(e)>>>0)}function ac(e){return e.displayName||e.name||"Component"}function Ar(e){return typeof e=="string"&&!0}var po=typeof Symbol=="function"&&Symbol.for,mo=po?Symbol.for("react.memo"):60115,oc=po?Symbol.for("react.forward_ref"):60112,lc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},go={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fc=((Pr={})[oc]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pr[mo]=go,Pr);function Ts(e){return("type"in(t=e)&&t.type.$$typeof)===mo?go:"$$typeof"in e?fc[e.$$typeof]:lc;var t}var uc=Object.defineProperty,dc=Object.getOwnPropertyNames,js=Object.getOwnPropertySymbols,hc=Object.getOwnPropertyDescriptor,pc=Object.getPrototypeOf,_s=Object.prototype;function yo(e,t,n){if(typeof t!="string"){if(_s){var r=pc(t);r&&r!==_s&&yo(e,r,n)}var i=dc(t);js&&(i=i.concat(js(t)));for(var a=Ts(e),s=Ts(t),o=0;o0?" Args: ".concat(t.join(", ")):""))}var mc=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;t>=a;)if((a<<=1)<0)throw yn(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=i;s=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),a=i+r,s=i;s=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(d+="".concat(y,","))}),l+="".concat(x).concat(v,'{content:"').concat(d,'"}').concat(Mi)},u=0;u0?".".concat(t):p},u=l.slice();u.push(function(p){p.type===cr&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(Pc,n).replace(r,c))}),s.prefix&&u.push(Kl),u.push(Ql);var h=function(p,g,x,v){g===void 0&&(g=""),x===void 0&&(x=""),v===void 0&&(v="&"),t=v,n=g,r=new RegExp("\\".concat(n,"\\b"),"g");var d=p.replace(Ac,""),y=Yl(x||g?"".concat(x," ").concat(g," { ").concat(d," }"):d);s.namespace&&(y=wo(y,s.namespace));var b=[];return Gn(y,Gl(u.concat(Ul(function(w){return b.push(w)})))),b};return h.hash=l.length?l.reduce(function(p,g){return g.name||yn(15),It(p,g.name)},uo).toString():"",h}var Rc=new xo,ri=Ic(),bo=xt.createContext({shouldForwardProp:void 0,styleSheet:Rc,stylis:ri});bo.Consumer;xt.createContext(void 0);function Ns(){return D.useContext(bo)}var Oc=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=ri);var s=r.name+a.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,a(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Ei(this,function(){throw yn(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ri),this.name+t.hash},e}(),Lc=function(e){return e>="A"&&e<="Z"};function Ds(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,s)){var o=r(a,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,o)}i=dt(i,s),this.staticRulesId=s}else{for(var l=It(this.baseHash,r.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,g)||n.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=dt(i,g)}}return i},e}(),ko=xt.createContext(void 0);ko.Consumer;var Ir={};function Cc(e,t,n){var r=ki(e),i=e,a=!Ar(e),s=t.attrs,o=s===void 0?pr:s,l=t.componentId,c=l===void 0?function(M,k){var E=typeof M!="string"?"sc":Os(M);Ir[E]=(Ir[E]||0)+1;var R="".concat(E,"-").concat(sc(hr+E+Ir[E]));return k?"".concat(k,"-").concat(R):R}(t.displayName,t.parentComponentId):l,u=t.displayName,h=u===void 0?function(M){return Ar(M)?"styled.".concat(M):"Styled(".concat(ac(M),")")}(e):u,p=t.displayName&&t.componentId?"".concat(Os(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,x=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var d=t.shouldForwardProp;x=function(M,k){return v(M,k)&&d(M,k)}}else x=v}var y=new _c(n,p,r?i.componentStyle:void 0);function b(M,k){return function(E,R,re){var X=E.attrs,ie=E.componentStyle,le=E.defaultProps,$=E.foldedComponentIds,F=E.styledComponentId,T=E.target,Q=xt.useContext(ko),Te=Ns(),te=E.shouldForwardProp||Te.shouldForwardProp,Pe=tc(R,Q,le)||Ct,B=function(xn,$t,wn){for(var Vt,at=me(me({},$t),{className:void 0,theme:wn}),mr=0;mre?"2px 8px 8px 2px":"8px 2px 2px 8px"}; + } + + &:last-child { + border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; + } +`,de=U.div` + background-color: ${({$pressed:e})=>e?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"}; + border: none; + display: flex; + align-items: center; + justify-content: center; + color: white; + border-radius: 5px; + font-size: 14px; + font-family: Arial, sans-serif; + height: 20px; + width: 20px; + transition: all 0.2s ease-in-out; +`,Po=U.div` + display: flex; + align-items: center; + height: 24px; + margin-bottom: 2px; + justify-content: flex-start; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; +`,zt=U.div` + display: flex; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; + height: 100%; + justify-content: space-between; + align-items: center; +`;U.button` + background-color: rgba(255, 255, 255, 0.3); + border: none; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + pointer-events: none; + width: 50px; + height: 50px; + border-radius: 50%; + position: relative; + margin: 0 5px; + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); +`;U.div` + position: absolute; + background-color: white; + border-radius: 50%; + width: 36px; + height: 36px; + cursor: pointer; + pointer-events: auto; +`;const Ao=U.input.attrs({type:"range"})` + -webkit-appearance: none; + appearance: none; + background-color: rgba(255, 255, 255, 0.3); + border: none; + height: 100%; + width: 49px; + cursor: pointer; + margin: 0 1px; + transition: all 0.2s ease-in-out; + border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; + + &::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } + + &::-moz-range-thumb { + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } + + &::-ms-thumb { + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } +`,zc=U.div` + display: flex; + flex-direction: column; + align-items: ${({$reverse:e})=>e?"flex-start":"flex-end"}; + justify-content: center; + margin: ${({$reverse:e})=>e?"2px -26px 0 0":"2px 0 0 -26px"}; +`,qs=U.div` + display: flex; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; + align-items: center; + justify-content: center; +`;U.div` + display: flex; + flex-direction: column; + height: 50px; + justify-content: space-between; +`;const K=U(un)` + height: 14px; + min-height: 14px; + max-height: 14px; + width: 14px; + min-width: 14px; + max-width: 14px; +`,Nc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),Dc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),$c=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),Vc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Hc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Zc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Xc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Bc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Yc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Wc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Gc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Uc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Kc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),Jc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),e2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),t2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),n2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),r2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),i2={"x-button-left":Nc,"y-button-left":Dc,"a-button-right":$c,"b-button-right":Vc,"thumbstick-left":qc,"thumbstick-up-left":Zc,"thumbstick-down-left":Xc,"thumbstick-right-left":Yc,"thumbstick-left-left":Bc,"thumbstick-right":Hc,"thumbstick-up-right":Wc,"thumbstick-down-right":Qc,"thumbstick-right-right":Uc,"thumbstick-left-right":Gc,"trigger-left":e2,"trigger-right":t2,"squeeze-left":Kc,"squeeze-right":Jc,"thumbrest-left":n2,"thumbrest-right":r2},hn=({buttonName:e,handedness:t})=>{const n=`${e}-${t}`,r=i2[n];return r?f.jsx(r,{}):f.jsx("div",{style:{width:"28px",height:"28px"}})},s2=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M1 11.2A5.2 5.2 0 0 1 6.2 6h15.6a5.2 5.2 0 0 1 5.2 5.2v5.2a5.2 5.2 0 0 1-5.2 5.2h-3.109c-1.149 0-2.199-.65-2.713-1.677l-.199-.398a1.733 1.733 0 0 0-1.55-.958h-.458c-.656 0-1.257.37-1.55.958l-.2.398A3.033 3.033 0 0 1 9.31 21.6H6.2A5.2 5.2 0 0 1 1 16.4v-5.2Zm9.1 2.167a2.6 2.6 0 1 1-5.2 0 2.6 2.6 0 0 1 5.2 0Zm15.538-1.426a.498.498 0 0 0 .141-.542l.002-.002a5.456 5.456 0 0 0-.347-.755l-.104-.178a5.586 5.586 0 0 0-.486-.686.502.502 0 0 0-.54-.15l-1.225.39a4.234 4.234 0 0 0-.968-.56l-.275-1.256a.497.497 0 0 0-.4-.392 5.686 5.686 0 0 0-1.871.003.497.497 0 0 0-.4.391l-.276 1.257a4.234 4.234 0 0 0-.968.559l-1.226-.39a.498.498 0 0 0-.539.15 5.586 5.586 0 0 0-.486.686l-.104.179c-.134.242-.25.492-.347.754a.498.498 0 0 0 .14.542l.953.867a4.26 4.26 0 0 0 0 1.12l-.952.867a.498.498 0 0 0-.141.541c.097.262.213.513.347.755l.104.178c.145.242.308.471.486.687.13.156.346.211.54.15l1.223-.392c.295.226.62.416.968.559l.275 1.256c.044.2.198.359.4.392a5.686 5.686 0 0 0 1.871 0 .497.497 0 0 0 .4-.392l.276-1.256c.347-.143.673-.333.968-.56l1.225.39c.194.062.41.009.54-.15a5.59 5.59 0 0 0 .486-.686l.103-.178a5.45 5.45 0 0 0 .348-.755.498.498 0 0 0-.14-.541l-.954-.867a4.258 4.258 0 0 0 0-1.118l.953-.867ZM20.5 15.967a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})}),a2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),o2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),l2={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Pi={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},c2={prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]},f2={prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]},Hs={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},u2={prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]},Io={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]},d2={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},h2={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},p2={prefix:"fas",iconName:"square-arrow-up-right",icon:[448,512,["external-link-square"],"f14c","M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]},m2={prefix:"fas",iconName:"keyboard",icon:[576,512,[9e3],"f11c","M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]},Ro={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]},g2={prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Zs={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},y2={prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]},v2={prefix:"fas",iconName:"arrows-up-down",icon:[320,512,["arrows-v"],"f07d","M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]},x2={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},qe={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:f.jsx(K,{icon:u2}),Backspace:f.jsx(K,{icon:g2}),Enter:f.jsx(K,{style:{transform:"rotate(90deg)"},icon:y2}),ShiftLeft:f.jsx(K,{icon:Zs}),ShiftRight:f.jsx(K,{icon:Zs}),Space:" ",ArrowUp:f.jsx(K,{icon:Io}),ArrowDown:f.jsx(K,{icon:Ro}),ArrowLeft:f.jsx(K,{icon:f2}),ArrowRight:f.jsx(K,{icon:c2}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:f.jsx(a2,{}),MouseRight:f.jsx(o2,{})},w2={left:{"thumbstick-up":"KeyW","thumbstick-down":"KeyS","thumbstick-left":"KeyA","thumbstick-right":"KeyD",thumbstick:"KeyR","x-button":"KeyX","y-button":"KeyZ",trigger:"KeyQ",squeeze:"KeyE"},right:{"thumbstick-up":"ArrowUp","thumbstick-down":"ArrowDown","thumbstick-left":"ArrowLeft","thumbstick-right":"ArrowRight",thumbstick:"Slash","a-button":"Enter","b-button":"ShiftRight",trigger:"MouseLeft",squeeze:"MouseRight"}},b2=U.div` + display: flex; + justify-content: space-between; + pointer-events: all; + position: fixed; + display: flex; + top: 40px; + left: calc(50vw - 156px); + width: 312px; +`,Xs=U.div` + display: flex; + flex-direction: column; + width: 50%; +`,Bs=U.div` + display: flex; + height: 24px; + align-items: center; + margin-bottom: 2px; +`,S2=({keyMap:e,setKeyMap:t})=>{const[n,r]=D.useState(null),i=(s,o)=>{r({controller:s,action:o})},a=(s,o)=>{t(l=>({...l,[s]:{...l[s],[o]:"Unmapped"}}))};return D.useEffect(()=>{const s=c=>{n&&qe[c.code]&&(t(u=>({...u,[n.controller]:{...u[n.controller],[n.action]:c.code}})),r(null))},o=c=>{if(n){const u=c.button===0?"MouseLeft":c.button===2?"MouseRight":null;u&&qe[u]&&(t(h=>({...h,[n.controller]:{...h[n.controller],[n.action]:u}})),r(null))}},l=c=>{c.preventDefault()};return window.addEventListener("keydown",s),window.addEventListener("mousedown",o),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("mousedown",o),window.removeEventListener("contextmenu",l)}},[n,t]),f.jsxs(b2,{children:[f.jsx(Xs,{children:Object.keys(e.left).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"left"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="left"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("left",s),onContextMenu:o=>o.preventDefault(),children:e.left[s]}),f.jsx(oe,{style:{width:"24px"},$reverse:!1,onClick:()=>a("left",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))}),f.jsx(Xs,{children:Object.keys(e.right).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"right"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="right"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("right",s),onContextMenu:o=>o.preventDefault(),children:e.right[s]}),f.jsx(oe,{$reverse:!1,style:{width:"24px"},onClick:()=>a("right",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))})]})},M2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(0),p=e.inputSource.handedness;return D.useEffect(()=>{const g=y=>{y.code===r&&(e.updateButtonValue(t,1),c(!0))},x=y=>{y.code===r&&(e.updateButtonValue(t,0),c(!1))},v=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,1),c(!0))},d=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,0),c(!1))};return n?r==="MouseLeft"||r==="MouseRight"?(window.addEventListener("mousedown",v),window.addEventListener("mouseup",d)):(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x))}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:l,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{o(!0),e.updateButtonValue(t,1),setTimeout(()=>{o(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ao,{$reverse:p==="right",value:u,onChange:g=>{const x=Number(g.target.value);h(x),e.updateButtonValue(t,x/100)},min:"0",max:"100"})]})})]})},k2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(!1),p=e.inputSource.handedness;return D.useEffect(()=>{const g=v=>{v.code===r&&(e.updateButtonValue(t,1),h(!0))},x=v=>{v.code===r&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:u,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:l?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout(()=>{c(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{o(!s),e.updateButtonValue(t,s?0:1)},children:"Hold"})]})})]})},E2=U.div` + display: flex; + align-items: center; + margin-bottom: 2px; +`,P2=U.button` + background-color: rgba(255, 255, 255, 0.3); + border: none; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + pointer-events: none; + width: 50px; + height: 50px; + border-radius: 50%; + position: relative; + margin: 0 5px; + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); +`,A2=U.div` + position: absolute; + background-color: white; + border-radius: 50%; + width: 36px; + height: 36px; + cursor: pointer; + pointer-events: auto; +`,Ys=U(oe)` + width: 49px; + font-size: 14px; + + ${({$reverse:e})=>e?` + &:first-child { + margin-left: 1px; + border-radius: 2px 8px 8px 2px; + } + + &:last-child { + margin-right: 1px; + border-radius: 8px 2px 2px 8px; + } + `:` + &:first-child { + margin-right: 1px; + border-radius: 8px 2px 2px 8px; + } + + &:last-child { + margin-left: 1px; + border-radius: 2px 8px 8px 2px; + } + `} +`,I2=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:r,mappedKeyDown:i,mappedKeyLeft:a,mappedKeyRight:s,mappedKeyPressed:o})=>{const l=D.useRef(null),[c,u]=D.useState(!1),[h,p]=D.useState(!1),[g,x]=D.useState(!1),[v,d]=D.useState(!1),[y,b]=D.useState({x:0,y:0}),[w,M]=D.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),k=e.inputSource.handedness,E=()=>{if(l.current){const X=l.current.getBoundingClientRect();b({x:X.left+X.width/2,y:X.top+X.height/2}),u(!0)}},R=X=>{if(c&&l.current){const ie=X.clientX-y.x,le=X.clientY-y.y,$=Math.sqrt(ie*ie+le*le),F=12;let T,Q;if(${u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return D.useEffect(()=>{const X=$=>{const F={...w};$.code===r&&(F.up=!0),$.code===i&&(F.down=!0),$.code===a&&(F.left=!0),$.code===s&&(F.right=!0),$.code===o&&(F.pressed=!0,e.updateButtonValue(n,1)),M(F),le(F)},ie=$=>{const F={...w};$.code===r&&(F.up=!1),$.code===i&&(F.down=!1),$.code===a&&(F.left=!1),$.code===s&&(F.right=!1),$.code===o&&(F.pressed=!1,e.updateButtonValue(n,0)),M(F),le(F)},le=$=>{const F=($.right?1:0)-($.left?1:0),T=($.down?1:0)-($.up?1:0),Q=Math.sqrt(F*F+T*T);if(Q===0){e.updateAxes(n,0,0);return}const Te=F/Q,te=T/Q;e.updateAxes(n,Te,te)};return t?(window.addEventListener("keydown",X),window.addEventListener("keyup",ie)):(window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)}},[r,i,a,s,t,w]),D.useEffect(()=>(document.addEventListener("mousemove",R),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",re)}),[c,y]),f.jsxs(E2,{style:{flexDirection:e.inputSource.handedness==="left"?"row":"row-reverse",alignItems:"flex-start"},children:[f.jsx(hn,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),t?f.jsxs(zc,{$reverse:k==="right",children:[f.jsxs(qs,{$reverse:k==="right",children:[f.jsx(de,{$pressed:w.up,style:{margin:"2px"},children:qe[r]}),f.jsx(de,{$pressed:w.pressed,style:{margin:"2px"},children:qe[o]})]}),f.jsxs(qs,{$reverse:!1,children:[f.jsx(de,{$pressed:w.left,style:{margin:"2px"},children:qe[a]}),f.jsx(de,{$pressed:w.down,style:{margin:"2px"},children:qe[i]}),f.jsx(de,{$pressed:w.right,style:{margin:"2px"},children:qe[s]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(P2,{style:{margin:e.inputSource.handedness==="left"?"0 5px 0 -3px":"0 -3px 0 5px"},children:f.jsx(A2,{ref:l,onMouseDown:E})}),f.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[f.jsx(oe,{$reverse:k==="right",style:{backgroundColor:v?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"80px",marginBottom:"2px",borderRadius:"8px"},onClick:()=>{d(!0),e.updateButtonValue(n,1),setTimeout(()=>{d(!1),e.updateButtonValue(n,0)},500)},children:"Press"}),f.jsxs(zt,{$reverse:k==="right",children:[f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:h?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{p(!h),e.updateButtonTouch(n,!h)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:g?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{x(!g),e.updateButtonValue(n,g?0:1)},children:"Hold"})]})]})]})]})},R2=U.div` + padding: ${({$reverse:e})=>e?"6px 2px 3px 5px":"6px 5px 3px 2px"}; + pointer-events: all; + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border-radius: ${({$reverse:e})=>e?"12px 0 0 0":"0 12px 0 0"}; +`;function O2(e){const t=new Set;for(const r of e.axes)r&&r.id&&t.add(r.id);const n=e.buttons.filter(r=>r!==null).map(r=>({id:r.id,type:r.type,hasAxes:t.has(r.id)}));return n.sort((r,i)=>r.hasAxes&&!i.hasAxes?-1:!r.hasAxes&&i.hasAxes?1:0),n}const L2=({xrDevice:e,keyMap:t,pointerLocked:n})=>f.jsx("div",{style:{display:"flex",justifyContent:"space-between",flexDirection:"row"},children:Object.entries(e.controllers).map(([r,i])=>f.jsx(R2,{$reverse:r!=="left",children:O2(i.gamepadConfig).map(a=>{const s=t[r];return a.hasAxes?f.jsx(I2,{xrController:i,pointerLocked:n,buttonId:a.id,mappedKeyUp:t[r][`${a.id}-up`],mappedKeyDown:s[`${a.id}-down`],mappedKeyLeft:s[`${a.id}-left`],mappedKeyRight:s[`${a.id}-right`],mappedKeyPressed:s[a.id]},a.id):a.type==="analog"?f.jsx(M2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id):f.jsx(k2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id)})},r))}),T2=U.div` + display: flex; + justify-content: center; + pointer-events: all; + position: fixed; + display: flex; + top: 40px; + left: calc(50vw - 156px); + width: 312px; +`,j2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(e.fovy);return f.jsx(T2,{children:f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,disabled:!0,children:"FOV-Y"}),f.jsx(Ao,{$reverse:!1,value:n,style:{width:"100px",borderRadius:"2px"},onChange:i=>{const a=Number(i.target.value);r(a),e.fovy=a,t.syncFovy(),t.renderScene()},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48}),f.jsxs(oe,{$reverse:!1,disabled:!0,children:[(n/Math.PI*180).toFixed(2),"°"]})]})})},_2=U.div` + padding: 6px 5px; + display: flex; + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + justify-content: center; + pointer-events: all; + border-radius: 0 0 12px 12px; + align-items: center; + height: 24px; +`,Ws=U.div` + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border: none; + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: center; + cursor: pointer; + color: white; + white-space: nowrap; + font-size: 14px; + text-transform: none; + box-shadow: none; + font-family: Arial, sans-serif; + border-radius: ${({$reverse:e})=>e?"0 0 0 12px":"0 0 12px 0"}; + padding: 5px; + + > div { + display: flex; + flex-direction: row; + align-items: center; + gap: 2px; + margin: 2px; + } +`,C2=({xrDevice:e,inputLayer:t,keyMapOpen:n,setKeyMapOpen:r,fovSettingOpen:i,setFovSettingOpen:a})=>f.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[f.jsxs(_2,{children:[f.jsx(s2,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",marginLeft:"4px"},children:[f.jsx(oe,{$reverse:!1,onClick:()=>{t.resetDeviceTransforms()},children:f.jsx(K,{icon:d2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{t.lockPointer(),r(!1),a(!1)},children:f.jsx(K,{icon:h2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{r(!n),a(!1)},children:f.jsx(K,{icon:m2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{a(!i),r(!1)},children:f.jsx(K,{icon:x2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{const s=e.activeSession;s==null||s.end()},children:f.jsx(K,{icon:l2})})]})]}),f.jsxs(Ws,{$reverse:!1,style:{position:"fixed",left:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:p2,style:{marginRight:"4px"}})," ","Roomscale Movement"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:"W"}),f.jsx(de,{$pressed:!1,children:"A"}),f.jsx(de,{$pressed:!1,children:"S"}),f.jsx(de,{$pressed:!1,children:"D"})]})]}),f.jsxs(Ws,{$reverse:!0,style:{position:"fixed",right:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:v2,style:{marginRight:"4px"}})," Camera Height"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Io})}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Ro})})]})]})]}),lt=new Lo,fe=new z,Ue=new z,Y=new Ae,Qs={X:new z(1,0,0),Y:new z(0,1,0),Z:new z(0,0,1)},Rr={type:"change"},Gs={type:"mouseDown"},Us={type:"mouseUp",mode:null},Ks={type:"objectChange"};class Js extends Lr{constructor(t,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const r=new V2;this._gizmo=r,this.add(r);const i=new q2;this._plane=i,this.add(i);const a=this;function s(b,w){let M=w;Object.defineProperty(a,b,{get:function(){return M!==void 0?M:w},set:function(k){M!==k&&(M=k,i[b]=k,r[b]=k,a.dispatchEvent({type:b+"-changed",value:k}),a.dispatchEvent(Rr))}}),a[b]=w,i[b]=w,r[b]=w}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new z,l=new z,c=new Ae,u=new Ae,h=new z,p=new Ae,g=new z,x=new z,v=new z,d=0,y=new z;s("worldPosition",o),s("worldPositionStart",l),s("worldQuaternion",c),s("worldQuaternionStart",u),s("cameraPosition",h),s("cameraQuaternion",p),s("pointStart",g),s("pointEnd",x),s("rotationAxis",v),s("rotationAngle",d),s("eye",y),this._offset=new z,this._startNorm=new z,this._endNorm=new z,this._cameraScale=new z,this._parentPosition=new z,this._parentQuaternion=new Ae,this._parentQuaternionInv=new Ae,this._parentScale=new z,this._worldScaleStart=new z,this._worldQuaternionInv=new Ae,this._worldScale=new z,this._positionStart=new z,this._quaternionStart=new Ae,this._scaleStart=new z,this._getPointer=F2.bind(this),this._onPointerDown=N2.bind(this),this._onPointerHover=z2.bind(this),this._onPointerMove=D2.bind(this),this._onPointerUp=$2.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(t){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(t)}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&<.setFromCamera(t,this.camera);const n=Or(this._gizmo.picker[this.mode],lt);n?this.axis=n.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&<.setFromCamera(t,this.camera);const n=Or(this._plane,lt,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Gs.mode=this.mode,this.dispatchEvent(Gs)}}pointerMove(t){const n=this.axis,r=this.mode,i=this.object;let a=this.space;if(r==="scale"?a="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(a="world"),i===void 0||n===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&<.setFromCamera(t,this.camera);const s=Or(this._plane,lt,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),a==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(i.position.applyQuaternion(Y.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),a==="world"&&(i.parent&&i.position.add(fe.setFromMatrixPosition(i.parent.matrixWorld)),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(fe.setFromMatrixPosition(i.parent.matrixWorld))));else if(r==="scale"){if(n.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ue.set(o,o,o)}else fe.copy(this.pointStart),Ue.copy(this.pointEnd),fe.applyQuaternion(this._worldQuaternionInv),Ue.applyQuaternion(this._worldQuaternionInv),Ue.divide(fe),n.search("X")===-1&&(Ue.x=1),n.search("Y")===-1&&(Ue.y=1),n.search("Z")===-1&&(Ue.z=1);i.scale.copy(this._scaleStart).multiply(Ue),this.scaleSnap&&(n.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(fe.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(fe.copy(this.rotationAxis).cross(this.eye))*o):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Qs[n]),fe.copy(Qs[n]),a==="local"&&fe.applyQuaternion(this.worldQuaternion),fe.cross(this.eye),fe.length()===0?l=!0:this.rotationAngle=this._offset.dot(fe.normalize())*o),(n==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),a==="local"&&n!=="E"&&n!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Rr),this.dispatchEvent(Ks)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Us.mode=this.mode,this.dispatchEvent(Us)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Rr),this.dispatchEvent(Ks),this.pointStart.copy(this.pointEnd))}getRaycaster(){return lt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function F2(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function z2(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e));break}}function N2(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function D2(e){this.enabled&&this.pointerMove(this._getPointer(e))}function $2(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Or(e,t,n){const r=t.intersectObject(e,!0);for(let i=0;i.9&&(s.visible=!1)),this.axis==="Y"&&(Y.setFromEuler(In.set(0,0,Math.PI/2)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),V.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(ta.lookAt(ea,V,ft)),s.quaternion.multiply(Y),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(fe),s.visible=this.dragging):(s.quaternion.copy(r),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&(Rn.copy(r),V.copy(this.eye).applyQuaternion(Y.copy(r).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(ta.lookAt(this.eye,ea,ft)),s.name==="X"&&(Y.setFromAxisAngle(Kt,Math.atan2(-V.y,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Y"&&(Y.setFromAxisAngle(ft,Math.atan2(V.x,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Z"&&(Y.setFromAxisAngle(Jt,Math.atan2(V.y,V.x)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(l){return s.name===l}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(t)}}class q2 extends A{constructor(){super(new Co(1e5,1e5,2,2),new si({visible:!1,wireframe:!0,side:Fo,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),On.copy(Kt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Yt.copy(ft).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Wt.copy(Jt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),V.copy(Yt),this.mode){case"translate":case"scale":switch(this.axis){case"X":V.copy(this.eye).cross(On),_e.copy(On).cross(V);break;case"Y":V.copy(this.eye).cross(Yt),_e.copy(Yt).cross(V);break;case"Z":V.copy(this.eye).cross(Wt),_e.copy(Wt).cross(V);break;case"XY":_e.copy(Wt);break;case"YZ":_e.copy(On);break;case"XZ":V.copy(Wt),_e.copy(Yt);break;case"XYZ":case"E":_e.set(0,0,0);break}break;case"rotate":default:_e.set(0,0,0)}_e.length()===0?this.quaternion.copy(this.cameraQuaternion):(na.lookAt(fe.set(0,0,0),_e,V),this.quaternion.setFromRotationMatrix(na)),super.updateMatrixWorld(t)}}const O=Symbol("@@iwer/devui/input-scene"),H2=.016;class Z2{constructor(t){const n=t.canvasContainer,r=new zo,i=new No(t.fovy/Math.PI*180,n.offsetWidth/n.offsetHeight,.1,1e3),a=new Ri,s=new Ri;r.add(a),a.add(s),s.position.fromArray(t.position.vec3),s.quaternion.fromArray(t.quaternion.quat),s.add(i),i.position.x-=t.ipd/2;const o=new A(new ce(.1,.1,.1)),l=o.clone();o.position.fromArray(t.controllers.left.position.vec3),o.quaternion.fromArray(t.controllers.left.quaternion.quat),l.position.fromArray(t.controllers.right.position.vec3),l.quaternion.fromArray(t.controllers.right.quaternion.quat),s.attach(o),s.attach(l),o.visible=!1,l.visible=!1;const c=new A(new Do(.25,.27,32),new si({color:16777215,side:$o}));c.rotateX(-Math.PI/2),r.add(c);const u=new Vo({alpha:!0});u.setSize(n.offsetWidth,n.offsetHeight),u.setClearColor(0,0),n.appendChild(u.domElement);const h=new Js(i,u.domElement);h.attach(o),r.add(h);const p=new Js(i,u.domElement);p.attach(l),r.add(p);const g=new ResizeObserver(()=>{this.resize()});g.observe(n);const x=d=>{d.addEventListener("mouseDown",()=>{d.userData.pressStart=performance.now()}),d.addEventListener("mouseUp",()=>{const y=performance.now()-d.userData.pressStart;d.userData.pressStart=null,y<200&&(d.mode==="rotate"?d.setMode("translate"):d.setMode("rotate"))}),d.addEventListener("change",()=>{this.renderScene()})};x(h),x(p);const v=d=>{if(!this[O].isPointerLocked)return;const y=d.movementX||d.mozMovementX||d.webkitMovementX||0,b=d.movementY||d.mozMovementY||d.webkitMovementY||0;a.rotation.y-=y*.002,s.rotation.x-=b*.002,t.quaternion.copy(s.getWorldQuaternion(new Ae)),this.renderScene()};this[O]={canvasContainer:n,renderer:u,scene:r,camera:i,playerRig:a,cameraRig:s,xrDevice:t,controllerIndicators:{left:o,right:l},transformControls:{left:h,right:p},headsetDefaultPosition:s.position.clone(),headsetDefaultQuaternion:s.quaternion.clone(),controllerDefaultPositions:{left:o.position.clone(),right:l.position.clone()},controllerDefaultQuaternions:{left:o.quaternion.clone(),right:l.quaternion.clone()},resizeObserver:g,isPointerLocked:!1,vec3:new z,quat:new Ae,mouseMoveHandler:v,keyState:{ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},movePlayerRig:()=>this.movePlayerRig(),moveInterval:null},document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){this[O].renderer.domElement.requestPointerLock=this[O].renderer.domElement.requestPointerLock||this[O].renderer.domElement.mozRequestPointerLock||this[O].renderer.domElement.webkitRequestPointerLock,this[O].renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this[O].isPointerLocked=document.pointerLockElement===this[O].renderer.domElement||document.mozPointerLockElement===this[O].renderer.domElement||document.webkitPointerLockElement===this[O].renderer.domElement,this[O].isPointerLocked?(document.addEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!1,t.visible=!1})):(document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!0,t.visible=!0}))}keyDownHandler(t){const{keyState:n,movePlayerRig:r,moveInterval:i}=this[O];t.code in n&&(n[t.code]=!0),n.ShiftLeft&&(n.KeyW||n.KeyA||n.KeyS||n.KeyD)&&(i||(this[O].moveInterval=window.setInterval(r,16))),n.ShiftLeft&&n.ArrowUp&&(this[O].cameraRig.position.y+=.05,this.renderScene()),n.ShiftLeft&&n.ArrowDown&&(this[O].cameraRig.position.y-=.05,this.renderScene())}keyUpHandler(t){const{keyState:n,moveInterval:r}=this[O];t.code in n&&(n[t.code]=!1),(!n.ShiftLeft||!(n.KeyW||n.KeyA||n.KeyS||n.KeyD))&&r&&(window.clearInterval(r),this[O].moveInterval=null)}movePlayerRig(){const{playerRig:t,keyState:n,vec3:r}=this[O];r.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),r.lengthSq()>0&&(r.normalize().multiplyScalar(H2).applyQuaternion(t.quaternion),t.position.add(r),this.renderScene())}syncFovy(){this[O].camera.fov=this[O].xrDevice.fovy/Math.PI*180,this[O].camera.updateProjectionMatrix()}resetDeviceTransforms(){const{playerRig:t,cameraRig:n,controllerIndicators:r}=this[O];n.position.copy(this[O].headsetDefaultPosition),n.quaternion.set(0,0,0,1),t.position.set(0,0,0),t.quaternion.set(0,0,0,1),Object.entries(r).forEach(([i,a])=>{a.position.copy(this[O].controllerDefaultPositions[i]),a.quaternion.copy(this[O].controllerDefaultQuaternions[i])}),this.syncDeviceTransforms(),this.renderScene()}syncDeviceTransforms(){const{xrDevice:t,cameraRig:n,controllerIndicators:r}=this[O];t.position.copy(n.getWorldPosition(this[O].vec3)),t.quaternion.copy(n.getWorldQuaternion(this[O].quat)),Object.entries(r).forEach(([i,a])=>{t.controllers[i].position.copy(a.getWorldPosition(this[O].vec3)),t.controllers[i].quaternion.copy(a.getWorldQuaternion(this[O].quat))})}renderScene(){this.syncDeviceTransforms(),this[O].renderer.render(this[O].scene,this[O].camera)}get domElement(){return this[O].renderer.domElement}resize(){const t=this[O].canvasContainer.offsetWidth,n=this[O].canvasContainer.offsetHeight;this[O].renderer.setSize(t,n),this[O].camera.aspect=t/n,this[O].camera.updateProjectionMatrix(),this.renderScene()}dispose(){this[O].resizeObserver.disconnect(),this[O].renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const X2=Symbol("@@iwer/devui/devui");class B2{constructor(t){t.ipd=0;const n=t.canvasContainer,r=document.createElement("div");r.style.position="fixed",r.style.width="100%",r.style.height="100%",r.style.top="0",r.style.left="0",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="3",n.appendChild(r);const i=new Z2(t),a=i.domElement;a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.zIndex="2",n.appendChild(a),qo(r).render(f.jsx(Y2,{xrDevice:t,inputLayer:i})),this[X2]={xrDevice:t,inputLayer:i}}}const Y2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(!1),[i,a]=D.useState(w2),[s,o]=D.useState(!1),[l,c]=D.useState(!1);return D.useEffect(()=>{const u=()=>{const h=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!h)};return document.addEventListener("pointerlockchange",u,!1),document.addEventListener("mozpointerlockchange",u,!1),document.addEventListener("webkitpointerlockchange",u,!1),()=>{document.removeEventListener("pointerlockchange",u,!1),document.removeEventListener("mozpointerlockchange",u,!1),document.removeEventListener("webkitpointerlockchange",u,!1)}},[]),f.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsx(C2,{xrDevice:e,inputLayer:t,keyMapOpen:s,setKeyMapOpen:o,fovSettingOpen:l,setFovSettingOpen:c}),s&&f.jsx(S2,{keyMap:i,setKeyMap:a}),l&&f.jsx(j2,{xrDevice:e,inputLayer:t}),f.jsx(L2,{xrDevice:e,keyMap:i,pointerLocked:n})]})},W2={metaQuest3:C0,metaQuest2:j0,metaQuestPro:_0,oculusQuest1:T0};function G2(e){const t=new A0(W2[e]);t.ipd=0,t.installRuntime(),new B2(t)}export{G2 as emulate}; diff --git a/examples/stage/assets/emulate-DM86Bhli.js b/examples/stage/assets/emulate-DM86Bhli.js deleted file mode 100644 index b86b1c6..0000000 --- a/examples/stage/assets/emulate-DM86Bhli.js +++ /dev/null @@ -1,819 +0,0 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-Da-88g1w.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { - --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; - --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; - --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; - --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; - --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; - --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; - --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; -} - -svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { - overflow: visible; - box-sizing: content-box; -} - -.svg-inline--fa { - display: var(--fa-display, inline-block); - height: 1em; - overflow: visible; - vertical-align: -0.125em; -} -.svg-inline--fa.fa-2xs { - vertical-align: 0.1em; -} -.svg-inline--fa.fa-xs { - vertical-align: 0em; -} -.svg-inline--fa.fa-sm { - vertical-align: -0.0714285705em; -} -.svg-inline--fa.fa-lg { - vertical-align: -0.2em; -} -.svg-inline--fa.fa-xl { - vertical-align: -0.25em; -} -.svg-inline--fa.fa-2xl { - vertical-align: -0.3125em; -} -.svg-inline--fa.fa-pull-left { - margin-right: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-pull-right { - margin-left: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-li { - width: var(--fa-li-width, 2em); - top: 0.25em; -} -.svg-inline--fa.fa-fw { - width: var(--fa-fw-width, 1.25em); -} - -.fa-layers svg.svg-inline--fa { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; -} - -.fa-layers-counter, .fa-layers-text { - display: inline-block; - position: absolute; - text-align: center; -} - -.fa-layers { - display: inline-block; - height: 1em; - position: relative; - text-align: center; - vertical-align: -0.125em; - width: 1em; -} -.fa-layers svg.svg-inline--fa { - transform-origin: center center; -} - -.fa-layers-text { - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - transform-origin: center center; -} - -.fa-layers-counter { - background-color: var(--fa-counter-background-color, #ff253a); - border-radius: var(--fa-counter-border-radius, 1em); - box-sizing: border-box; - color: var(--fa-inverse, #fff); - line-height: var(--fa-counter-line-height, 1); - max-width: var(--fa-counter-max-width, 5em); - min-width: var(--fa-counter-min-width, 1.5em); - overflow: hidden; - padding: var(--fa-counter-padding, 0.25em 0.5em); - right: var(--fa-right, 0); - text-overflow: ellipsis; - top: var(--fa-top, 0); - transform: scale(var(--fa-counter-scale, 0.25)); - transform-origin: top right; -} - -.fa-layers-bottom-right { - bottom: var(--fa-bottom, 0); - right: var(--fa-right, 0); - top: auto; - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: bottom right; -} - -.fa-layers-bottom-left { - bottom: var(--fa-bottom, 0); - left: var(--fa-left, 0); - right: auto; - top: auto; - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: bottom left; -} - -.fa-layers-top-right { - top: var(--fa-top, 0); - right: var(--fa-right, 0); - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: top right; -} - -.fa-layers-top-left { - left: var(--fa-left, 0); - right: auto; - top: var(--fa-top, 0); - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: top left; -} - -.fa-1x { - font-size: 1em; -} - -.fa-2x { - font-size: 2em; -} - -.fa-3x { - font-size: 3em; -} - -.fa-4x { - font-size: 4em; -} - -.fa-5x { - font-size: 5em; -} - -.fa-6x { - font-size: 6em; -} - -.fa-7x { - font-size: 7em; -} - -.fa-8x { - font-size: 8em; -} - -.fa-9x { - font-size: 9em; -} - -.fa-10x { - font-size: 10em; -} - -.fa-2xs { - font-size: 0.625em; - line-height: 0.1em; - vertical-align: 0.225em; -} - -.fa-xs { - font-size: 0.75em; - line-height: 0.0833333337em; - vertical-align: 0.125em; -} - -.fa-sm { - font-size: 0.875em; - line-height: 0.0714285718em; - vertical-align: 0.0535714295em; -} - -.fa-lg { - font-size: 1.25em; - line-height: 0.05em; - vertical-align: -0.075em; -} - -.fa-xl { - font-size: 1.5em; - line-height: 0.0416666682em; - vertical-align: -0.125em; -} - -.fa-2xl { - font-size: 2em; - line-height: 0.03125em; - vertical-align: -0.1875em; -} - -.fa-fw { - text-align: center; - width: 1.25em; -} - -.fa-ul { - list-style-type: none; - margin-left: var(--fa-li-margin, 2.5em); - padding-left: 0; -} -.fa-ul > li { - position: relative; -} - -.fa-li { - left: calc(-1 * var(--fa-li-width, 2em)); - position: absolute; - text-align: center; - width: var(--fa-li-width, 2em); - line-height: inherit; -} - -.fa-border { - border-color: var(--fa-border-color, #eee); - border-radius: var(--fa-border-radius, 0.1em); - border-style: var(--fa-border-style, solid); - border-width: var(--fa-border-width, 0.08em); - padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); -} - -.fa-pull-left { - float: left; - margin-right: var(--fa-pull-margin, 0.3em); -} - -.fa-pull-right { - float: right; - margin-left: var(--fa-pull-margin, 0.3em); -} - -.fa-beat { - animation-name: fa-beat; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-bounce { - animation-name: fa-bounce; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); -} - -.fa-fade { - animation-name: fa-fade; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-beat-fade { - animation-name: fa-beat-fade; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-flip { - animation-name: fa-flip; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-shake { - animation-name: fa-shake; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin { - animation-name: fa-spin; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 2s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin-reverse { - --fa-animation-direction: reverse; -} - -.fa-pulse, -.fa-spin-pulse { - animation-name: fa-spin; - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, steps(8)); -} - -@media (prefers-reduced-motion: reduce) { - .fa-beat, -.fa-bounce, -.fa-fade, -.fa-beat-fade, -.fa-flip, -.fa-pulse, -.fa-shake, -.fa-spin, -.fa-spin-pulse { - animation-delay: -1ms; - animation-duration: 1ms; - animation-iteration-count: 1; - transition-delay: 0s; - transition-duration: 0s; - } -} -@keyframes fa-beat { - 0%, 90% { - transform: scale(1); - } - 45% { - transform: scale(var(--fa-beat-scale, 1.25)); - } -} -@keyframes fa-bounce { - 0% { - transform: scale(1, 1) translateY(0); - } - 10% { - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - } - 30% { - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - } - 50% { - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - } - 57% { - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - } - 64% { - transform: scale(1, 1) translateY(0); - } - 100% { - transform: scale(1, 1) translateY(0); - } -} -@keyframes fa-fade { - 50% { - opacity: var(--fa-fade-opacity, 0.4); - } -} -@keyframes fa-beat-fade { - 0%, 100% { - opacity: var(--fa-beat-fade-opacity, 0.4); - transform: scale(1); - } - 50% { - opacity: 1; - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} -@keyframes fa-flip { - 50% { - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - } -} -@keyframes fa-shake { - 0% { - transform: rotate(-15deg); - } - 4% { - transform: rotate(15deg); - } - 8%, 24% { - transform: rotate(-18deg); - } - 12%, 28% { - transform: rotate(18deg); - } - 16% { - transform: rotate(-22deg); - } - 20% { - transform: rotate(22deg); - } - 32% { - transform: rotate(-12deg); - } - 36% { - transform: rotate(12deg); - } - 40%, 100% { - transform: rotate(0deg); - } -} -@keyframes fa-spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} -.fa-rotate-90 { - transform: rotate(90deg); -} - -.fa-rotate-180 { - transform: rotate(180deg); -} - -.fa-rotate-270 { - transform: rotate(270deg); -} - -.fa-flip-horizontal { - transform: scale(-1, 1); -} - -.fa-flip-vertical { - transform: scale(1, -1); -} - -.fa-flip-both, -.fa-flip-horizontal.fa-flip-vertical { - transform: scale(-1, -1); -} - -.fa-rotate-by { - transform: rotate(var(--fa-rotate-angle, 0)); -} - -.fa-stack { - display: inline-block; - vertical-align: middle; - height: 2em; - position: relative; - width: 2.5em; -} - -.fa-stack-1x, -.fa-stack-2x { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; - z-index: var(--fa-stack-z-index, auto); -} - -.svg-inline--fa.fa-stack-1x { - height: 1em; - width: 1.25em; -} -.svg-inline--fa.fa-stack-2x { - height: 2em; - width: 2.5em; -} - -.fa-inverse { - color: var(--fa-inverse, #fff); -} - -.sr-only, -.fa-sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.sr-only-focusable:not(:focus), -.fa-sr-only-focusable:not(:focus) { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.svg-inline--fa .fa-primary { - fill: var(--fa-primary-color, currentColor); - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa .fa-secondary { - fill: var(--fa-secondary-color, currentColor); - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-primary { - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-secondary { - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa mask .fa-primary, -.svg-inline--fa mask .fa-secondary { - fill: black; -} - -.fad.fa-inverse, -.fa-duotone.fa-inverse { - color: var(--fa-inverse, #fff); -}`;function Fa(){const e=Ia,t=Ra,n=P.cssPrefix,r=P.replacementClass;let i=g1;if(n!==e||r!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(o,".".concat(r))}return i}let as=!1;function wr(){P.autoAddCss&&!as&&(u1(Fa()),as=!0)}var y1={mixout(){return{dom:{css:Fa,insertCss:wr}}},hooks(){return{beforeDOMElementCreation(){wr()},beforeI2svg(){wr()}}}};const Xe=rt||{};Xe[Ze]||(Xe[Ze]={});Xe[Ze].styles||(Xe[Ze].styles={});Xe[Ze].hooks||(Xe[Ze].hooks={});Xe[Ze].shims||(Xe[Ze].shims=[]);var Ne=Xe[Ze];const za=[],Na=function(){Z.removeEventListener("DOMContentLoaded",Na),Bn=1,za.map(e=>e())};let Bn=!1;Be&&(Bn=(Z.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Z.readyState),Bn||Z.addEventListener("DOMContentLoaded",Na));function v1(e){Be&&(Bn?setTimeout(e,0):za.push(e))}function gn(e){const{tag:t,attributes:n={},children:r=[]}=e;return typeof e=="string"?Ca(e):"<".concat(t," ").concat(h1(n),">").concat(r.map(gn).join(""),"")}function os(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var br=function(t,n,r,i){var a=Object.keys(t),s=a.length,o=n,l,c,u;for(r===void 0?(l=1,u=t[a[0]]):(l=0,u=r);l=55296&&i<=56319&&n=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function ls(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return!!r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function Vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:r=!1}=n,i=ls(t);typeof Ne.hooks.addPack=="function"&&!r?Ne.hooks.addPack(e,ls(t)):Ne.styles[e]={...Ne.styles[e]||{},...i},e==="fas"&&Vr("fa",t)}const{styles:ut,shims:b1}=Ne,S1={[W]:Object.values(gt[W]),[Se]:Object.values(gt[Se]),[Me]:Object.values(gt[Me])};let mi=null,Da={},$a={},Va={},qa={},Ha={};const M1={[W]:Object.keys(mt[W]),[Se]:Object.keys(mt[Se]),[Me]:Object.keys(mt[Me])};function k1(e){return~o1.indexOf(e)}function E1(e,t){const n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!k1(i)?i:null}const Za=()=>{const e=r=>br(ut,(i,a,s)=>(i[s]=br(a,r,{}),i),{});Da=e((r,i,a)=>(i[3]&&(r[i[3]]=a),i[2]&&i[2].filter(o=>typeof o=="number").forEach(o=>{r[o.toString(16)]=a}),r)),$a=e((r,i,a)=>(r[a]=a,i[2]&&i[2].filter(o=>typeof o=="string").forEach(o=>{r[o]=a}),r)),Ha=e((r,i,a)=>{const s=i[2];return r[a]=a,s.forEach(o=>{r[o]=a}),r});const t="far"in ut||P.autoFetchSvg,n=br(b1,(r,i)=>{const a=i[0];let s=i[1];const o=i[2];return s==="far"&&!t&&(s="fas"),typeof a=="string"&&(r.names[a]={prefix:s,iconName:o}),typeof a=="number"&&(r.unicodes[a.toString(16)]={prefix:s,iconName:o}),r},{names:{},unicodes:{}});Va=n.names,qa=n.unicodes,mi=ar(P.styleDefault,{family:P.familyDefault})};f1(e=>{mi=ar(e.styleDefault,{family:P.familyDefault})});Za();function gi(e,t){return(Da[e]||{})[t]}function P1(e,t){return($a[e]||{})[t]}function nt(e,t){return(Ha[e]||{})[t]}function Xa(e){return Va[e]||{prefix:null,iconName:null}}function A1(e){const t=qa[e],n=gi("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function it(){return mi}const yi=()=>({prefix:null,iconName:null,rest:[]});function ar(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=W}=t,r=mt[n][e],i=cn[n][e]||cn[n][r],a=e in Ne.styles?e:null;return i||a||null}const I1={[W]:Object.keys(gt[W]),[Se]:Object.keys(gt[Se]),[Me]:Object.keys(gt[Me])};function or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=t,r={[W]:"".concat(P.cssPrefix,"-").concat(W),[Se]:"".concat(P.cssPrefix,"-").concat(Se),[Me]:"".concat(P.cssPrefix,"-").concat(Me)};let i=null,a=W;const s=F0.filter(l=>l!==Ea);s.forEach(l=>{(e.includes(r[l])||e.some(c=>I1[l].includes(c)))&&(a=l)});const o=e.reduce((l,c)=>{const u=E1(P.cssPrefix,c);if(ut[c]?(c=S1[a].includes(c)?n1[a][c]:c,i=c,l.prefix=c):M1[a].indexOf(c)>-1?(i=c,l.prefix=ar(c,{family:a})):u?l.iconName=u:c!==P.replacementClass&&!s.some(h=>c===r[h])&&l.rest.push(c),!n&&l.prefix&&l.iconName){const h=i==="fa"?Xa(l.iconName):{},p=nt(l.prefix,l.iconName);h.prefix&&(i=null),l.iconName=h.iconName||p||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!ut.far&&ut.fas&&!P.autoFetchSvg&&(l.prefix="fas")}return l},yi());return(e.includes("fa-brands")||e.includes("fab"))&&(o.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(o.prefix="fad"),!o.prefix&&a===Se&&(ut.fass||P.autoFetchSvg)&&(o.prefix="fass",o.iconName=nt(o.prefix,o.iconName)||o.iconName),!o.prefix&&a===Me&&(ut.fasds||P.autoFetchSvg)&&(o.prefix="fasds",o.iconName=nt(o.prefix,o.iconName)||o.iconName),(o.prefix==="fa"||i==="fa")&&(o.prefix=it()||"fas"),o}class R1{constructor(){this.definitions={}}add(){for(var t=arguments.length,n=new Array(t),r=0;r{this.definitions[a]={...this.definitions[a]||{},...i[a]},Vr(a,i[a]);const s=gt[W][a];s&&Vr(s,i[a]),Za()})}reset(){this.definitions={}}_pullDefinitions(t,n){const r=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(r).map(i=>{const{prefix:a,iconName:s,icon:o}=r[i],l=o[2];t[a]||(t[a]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(t[a][c]=o)}),t[a][s]=o}),t}}let cs=[],Pt={};const Rt={},O1=Object.keys(Rt);function L1(e,t){let{mixoutsTo:n}=t;return cs=e,Pt={},Object.keys(Rt).forEach(r=>{O1.indexOf(r)===-1&&delete Rt[r]}),cs.forEach(r=>{const i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(a=>{typeof i[a]=="function"&&(n[a]=i[a]),typeof i[a]=="object"&&Object.keys(i[a]).forEach(s=>{n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){const a=r.hooks();Object.keys(a).forEach(s=>{Pt[s]||(Pt[s]=[]),Pt[s].push(a[s])})}r.provides&&r.provides(Rt)}),n}function qr(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i{t=s.apply(null,[t,...r])}),t}function St(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{a.apply(null,n)})}function st(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Rt[e]?Rt[e].apply(null,t):void 0}function Hr(e){e.prefix==="fa"&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||it();if(t)return t=nt(n,t)||t,os(Ba.definitions,n,t)||os(Ne.styles,n,t)}const Ba=new R1,T1=()=>{P.autoReplaceSvg=!1,P.observeMutations=!1,St("noAuto")},j1={i2svg:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Be?(St("beforeI2svg",e),st("pseudoElements2svg",e),st("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;P.autoReplaceSvg===!1&&(P.autoReplaceSvg=!0),P.observeMutations=!0,v1(()=>{C1({autoReplaceSvgRoot:t}),St("watch",e)})}},_1={icon:e=>{if(e===null)return null;if(typeof e=="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:nt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){const t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],n=ar(e[0]);return{prefix:n,iconName:nt(n,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(P.cssPrefix,"-"))>-1||e.match(r1))){const t=or(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||it(),iconName:nt(t.prefix,t.iconName)||t.iconName}}if(typeof e=="string"){const t=it();return{prefix:t,iconName:nt(t,e)||e}}}},Ee={noAuto:T1,config:P,dom:j1,parse:_1,library:Ba,findIconDefinition:Hr,toHtml:gn},C1=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t=Z}=e;(Object.keys(Ne.styles).length>0||P.autoFetchSvg)&&Be&&P.autoReplaceSvg&&Ee.dom.i2svg({node:t})};function lr(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(n=>gn(n))}}),Object.defineProperty(e,"node",{get:function(){if(!Be)return;const n=Z.createElement("div");return n.innerHTML=e.html,n.children}}),e}function F1(e){let{children:t,main:n,mask:r,attributes:i,styles:a,transform:s}=e;if(pi(s)&&n.found&&!r.found){const{width:o,height:l}=n,c={x:o/l/2,y:.5};i.style=sr({...a,"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")})}return[{tag:"svg",attributes:i,children:t}]}function z1(e){let{prefix:t,iconName:n,children:r,attributes:i,symbol:a}=e;const s=a===!0?"".concat(t,"-").concat(P.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:s},children:r}]}]}function vi(e){const{icons:{main:t,mask:n},prefix:r,iconName:i,transform:a,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:p,height:g}=n.found?n:t,x=r==="fak",v=[P.replacementClass,i?"".concat(P.cssPrefix,"-").concat(i):""].filter(k=>u.classes.indexOf(k)===-1).filter(k=>k!==""||!!k).concat(u.classes).join(" ");let d={children:[],attributes:{...u.attributes,"data-prefix":r,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(g)}};const y=x&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/g*16*.0625,"em")}:{};h&&(d.attributes[bt]=""),o&&(d.children.push({tag:"title",attributes:{id:d.attributes["aria-labelledby"]||"title-".concat(c||fn())},children:[o]}),delete d.attributes.title);const b={...d,prefix:r,iconName:i,main:t,mask:n,maskId:l,transform:a,symbol:s,styles:{...y,...u.styles}},{children:w,attributes:M}=n.found&&t.found?st("generateAbstractMask",b)||{children:[],attributes:{}}:st("generateAbstractIcon",b)||{children:[],attributes:{}};return b.children=w,b.attributes=M,s?z1(b):F1(b)}function fs(e){const{content:t,width:n,height:r,transform:i,title:a,extra:s,watchable:o=!1}=e,l={...s.attributes,...a?{title:a}:{},class:s.classes.join(" ")};o&&(l[bt]="");const c={...s.styles};pi(i)&&(c.transform=m1({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);const u=sr(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function N1(e){const{content:t,title:n,extra:r}=e,i={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},a=sr(r.styles);a.length>0&&(i.style=a);const s=[];return s.push({tag:"span",attributes:i,children:[t]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}const{styles:Sr}=Ne;function Zr(e){const t=e[0],n=e[1],[r]=e.slice(4);let i=null;return Array.isArray(r)?i={tag:"g",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.GROUP)},children:[{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.PRIMARY),fill:"currentColor",d:r[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:t,height:n,icon:i}}const D1={found:!1,width:512,height:512};function $1(e,t){!Oa&&!P.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Xr(e,t){let n=t;return t==="fa"&&P.styleDefault!==null&&(t=it()),new Promise((r,i)=>{if(n==="fa"){const a=Xa(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&Sr[t]&&Sr[t][e]){const a=Sr[t][e];return r(Zr(a))}$1(e,t),r({...D1,icon:P.showMissingIcons&&e?st("missingIconAbstract")||{}:{}})})}const us=()=>{},Br=P.measurePerformance&&En&&En.mark&&En.measure?En:{mark:us,measure:us},Gt='FA "6.6.0"',V1=e=>(Br.mark("".concat(Gt," ").concat(e," begins")),()=>Ya(e)),Ya=e=>{Br.mark("".concat(Gt," ").concat(e," ends")),Br.measure("".concat(Gt," ").concat(e),"".concat(Gt," ").concat(e," begins"),"".concat(Gt," ").concat(e," ends"))};var xi={begin:V1,end:Ya};const Tn=()=>{};function ds(e){return typeof(e.getAttribute?e.getAttribute(bt):null)=="string"}function q1(e){const t=e.getAttribute?e.getAttribute(ui):null,n=e.getAttribute?e.getAttribute(di):null;return t&&n}function H1(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(P.replacementClass)}function Z1(){return P.autoReplaceSvg===!0?jn.replace:jn[P.autoReplaceSvg]||jn.replace}function X1(e){return Z.createElementNS("http://www.w3.org/2000/svg",e)}function B1(e){return Z.createElement(e)}function Wa(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=e.tag==="svg"?X1:B1}=t;if(typeof e=="string")return Z.createTextNode(e);const r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(a){r.setAttribute(a,e.attributes[a])}),(e.children||[]).forEach(function(a){r.appendChild(Wa(a,{ceFn:n}))}),r}function Y1(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}const jn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(n=>{t.parentNode.insertBefore(Wa(n),t)}),t.getAttribute(bt)===null&&P.keepOriginalSource){let n=Z.createComment(Y1(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~hi(t).indexOf(P.replacementClass))return jn.replace(e);const r=new RegExp("".concat(P.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const a=n[0].attributes.class.split(" ").reduce((s,o)=>(o===P.replacementClass||o.match(r)?s.toSvg.push(o):s.toNode.push(o),s),{toNode:[],toSvg:[]});n[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",a.toNode.join(" "))}const i=n.map(a=>gn(a)).join(` -`);t.setAttribute(bt,""),t.innerHTML=i}};function hs(e){e()}function Qa(e,t){const n=typeof t=="function"?t:Tn;if(e.length===0)n();else{let r=hs;P.mutateApproach===e1&&(r=rt.requestAnimationFrame||hs),r(()=>{const i=Z1(),a=xi.begin("mutate");e.map(i),a(),n()})}}let wi=!1;function Ga(){wi=!0}function Yr(){wi=!1}let Yn=null;function ps(e){if(!ns||!P.observeMutations)return;const{treeCallback:t=Tn,nodeCallback:n=Tn,pseudoElementsCallback:r=Tn,observeMutationsRoot:i=Z}=e;Yn=new ns(a=>{if(wi)return;const s=it();Nt(a).forEach(o=>{if(o.type==="childList"&&o.addedNodes.length>0&&!ds(o.addedNodes[0])&&(P.searchPseudoElements&&r(o.target),t(o.target)),o.type==="attributes"&&o.target.parentNode&&P.searchPseudoElements&&r(o.target.parentNode),o.type==="attributes"&&ds(o.target)&&~a1.indexOf(o.attributeName))if(o.attributeName==="class"&&q1(o.target)){const{prefix:l,iconName:c}=or(hi(o.target));o.target.setAttribute(ui,l||s),c&&o.target.setAttribute(di,c)}else H1(o.target)&&n(o.target)})}),Be&&Yn.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function W1(){Yn&&Yn.disconnect()}function Q1(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce((r,i)=>{const a=i.split(":"),s=a[0],o=a.slice(1);return s&&o.length>0&&(r[s]=o.join(":").trim()),r},{})),n}function G1(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"";let i=or(hi(e));return i.prefix||(i.prefix=it()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=P1(i.prefix,e.innerText)||gi(i.prefix,$r(e.innerText))),!i.iconName&&P.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function U1(e){const t=Nt(e.attributes).reduce((i,a)=>(i.name!=="class"&&i.name!=="style"&&(i[a.name]=a.value),i),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return P.autoA11y&&(n?t["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(r||fn()):(t["aria-hidden"]="true",t.focusable="false")),t}function K1(){return{iconName:null,title:null,titleId:null,prefix:null,transform:ze,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:i}=G1(e),a=U1(e),s=qr("parseNodeAttributes",{},e);let o=t.styleParser?Q1(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:r,transform:ze,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:o,attributes:a},...s}}const{styles:J1}=Ne;function Ua(e){const t=P.autoReplaceSvg==="nest"?ms(e,{styleParser:!1}):ms(e);return~t.extra.classes.indexOf(ja)?st("generateLayersText",e,t):st("generateSvgReplacementMutation",e,t)}let De=new Set;La.map(e=>{De.add("fa-".concat(e))});Object.keys(mt[W]).map(De.add.bind(De));Object.keys(mt[Se]).map(De.add.bind(De));Object.keys(mt[Me]).map(De.add.bind(De));De=[...De];function gs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Be)return Promise.resolve();const n=Z.documentElement.classList,r=u=>n.add("".concat(ss,"-").concat(u)),i=u=>n.remove("".concat(ss,"-").concat(u)),a=P.autoFetchSvg?De:La.map(u=>"fa-".concat(u)).concat(Object.keys(J1));a.includes("fa")||a.push("fa");const s=[".".concat(ja,":not([").concat(bt,"])")].concat(a.map(u=>".".concat(u,":not([").concat(bt,"])"))).join(", ");if(s.length===0)return Promise.resolve();let o=[];try{o=Nt(e.querySelectorAll(s))}catch{}if(o.length>0)r("pending"),i("complete");else return Promise.resolve();const l=xi.begin("onTree"),c=o.reduce((u,h)=>{try{const p=Ua(h);p&&u.push(p)}catch(p){Oa||p.name==="MissingIcon"&&console.error(p)}return u},[]);return new Promise((u,h)=>{Promise.all(c).then(p=>{Qa(p,()=>{r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),l(),u()})}).catch(p=>{l(),h(p)})})}function el(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ua(e).then(n=>{n&&Qa([n],t)})}function tl(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(t||{}).icon?t:Hr(t||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:Hr(i||{})),e(r,{...n,mask:i})}}const nl=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,symbol:r=!1,mask:i=null,maskId:a=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:p,icon:g}=e;return lr({type:"icon",...e},()=>(St("beforeDOMElementCreation",{iconDefinition:e,params:t}),P.autoA11y&&(s?c["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(o||fn()):(c["aria-hidden"]="true",c.focusable="false")),vi({icons:{main:Zr(g),mask:i?Zr(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:p,transform:{...ze,...n},symbol:r,title:s,maskId:a,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var rl={mixout(){return{icon:tl(nl)}},hooks(){return{mutationObserverCallbacks(e){return e.treeCallback=gs,e.nodeCallback=el,e}}},provides(e){e.i2svg=function(t){const{node:n=Z,callback:r=()=>{}}=t;return gs(n,r)},e.generateSvgReplacementMutation=function(t,n){const{iconName:r,title:i,titleId:a,prefix:s,transform:o,symbol:l,mask:c,maskId:u,extra:h}=n;return new Promise((p,g)=>{Promise.all([Xr(r,s),c.iconName?Xr(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(x=>{let[v,d]=x;p([t,vi({icons:{main:v,mask:d},prefix:s,iconName:r,transform:o,symbol:l,maskId:u,title:i,titleId:a,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){let{children:n,attributes:r,main:i,transform:a,styles:s}=t;const o=sr(s);o.length>0&&(r.style=o);let l;return pi(a)&&(l=st("generateAbstractTransformGrouping",{main:i,transform:a,containerWidth:i.width,iconWidth:i.width})),n.push(l||i.icon),{children:n,attributes:r}}}},il={mixout(){return{layer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=t;return lr({type:"layer"},()=>{St("beforeDOMElementCreation",{assembler:e,params:t});let r=[];return e(i=>{Array.isArray(i)?i.map(a=>{r=r.concat(a.abstract)}):r=r.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(P.cssPrefix,"-layers"),...n].join(" ")},children:r}]})}}}},sl={mixout(){return{counter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:r=[],attributes:i={},styles:a={}}=t;return lr({type:"counter",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),N1({content:e.toString(),title:n,extra:{attributes:i,styles:a,classes:["".concat(P.cssPrefix,"-layers-counter"),...r]}})))}}}},al={mixout(){return{text(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,title:r=null,classes:i=[],attributes:a={},styles:s={}}=t;return lr({type:"text",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),fs({content:e,transform:{...ze,...n},title:r,extra:{attributes:a,styles:s,classes:["".concat(P.cssPrefix,"-layers-text"),...i]}})))}}},provides(e){e.generateLayersText=function(t,n){const{title:r,transform:i,extra:a}=n;let s=null,o=null;if(ka){const l=parseInt(getComputedStyle(t).fontSize,10),c=t.getBoundingClientRect();s=c.width/l,o=c.height/l}return P.autoA11y&&!r&&(a.attributes["aria-hidden"]="true"),Promise.resolve([t,fs({content:t.innerHTML,width:s,height:o,transform:i,title:r,extra:a,watchable:!0})])}}};const ol=new RegExp('"',"ug"),ys=[1105920,1112319],vs={FontAwesome:{normal:"fas",400:"fas"},...q0,...V0,...G0},Wr=Object.keys(vs).reduce((e,t)=>(e[t.toLowerCase()]=vs[t],e),{}),ll=Object.keys(Wr).reduce((e,t)=>{const n=Wr[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e},{});function cl(e){const t=e.replace(ol,""),n=w1(t,0),r=n>=ys[0]&&n<=ys[1],i=t.length===2?t[0]===t[1]:!1;return{value:$r(i?t[0]:t),isSecondary:r||i}}function fl(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),i=isNaN(r)?"normal":r;return(Wr[n]||{})[i]||ll[n]}function xs(e,t){const n="".concat(J0).concat(t.replace(":","-"));return new Promise((r,i)=>{if(e.getAttribute(n)!==null)return r();const s=Nt(e.children).filter(p=>p.getAttribute(Fr)===t)[0],o=rt.getComputedStyle(e,t),l=o.getPropertyValue("font-family"),c=l.match(i1),u=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!c)return e.removeChild(s),r();if(c&&h!=="none"&&h!==""){const p=o.getPropertyValue("content");let g=fl(l,u);const{value:x,isSecondary:v}=cl(p),d=c[0].startsWith("FontAwesome");let y=gi(g,x),b=y;if(d){const w=A1(x);w.iconName&&w.prefix&&(y=w.iconName,g=w.prefix)}if(y&&!v&&(!s||s.getAttribute(ui)!==g||s.getAttribute(di)!==b)){e.setAttribute(n,b),s&&e.removeChild(s);const w=K1(),{extra:M}=w;M.attributes[Fr]=t,Xr(y,g).then(k=>{const E=vi({...w,icons:{main:k,mask:yi()},prefix:g,iconName:b,extra:M,watchable:!0}),R=Z.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(R,e.firstChild):e.appendChild(R),R.outerHTML=E.map(re=>gn(re)).join(` -`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function ul(e){return Promise.all([xs(e,"::before"),xs(e,"::after")])}function dl(e){return e.parentNode!==document.head&&!~t1.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Fr)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function ws(e){if(Be)return new Promise((t,n)=>{const r=Nt(e.querySelectorAll("*")).filter(dl).map(ul),i=xi.begin("searchPseudoElements");Ga(),Promise.all(r).then(()=>{i(),Yr(),t()}).catch(()=>{i(),Yr(),n()})})}var hl={hooks(){return{mutationObserverCallbacks(e){return e.pseudoElementsCallback=ws,e}}},provides(e){e.pseudoElements2svg=function(t){const{node:n=Z}=t;P.searchPseudoElements&&ws(n)}}};let bs=!1;var pl={mixout(){return{dom:{unwatch(){Ga(),bs=!0}}}},hooks(){return{bootstrap(){ps(qr("mutationObserverCallbacks",{}))},noAuto(){W1()},watch(e){const{observeMutationsRoot:t}=e;bs?Yr():ps(qr("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}};const Ss=e=>{let t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce((n,r)=>{const i=r.toLowerCase().split("-"),a=i[0];let s=i.slice(1).join("-");if(a&&s==="h")return n.flipX=!0,n;if(a&&s==="v")return n.flipY=!0,n;if(s=parseFloat(s),isNaN(s))return n;switch(a){case"grow":n.size=n.size+s;break;case"shrink":n.size=n.size-s;break;case"left":n.x=n.x-s;break;case"right":n.x=n.x+s;break;case"up":n.y=n.y-s;break;case"down":n.y=n.y+s;break;case"rotate":n.rotate=n.rotate+s;break}return n},t)};var ml={mixout(){return{parse:{transform:e=>Ss(e)}}},hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=Ss(n)),e}}},provides(e){e.generateAbstractTransformGrouping=function(t){let{main:n,transform:r,containerWidth:i,iconWidth:a}=t;const s={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(r.x*32,", ").concat(r.y*32,") "),l="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),c="rotate(".concat(r.rotate," 0 0)"),u={transform:"".concat(o," ").concat(l," ").concat(c)},h={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:u,path:h};return{tag:"g",attributes:{...p.outer},children:[{tag:"g",attributes:{...p.inner},children:[{tag:n.icon.tag,children:n.icon.children,attributes:{...n.icon.attributes,...p.path}}]}]}}}};const Mr={x:0,y:0,width:"100%",height:"100%"};function Ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function gl(e){return e.tag==="g"?e.children:[e]}var yl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),r=n?or(n.split(" ").map(i=>i.trim())):yi();return r.prefix||(r.prefix=it()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides(e){e.generateAbstractMask=function(t){let{children:n,attributes:r,main:i,mask:a,maskId:s,transform:o}=t;const{width:l,icon:c}=i,{width:u,icon:h}=a,p=p1({transform:o,containerWidth:u,iconWidth:l}),g={tag:"rect",attributes:{...Mr,fill:"white"}},x=c.children?{children:c.children.map(Ms)}:{},v={tag:"g",attributes:{...p.inner},children:[Ms({tag:c.tag,attributes:{...c.attributes,...p.path},...x})]},d={tag:"g",attributes:{...p.outer},children:[v]},y="mask-".concat(s||fn()),b="clip-".concat(s||fn()),w={tag:"mask",attributes:{...Mr,id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[g,d]},M={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:gl(h)},w]};return n.push(M,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")"),...Mr}}),{children:n,attributes:r}}}},vl={provides(e){let t=!1;rt.matchMedia&&(t=rt.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const n=[],r={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:{...r,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const a={...i,attributeName:"opacity"},s={tag:"circle",attributes:{...r,cx:"256",cy:"364",r:"28"},children:[]};return t||s.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...a,values:"1;0;1;1;0;1;"}}),n.push(s),n.push({tag:"path",attributes:{...r,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...a,values:"1;0;0;0;0;1;"}}]}),t||n.push({tag:"path",attributes:{...r,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...a,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},xl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),r=n===null?!1:n===""?!0:n;return e.symbol=r,e}}}},wl=[y1,rl,il,sl,al,hl,pl,ml,yl,vl,xl];L1(wl,{mixoutsTo:Ee});Ee.noAuto;Ee.config;Ee.library;Ee.dom;const Qr=Ee.parse;Ee.findIconDefinition;Ee.toHtml;const bl=Ee.icon;Ee.layer;Ee.text;Ee.counter;function ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Ml(e,t){if(e==null)return{};var n=Sl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gr(e){return kl(e)||El(e)||Pl(e)||Al()}function kl(e){if(Array.isArray(e))return Ur(e)}function El(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pl(e,t){if(e){if(typeof e=="string")return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(l){return Ja(e,l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.attrs.className=u,delete t.attributes.class;break;case"style":l.attrs.style=Tl(u);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?l.attrs[c.toLowerCase()]=u:l.attrs[Ka(c)]=u}return l},{attrs:{}}),a=n.style,s=a===void 0?{}:a,o=Ml(n,Ol);return i.attrs.style=Ce(Ce({},i.attrs.style),s),e.apply(void 0,[t.tag,Ce(Ce({},i.attrs),o)].concat(Gr(r)))}var eo=!1;try{eo=!0}catch{}function jl(){if(!eo&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Es(e){if(e&&Wn(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Qr.icon)return Qr.icon(e);if(e===null)return null;if(e&&Wn(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function kr(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?At({},e,t):{}}var Ps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},un=xt.forwardRef(function(e,t){var n=Ce(Ce({},Ps),e),r=n.icon,i=n.mask,a=n.symbol,s=n.className,o=n.title,l=n.titleId,c=n.maskId,u=Es(r),h=kr("classes",[].concat(Gr(Il(n)),Gr((s||"").split(" ")))),p=kr("transform",typeof n.transform=="string"?Qr.transform(n.transform):n.transform),g=kr("mask",Es(i)),x=bl(u,Ce(Ce(Ce(Ce({},h),p),g),{},{symbol:a,title:o,titleId:l,maskId:c}));if(!x)return jl("Could not find icon",u),null;var v=x.abstract,d={ref:t};return Object.keys(n).forEach(function(y){Ps.hasOwnProperty(y)||(d[y]=n[y])}),_l(v[0],d)});un.displayName="FontAwesomeIcon";un.propTypes={beat:C.bool,border:C.bool,beatFade:C.bool,bounce:C.bool,className:C.string,fade:C.bool,flash:C.bool,mask:C.oneOfType([C.object,C.array,C.string]),maskId:C.string,fixedWidth:C.bool,inverse:C.bool,flip:C.oneOf([!0,!1,"horizontal","vertical","both"]),icon:C.oneOfType([C.object,C.array,C.string]),listItem:C.bool,pull:C.oneOf(["right","left"]),pulse:C.bool,rotation:C.oneOf([0,90,180,270]),shake:C.bool,size:C.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:C.bool,spinPulse:C.bool,spinReverse:C.bool,symbol:C.oneOfType([C.bool,C.string]),title:C.string,titleId:C.string,transform:C.oneOfType([C.string,C.object]),swapOpacity:C.bool};var _l=Ja.bind(null,xt.createElement),me=function(){return me=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?ae(Dt,--Ie):0,jt--,ee===10&&(jt=1,fr--),ee}function Le(){return ee=Ie2||Jr(ee)>3?"":" "}function Zl(e,t){for(;--t&&Le()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return dr(e,Cn()+(t<6&&yt()==32&&Le()==32))}function ei(e){for(;Le();)switch(ee){case e:return Ie;case 34:case 39:e!==34&&e!==39&&ei(ee);break;case 40:e===41&&ei(e);break;case 92:Le();break}return Ie}function Xl(e,t){for(;Le()&&e+ee!==57;)if(e+ee===84&&yt()===47)break;return"/*"+dr(t,Ie-1)+"*"+Si(e===47?e:Le())}function Bl(e){for(;!Jr(yt());)Le();return dr(e,Ie)}function Yl(e){return ql(Fn("",null,null,null,[""],e=Vl(e),0,[0],e))}function Fn(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,h=s,p=0,g=0,x=0,v=1,d=1,y=1,b=0,w="",M=i,k=a,E=r,R=w;d;)switch(x=b,b=Le()){case 40:if(x!=108&&ae(R,h-1)==58){_n(R+=j(Er(b),"&","&\f"),"&\f",ro(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:R+=Er(b);break;case 9:case 10:case 13:case 32:R+=Hl(x);break;case 92:R+=Zl(Cn()-1,7);continue;case 47:switch(yt()){case 42:case 47:Ut(Wl(Xl(Le(),Cn()),t,n,l),l);break;default:R+="/"}break;case 123*v:o[c++]=Fe(R)*y;case 125*v:case 59:case 0:switch(b){case 0:case 125:d=0;case 59+u:y==-1&&(R=j(R,/\f/g,"")),g>0&&Fe(R)-h&&Ut(g>32?Rs(R+";",r,n,h-1,l):Rs(j(R," ","")+";",r,n,h-2,l),l);break;case 59:R+=";";default:if(Ut(E=Is(R,t,n,c,u,i,o,w,M=[],k=[],h,a),a),b===123)if(u===0)Fn(R,t,E,E,M,a,h,o,k);else switch(p===99&&ae(R,3)===110?100:p){case 100:case 108:case 109:case 115:Fn(e,E,E,r&&Ut(Is(e,E,E,0,0,i,o,w,i,M=[],h,k),k),i,k,h,o,r?M:k);break;default:Fn(R,E,E,E,[""],k,0,o,k)}}c=u=g=0,v=y=1,w=R="",h=s;break;case 58:h=1+Fe(R),g=x;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&$l()==125)continue}switch(R+=Si(b),b*v){case 38:y=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Fe(R)-1)*y,y=1;break;case 64:yt()===45&&(R+=Er(Le())),p=yt(),u=h=Fe(w=R+=Bl(Cn())),b++;break;case 45:x===45&&Fe(R)==2&&(v=0)}}return a}function Is(e,t,n,r,i,a,s,o,l,c,u,h){for(var p=i-1,g=i===0?a:[""],x=so(g),v=0,d=0,y=0;v0?g[b]+" "+w:j(w,/&\f/g,g[b])))&&(l[y++]=M);return ur(e,t,n,i===0?cr:o,l,c,u,h)}function Wl(e,t,n,r){return ur(e,t,n,to,Si(Dl()),Tt(e,2,-2),0,r)}function Rs(e,t,n,r,i){return ur(e,t,n,bi,Tt(e,0,r),Tt(e,r+1,-1),r,i)}function oo(e,t,n){switch(zl(e,t)){case 5103:return N+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return N+e+e;case 4789:return rn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return N+e+rn+e+q+e+e;case 5936:switch(ae(e,t+11)){case 114:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return N+e+q+e+e;case 6165:return N+e+q+"flex-"+e+e;case 5187:return N+e+j(e,/(\w+).+(:[^]+)/,N+"box-$1$2"+q+"flex-$1$2")+e;case 5443:return N+e+q+"flex-item-"+j(e,/flex-|-self/g,"")+(Ve(e,/flex-|baseline/)?"":q+"grid-row-"+j(e,/flex-|-self/g,""))+e;case 4675:return N+e+q+"flex-line-pack"+j(e,/align-content|flex-|-self/g,"")+e;case 5548:return N+e+q+j(e,"shrink","negative")+e;case 5292:return N+e+q+j(e,"basis","preferred-size")+e;case 6060:return N+"box-"+j(e,"-grow","")+N+e+q+j(e,"grow","positive")+e;case 4554:return N+j(e,/([^-])(transform)/g,"$1"+N+"$2")+e;case 6187:return j(j(j(e,/(zoom-|grab)/,N+"$1"),/(image-set)/,N+"$1"),e,"")+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,N+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,N+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+N+e+e;case 4200:if(!Ve(e,/flex-|baseline/))return q+"grid-column-align"+Tt(e,t)+e;break;case 2592:case 3360:return q+j(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Ve(r.props,/grid-\w+-end/)})?~_n(e+(n=n[t].value),"span",0)?e:q+j(e,"-start","")+e+q+"grid-row-span:"+(~_n(n,"span",0)?Ve(n,/\d+/):+Ve(n,/\d+/)-+Ve(e,/\d+/))+";":q+j(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Ve(r.props,/grid-\w+-start/)})?e:q+j(j(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,N+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Fe(e)-1-t>6)switch(ae(e,t+1)){case 109:if(ae(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+rn+(ae(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_n(e,"stretch",0)?oo(j(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return j(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,s,o,l,c){return q+i+":"+a+c+(s?q+i+"-span:"+(o?l:+l-+a)+c:"")+e});case 4949:if(ae(e,t+6)===121)return j(e,":",":"+N)+e;break;case 6444:switch(ae(e,ae(e,14)===45?18:11)){case 120:return j(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+N+(ae(e,14)===45?"inline-":"")+"box$3$1"+N+"$2$3$1"+q+"$2box$3")+e;case 100:return j(e,":",":"+q)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return j(e,"scroll-","scroll-snap-")+e}return e}function Gn(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case bi:e.return=oo(e.value,e.length,n);return;case no:return Gn([et(e,{value:j(e.value,"@","@"+N)})],r);case cr:if(e.length)return Nl(n=e.props,function(i){switch(Ve(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":kt(et(e,{props:[j(i,/:(read-\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break;case"::placeholder":kt(et(e,{props:[j(i,/:(plac\w+)/,":"+N+"input-$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,q+"input-$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break}return""})}}var Jl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},we={},_t=typeof process<"u"&&we!==void 0&&(we.REACT_APP_SC_ATTR||we.SC_ATTR)||"data-styled",lo="active",co="data-styled-version",hr="6.1.12",Mi=`/*!sc*/ -`,Un=typeof window<"u"&&"HTMLElement"in window,ec=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==""?we.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&we.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.SC_DISABLE_SPEEDY!==void 0&&we.SC_DISABLE_SPEEDY!==""&&we.SC_DISABLE_SPEEDY!=="false"&&we.SC_DISABLE_SPEEDY),pr=Object.freeze([]),Ct=Object.freeze({});function tc(e,t,n){return n===void 0&&(n=Ct),e.theme!==n.theme&&e.theme||t||n.theme}var fo=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),nc=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,rc=/(^-|-$)/g;function Os(e){return e.replace(nc,"-").replace(rc,"")}var ic=/(a)(d)/gi,Pn=52,Ls=function(e){return String.fromCharCode(e+(e>25?39:97))};function ti(e){var t,n="";for(t=Math.abs(e);t>Pn;t=t/Pn|0)n=Ls(t%Pn)+n;return(Ls(t%Pn)+n).replace(ic,"$1-$2")}var Pr,uo=5381,It=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ho=function(e){return It(uo,e)};function sc(e){return ti(ho(e)>>>0)}function ac(e){return e.displayName||e.name||"Component"}function Ar(e){return typeof e=="string"&&!0}var po=typeof Symbol=="function"&&Symbol.for,mo=po?Symbol.for("react.memo"):60115,oc=po?Symbol.for("react.forward_ref"):60112,lc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},go={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fc=((Pr={})[oc]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pr[mo]=go,Pr);function Ts(e){return("type"in(t=e)&&t.type.$$typeof)===mo?go:"$$typeof"in e?fc[e.$$typeof]:lc;var t}var uc=Object.defineProperty,dc=Object.getOwnPropertyNames,js=Object.getOwnPropertySymbols,hc=Object.getOwnPropertyDescriptor,pc=Object.getPrototypeOf,_s=Object.prototype;function yo(e,t,n){if(typeof t!="string"){if(_s){var r=pc(t);r&&r!==_s&&yo(e,r,n)}var i=dc(t);js&&(i=i.concat(js(t)));for(var a=Ts(e),s=Ts(t),o=0;o0?" Args: ".concat(t.join(", ")):""))}var mc=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;t>=a;)if((a<<=1)<0)throw yn(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=i;s=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),a=i+r,s=i;s=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(d+="".concat(y,","))}),l+="".concat(x).concat(v,'{content:"').concat(d,'"}').concat(Mi)},u=0;u0?".".concat(t):p},u=l.slice();u.push(function(p){p.type===cr&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(Pc,n).replace(r,c))}),s.prefix&&u.push(Kl),u.push(Ql);var h=function(p,g,x,v){g===void 0&&(g=""),x===void 0&&(x=""),v===void 0&&(v="&"),t=v,n=g,r=new RegExp("\\".concat(n,"\\b"),"g");var d=p.replace(Ac,""),y=Yl(x||g?"".concat(x," ").concat(g," { ").concat(d," }"):d);s.namespace&&(y=wo(y,s.namespace));var b=[];return Gn(y,Gl(u.concat(Ul(function(w){return b.push(w)})))),b};return h.hash=l.length?l.reduce(function(p,g){return g.name||yn(15),It(p,g.name)},uo).toString():"",h}var Rc=new xo,ri=Ic(),bo=xt.createContext({shouldForwardProp:void 0,styleSheet:Rc,stylis:ri});bo.Consumer;xt.createContext(void 0);function Ns(){return D.useContext(bo)}var Oc=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=ri);var s=r.name+a.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,a(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Ei(this,function(){throw yn(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ri),this.name+t.hash},e}(),Lc=function(e){return e>="A"&&e<="Z"};function Ds(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,s)){var o=r(a,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,o)}i=dt(i,s),this.staticRulesId=s}else{for(var l=It(this.baseHash,r.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,g)||n.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=dt(i,g)}}return i},e}(),ko=xt.createContext(void 0);ko.Consumer;var Ir={};function Cc(e,t,n){var r=ki(e),i=e,a=!Ar(e),s=t.attrs,o=s===void 0?pr:s,l=t.componentId,c=l===void 0?function(M,k){var E=typeof M!="string"?"sc":Os(M);Ir[E]=(Ir[E]||0)+1;var R="".concat(E,"-").concat(sc(hr+E+Ir[E]));return k?"".concat(k,"-").concat(R):R}(t.displayName,t.parentComponentId):l,u=t.displayName,h=u===void 0?function(M){return Ar(M)?"styled.".concat(M):"Styled(".concat(ac(M),")")}(e):u,p=t.displayName&&t.componentId?"".concat(Os(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,x=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var d=t.shouldForwardProp;x=function(M,k){return v(M,k)&&d(M,k)}}else x=v}var y=new _c(n,p,r?i.componentStyle:void 0);function b(M,k){return function(E,R,re){var X=E.attrs,ie=E.componentStyle,le=E.defaultProps,$=E.foldedComponentIds,F=E.styledComponentId,T=E.target,Q=xt.useContext(ko),Te=Ns(),te=E.shouldForwardProp||Te.shouldForwardProp,Pe=tc(R,Q,le)||Ct,B=function(xn,$t,wn){for(var Vt,at=me(me({},$t),{className:void 0,theme:wn}),mr=0;mre?"2px 8px 8px 2px":"8px 2px 2px 8px"}; - } - - &:last-child { - border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; - } -`,de=U.div` - background-color: ${({$pressed:e})=>e?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"}; - border: none; - display: flex; - align-items: center; - justify-content: center; - color: white; - border-radius: 5px; - font-size: 14px; - font-family: Arial, sans-serif; - height: 20px; - width: 20px; - transition: all 0.2s ease-in-out; -`,Po=U.div` - display: flex; - align-items: center; - height: 24px; - margin-bottom: 2px; - justify-content: flex-start; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; -`,zt=U.div` - display: flex; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; - height: 100%; - justify-content: space-between; - align-items: center; -`;U.button` - background-color: rgba(255, 255, 255, 0.3); - border: none; - display: flex; - justify-content: center; - align-items: center; - padding: 0; - pointer-events: none; - width: 50px; - height: 50px; - border-radius: 50%; - position: relative; - margin: 0 5px; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); -`;U.div` - position: absolute; - background-color: white; - border-radius: 50%; - width: 36px; - height: 36px; - cursor: pointer; - pointer-events: auto; -`;const Ao=U.input.attrs({type:"range"})` - -webkit-appearance: none; - appearance: none; - background-color: rgba(255, 255, 255, 0.3); - border: none; - height: 100%; - width: 49px; - cursor: pointer; - margin: 0 1px; - transition: all 0.2s ease-in-out; - border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; - - &::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } - - &::-moz-range-thumb { - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } - - &::-ms-thumb { - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } -`,zc=U.div` - display: flex; - flex-direction: column; - align-items: ${({$reverse:e})=>e?"flex-start":"flex-end"}; - justify-content: center; - margin: ${({$reverse:e})=>e?"2px -26px 0 0":"2px 0 0 -26px"}; -`,qs=U.div` - display: flex; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; - align-items: center; - justify-content: center; -`;U.div` - display: flex; - flex-direction: column; - height: 50px; - justify-content: space-between; -`;const K=U(un)` - height: 14px; - min-height: 14px; - max-height: 14px; - width: 14px; - min-width: 14px; - max-width: 14px; -`,Nc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),Dc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),$c=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),Vc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Hc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Zc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Xc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Bc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Yc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Wc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Gc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Uc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Kc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),Jc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),e2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),t2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),n2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),r2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),i2={"x-button-left":Nc,"y-button-left":Dc,"a-button-right":$c,"b-button-right":Vc,"thumbstick-left":qc,"thumbstick-up-left":Zc,"thumbstick-down-left":Xc,"thumbstick-right-left":Yc,"thumbstick-left-left":Bc,"thumbstick-right":Hc,"thumbstick-up-right":Wc,"thumbstick-down-right":Qc,"thumbstick-right-right":Uc,"thumbstick-left-right":Gc,"trigger-left":e2,"trigger-right":t2,"squeeze-left":Kc,"squeeze-right":Jc,"thumbrest-left":n2,"thumbrest-right":r2},hn=({buttonName:e,handedness:t})=>{const n=`${e}-${t}`,r=i2[n];return r?f.jsx(r,{}):f.jsx("div",{style:{width:"28px",height:"28px"}})},s2=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M1 11.2A5.2 5.2 0 0 1 6.2 6h15.6a5.2 5.2 0 0 1 5.2 5.2v5.2a5.2 5.2 0 0 1-5.2 5.2h-3.109c-1.149 0-2.199-.65-2.713-1.677l-.199-.398a1.733 1.733 0 0 0-1.55-.958h-.458c-.656 0-1.257.37-1.55.958l-.2.398A3.033 3.033 0 0 1 9.31 21.6H6.2A5.2 5.2 0 0 1 1 16.4v-5.2Zm9.1 2.167a2.6 2.6 0 1 1-5.2 0 2.6 2.6 0 0 1 5.2 0Zm15.538-1.426a.498.498 0 0 0 .141-.542l.002-.002a5.456 5.456 0 0 0-.347-.755l-.104-.178a5.586 5.586 0 0 0-.486-.686.502.502 0 0 0-.54-.15l-1.225.39a4.234 4.234 0 0 0-.968-.56l-.275-1.256a.497.497 0 0 0-.4-.392 5.686 5.686 0 0 0-1.871.003.497.497 0 0 0-.4.391l-.276 1.257a4.234 4.234 0 0 0-.968.559l-1.226-.39a.498.498 0 0 0-.539.15 5.586 5.586 0 0 0-.486.686l-.104.179c-.134.242-.25.492-.347.754a.498.498 0 0 0 .14.542l.953.867a4.26 4.26 0 0 0 0 1.12l-.952.867a.498.498 0 0 0-.141.541c.097.262.213.513.347.755l.104.178c.145.242.308.471.486.687.13.156.346.211.54.15l1.223-.392c.295.226.62.416.968.559l.275 1.256c.044.2.198.359.4.392a5.686 5.686 0 0 0 1.871 0 .497.497 0 0 0 .4-.392l.276-1.256c.347-.143.673-.333.968-.56l1.225.39c.194.062.41.009.54-.15a5.59 5.59 0 0 0 .486-.686l.103-.178a5.45 5.45 0 0 0 .348-.755.498.498 0 0 0-.14-.541l-.954-.867a4.258 4.258 0 0 0 0-1.118l.953-.867ZM20.5 15.967a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})}),a2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),o2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),l2={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Pi={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},c2={prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]},f2={prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]},Hs={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},u2={prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]},Io={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]},d2={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},h2={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},p2={prefix:"fas",iconName:"square-arrow-up-right",icon:[448,512,["external-link-square"],"f14c","M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]},m2={prefix:"fas",iconName:"keyboard",icon:[576,512,[9e3],"f11c","M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]},Ro={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]},g2={prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Zs={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},y2={prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]},v2={prefix:"fas",iconName:"arrows-up-down",icon:[320,512,["arrows-v"],"f07d","M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]},x2={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},qe={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:f.jsx(K,{icon:u2}),Backspace:f.jsx(K,{icon:g2}),Enter:f.jsx(K,{style:{transform:"rotate(90deg)"},icon:y2}),ShiftLeft:f.jsx(K,{icon:Zs}),ShiftRight:f.jsx(K,{icon:Zs}),Space:" ",ArrowUp:f.jsx(K,{icon:Io}),ArrowDown:f.jsx(K,{icon:Ro}),ArrowLeft:f.jsx(K,{icon:f2}),ArrowRight:f.jsx(K,{icon:c2}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:f.jsx(a2,{}),MouseRight:f.jsx(o2,{})},w2={left:{"thumbstick-up":"KeyW","thumbstick-down":"KeyS","thumbstick-left":"KeyA","thumbstick-right":"KeyD",thumbstick:"KeyR","x-button":"KeyX","y-button":"KeyZ",trigger:"KeyQ",squeeze:"KeyE"},right:{"thumbstick-up":"ArrowUp","thumbstick-down":"ArrowDown","thumbstick-left":"ArrowLeft","thumbstick-right":"ArrowRight",thumbstick:"Slash","a-button":"Enter","b-button":"ShiftRight",trigger:"MouseLeft",squeeze:"MouseRight"}},b2=U.div` - display: flex; - justify-content: space-between; - pointer-events: all; - position: fixed; - display: flex; - top: 40px; - left: calc(50vw - 156px); - width: 312px; -`,Xs=U.div` - display: flex; - flex-direction: column; - width: 50%; -`,Bs=U.div` - display: flex; - height: 24px; - align-items: center; - margin-bottom: 2px; -`,S2=({keyMap:e,setKeyMap:t})=>{const[n,r]=D.useState(null),i=(s,o)=>{r({controller:s,action:o})},a=(s,o)=>{t(l=>({...l,[s]:{...l[s],[o]:"Unmapped"}}))};return D.useEffect(()=>{const s=c=>{n&&qe[c.code]&&(t(u=>({...u,[n.controller]:{...u[n.controller],[n.action]:c.code}})),r(null))},o=c=>{if(n){const u=c.button===0?"MouseLeft":c.button===2?"MouseRight":null;u&&qe[u]&&(t(h=>({...h,[n.controller]:{...h[n.controller],[n.action]:u}})),r(null))}},l=c=>{c.preventDefault()};return window.addEventListener("keydown",s),window.addEventListener("mousedown",o),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("mousedown",o),window.removeEventListener("contextmenu",l)}},[n,t]),f.jsxs(b2,{children:[f.jsx(Xs,{children:Object.keys(e.left).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"left"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="left"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("left",s),onContextMenu:o=>o.preventDefault(),children:e.left[s]}),f.jsx(oe,{style:{width:"24px"},$reverse:!1,onClick:()=>a("left",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))}),f.jsx(Xs,{children:Object.keys(e.right).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"right"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="right"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("right",s),onContextMenu:o=>o.preventDefault(),children:e.right[s]}),f.jsx(oe,{$reverse:!1,style:{width:"24px"},onClick:()=>a("right",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))})]})},M2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(0),p=e.inputSource.handedness;return D.useEffect(()=>{const g=y=>{y.code===r&&(e.updateButtonValue(t,1),c(!0))},x=y=>{y.code===r&&(e.updateButtonValue(t,0),c(!1))},v=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,1),c(!0))},d=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,0),c(!1))};return n?r==="MouseLeft"||r==="MouseRight"?(window.addEventListener("mousedown",v),window.addEventListener("mouseup",d)):(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x))}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:l,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{o(!0),e.updateButtonValue(t,1),setTimeout(()=>{o(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ao,{$reverse:p==="right",value:u,onChange:g=>{const x=Number(g.target.value);h(x),e.updateButtonValue(t,x/100)},min:"0",max:"100"})]})})]})},k2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(!1),p=e.inputSource.handedness;return D.useEffect(()=>{const g=v=>{v.code===r&&(e.updateButtonValue(t,1),h(!0))},x=v=>{v.code===r&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:u,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:l?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout(()=>{c(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{o(!s),e.updateButtonValue(t,s?0:1)},children:"Hold"})]})})]})},E2=U.div` - display: flex; - align-items: center; - margin-bottom: 2px; -`,P2=U.button` - background-color: rgba(255, 255, 255, 0.3); - border: none; - display: flex; - justify-content: center; - align-items: center; - padding: 0; - pointer-events: none; - width: 50px; - height: 50px; - border-radius: 50%; - position: relative; - margin: 0 5px; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); -`,A2=U.div` - position: absolute; - background-color: white; - border-radius: 50%; - width: 36px; - height: 36px; - cursor: pointer; - pointer-events: auto; -`,Ys=U(oe)` - width: 49px; - font-size: 14px; - - ${({$reverse:e})=>e?` - &:first-child { - margin-left: 1px; - border-radius: 2px 8px 8px 2px; - } - - &:last-child { - margin-right: 1px; - border-radius: 8px 2px 2px 8px; - } - `:` - &:first-child { - margin-right: 1px; - border-radius: 8px 2px 2px 8px; - } - - &:last-child { - margin-left: 1px; - border-radius: 2px 8px 8px 2px; - } - `} -`,I2=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:r,mappedKeyDown:i,mappedKeyLeft:a,mappedKeyRight:s,mappedKeyPressed:o})=>{const l=D.useRef(null),[c,u]=D.useState(!1),[h,p]=D.useState(!1),[g,x]=D.useState(!1),[v,d]=D.useState(!1),[y,b]=D.useState({x:0,y:0}),[w,M]=D.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),k=e.inputSource.handedness,E=()=>{if(l.current){const X=l.current.getBoundingClientRect();b({x:X.left+X.width/2,y:X.top+X.height/2}),u(!0)}},R=X=>{if(c&&l.current){const ie=X.clientX-y.x,le=X.clientY-y.y,$=Math.sqrt(ie*ie+le*le),F=12;let T,Q;if(${u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return D.useEffect(()=>{const X=$=>{const F={...w};$.code===r&&(F.up=!0),$.code===i&&(F.down=!0),$.code===a&&(F.left=!0),$.code===s&&(F.right=!0),$.code===o&&(F.pressed=!0,e.updateButtonValue(n,1)),M(F),le(F)},ie=$=>{const F={...w};$.code===r&&(F.up=!1),$.code===i&&(F.down=!1),$.code===a&&(F.left=!1),$.code===s&&(F.right=!1),$.code===o&&(F.pressed=!1,e.updateButtonValue(n,0)),M(F),le(F)},le=$=>{const F=($.right?1:0)-($.left?1:0),T=($.down?1:0)-($.up?1:0),Q=Math.sqrt(F*F+T*T);if(Q===0){e.updateAxes(n,0,0);return}const Te=F/Q,te=T/Q;e.updateAxes(n,Te,te)};return t?(window.addEventListener("keydown",X),window.addEventListener("keyup",ie)):(window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)}},[r,i,a,s,t,w]),D.useEffect(()=>(document.addEventListener("mousemove",R),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",re)}),[c,y]),f.jsxs(E2,{style:{flexDirection:e.inputSource.handedness==="left"?"row":"row-reverse",alignItems:"flex-start"},children:[f.jsx(hn,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),t?f.jsxs(zc,{$reverse:k==="right",children:[f.jsxs(qs,{$reverse:k==="right",children:[f.jsx(de,{$pressed:w.up,style:{margin:"2px"},children:qe[r]}),f.jsx(de,{$pressed:w.pressed,style:{margin:"2px"},children:qe[o]})]}),f.jsxs(qs,{$reverse:!1,children:[f.jsx(de,{$pressed:w.left,style:{margin:"2px"},children:qe[a]}),f.jsx(de,{$pressed:w.down,style:{margin:"2px"},children:qe[i]}),f.jsx(de,{$pressed:w.right,style:{margin:"2px"},children:qe[s]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(P2,{style:{margin:e.inputSource.handedness==="left"?"0 5px 0 -3px":"0 -3px 0 5px"},children:f.jsx(A2,{ref:l,onMouseDown:E})}),f.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[f.jsx(oe,{$reverse:k==="right",style:{backgroundColor:v?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"80px",marginBottom:"2px",borderRadius:"8px"},onClick:()=>{d(!0),e.updateButtonValue(n,1),setTimeout(()=>{d(!1),e.updateButtonValue(n,0)},500)},children:"Press"}),f.jsxs(zt,{$reverse:k==="right",children:[f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:h?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{p(!h),e.updateButtonTouch(n,!h)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:g?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{x(!g),e.updateButtonValue(n,g?0:1)},children:"Hold"})]})]})]})]})},R2=U.div` - padding: ${({$reverse:e})=>e?"6px 2px 3px 5px":"6px 5px 3px 2px"}; - pointer-events: all; - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border-radius: ${({$reverse:e})=>e?"12px 0 0 0":"0 12px 0 0"}; -`;function O2(e){const t=new Set;for(const r of e.axes)r&&r.id&&t.add(r.id);const n=e.buttons.filter(r=>r!==null).map(r=>({id:r.id,type:r.type,hasAxes:t.has(r.id)}));return n.sort((r,i)=>r.hasAxes&&!i.hasAxes?-1:!r.hasAxes&&i.hasAxes?1:0),n}const L2=({xrDevice:e,keyMap:t,pointerLocked:n})=>f.jsx("div",{style:{display:"flex",justifyContent:"space-between",flexDirection:"row"},children:Object.entries(e.controllers).map(([r,i])=>f.jsx(R2,{$reverse:r!=="left",children:O2(i.gamepadConfig).map(a=>{const s=t[r];return a.hasAxes?f.jsx(I2,{xrController:i,pointerLocked:n,buttonId:a.id,mappedKeyUp:t[r][`${a.id}-up`],mappedKeyDown:s[`${a.id}-down`],mappedKeyLeft:s[`${a.id}-left`],mappedKeyRight:s[`${a.id}-right`],mappedKeyPressed:s[a.id]},a.id):a.type==="analog"?f.jsx(M2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id):f.jsx(k2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id)})},r))}),T2=U.div` - display: flex; - justify-content: center; - pointer-events: all; - position: fixed; - display: flex; - top: 40px; - left: calc(50vw - 156px); - width: 312px; -`,j2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(e.fovy);return f.jsx(T2,{children:f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,disabled:!0,children:"FOV-Y"}),f.jsx(Ao,{$reverse:!1,value:n,style:{width:"100px",borderRadius:"2px"},onChange:i=>{const a=Number(i.target.value);r(a),e.fovy=a,t.syncFovy(),t.renderScene()},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48}),f.jsxs(oe,{$reverse:!1,disabled:!0,children:[(n/Math.PI*180).toFixed(2),"°"]})]})})},_2=U.div` - padding: 6px 5px; - display: flex; - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - justify-content: center; - pointer-events: all; - border-radius: 0 0 12px 12px; - align-items: center; - height: 24px; -`,Ws=U.div` - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border: none; - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: center; - cursor: pointer; - color: white; - white-space: nowrap; - font-size: 14px; - text-transform: none; - box-shadow: none; - font-family: Arial, sans-serif; - border-radius: ${({$reverse:e})=>e?"0 0 0 12px":"0 0 12px 0"}; - padding: 5px; - - > div { - display: flex; - flex-direction: row; - align-items: center; - gap: 2px; - margin: 2px; - } -`,C2=({xrDevice:e,inputLayer:t,keyMapOpen:n,setKeyMapOpen:r,fovSettingOpen:i,setFovSettingOpen:a})=>f.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[f.jsxs(_2,{children:[f.jsx(s2,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",marginLeft:"4px"},children:[f.jsx(oe,{$reverse:!1,onClick:()=>{t.resetDeviceTransforms()},children:f.jsx(K,{icon:d2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{t.lockPointer(),r(!1),a(!1)},children:f.jsx(K,{icon:h2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{r(!n),a(!1)},children:f.jsx(K,{icon:m2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{a(!i),r(!1)},children:f.jsx(K,{icon:x2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{const s=e.activeSession;s==null||s.end()},children:f.jsx(K,{icon:l2})})]})]}),f.jsxs(Ws,{$reverse:!1,style:{position:"fixed",left:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:p2,style:{marginRight:"4px"}})," ","Roomscale Movement"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:"W"}),f.jsx(de,{$pressed:!1,children:"A"}),f.jsx(de,{$pressed:!1,children:"S"}),f.jsx(de,{$pressed:!1,children:"D"})]})]}),f.jsxs(Ws,{$reverse:!0,style:{position:"fixed",right:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:v2,style:{marginRight:"4px"}})," Camera Height"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Io})}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Ro})})]})]})]}),lt=new Lo,fe=new z,Ue=new z,Y=new Ae,Qs={X:new z(1,0,0),Y:new z(0,1,0),Z:new z(0,0,1)},Rr={type:"change"},Gs={type:"mouseDown"},Us={type:"mouseUp",mode:null},Ks={type:"objectChange"};class Js extends Lr{constructor(t,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const r=new V2;this._gizmo=r,this.add(r);const i=new q2;this._plane=i,this.add(i);const a=this;function s(b,w){let M=w;Object.defineProperty(a,b,{get:function(){return M!==void 0?M:w},set:function(k){M!==k&&(M=k,i[b]=k,r[b]=k,a.dispatchEvent({type:b+"-changed",value:k}),a.dispatchEvent(Rr))}}),a[b]=w,i[b]=w,r[b]=w}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new z,l=new z,c=new Ae,u=new Ae,h=new z,p=new Ae,g=new z,x=new z,v=new z,d=0,y=new z;s("worldPosition",o),s("worldPositionStart",l),s("worldQuaternion",c),s("worldQuaternionStart",u),s("cameraPosition",h),s("cameraQuaternion",p),s("pointStart",g),s("pointEnd",x),s("rotationAxis",v),s("rotationAngle",d),s("eye",y),this._offset=new z,this._startNorm=new z,this._endNorm=new z,this._cameraScale=new z,this._parentPosition=new z,this._parentQuaternion=new Ae,this._parentQuaternionInv=new Ae,this._parentScale=new z,this._worldScaleStart=new z,this._worldQuaternionInv=new Ae,this._worldScale=new z,this._positionStart=new z,this._quaternionStart=new Ae,this._scaleStart=new z,this._getPointer=F2.bind(this),this._onPointerDown=N2.bind(this),this._onPointerHover=z2.bind(this),this._onPointerMove=D2.bind(this),this._onPointerUp=$2.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(t){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(t)}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&<.setFromCamera(t,this.camera);const n=Or(this._gizmo.picker[this.mode],lt);n?this.axis=n.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&<.setFromCamera(t,this.camera);const n=Or(this._plane,lt,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Gs.mode=this.mode,this.dispatchEvent(Gs)}}pointerMove(t){const n=this.axis,r=this.mode,i=this.object;let a=this.space;if(r==="scale"?a="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(a="world"),i===void 0||n===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&<.setFromCamera(t,this.camera);const s=Or(this._plane,lt,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),a==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(i.position.applyQuaternion(Y.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),a==="world"&&(i.parent&&i.position.add(fe.setFromMatrixPosition(i.parent.matrixWorld)),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(fe.setFromMatrixPosition(i.parent.matrixWorld))));else if(r==="scale"){if(n.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ue.set(o,o,o)}else fe.copy(this.pointStart),Ue.copy(this.pointEnd),fe.applyQuaternion(this._worldQuaternionInv),Ue.applyQuaternion(this._worldQuaternionInv),Ue.divide(fe),n.search("X")===-1&&(Ue.x=1),n.search("Y")===-1&&(Ue.y=1),n.search("Z")===-1&&(Ue.z=1);i.scale.copy(this._scaleStart).multiply(Ue),this.scaleSnap&&(n.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(fe.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(fe.copy(this.rotationAxis).cross(this.eye))*o):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Qs[n]),fe.copy(Qs[n]),a==="local"&&fe.applyQuaternion(this.worldQuaternion),fe.cross(this.eye),fe.length()===0?l=!0:this.rotationAngle=this._offset.dot(fe.normalize())*o),(n==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),a==="local"&&n!=="E"&&n!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Rr),this.dispatchEvent(Ks)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Us.mode=this.mode,this.dispatchEvent(Us)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Rr),this.dispatchEvent(Ks),this.pointStart.copy(this.pointEnd))}getRaycaster(){return lt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function F2(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function z2(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e));break}}function N2(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function D2(e){this.enabled&&this.pointerMove(this._getPointer(e))}function $2(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Or(e,t,n){const r=t.intersectObject(e,!0);for(let i=0;i.9&&(s.visible=!1)),this.axis==="Y"&&(Y.setFromEuler(In.set(0,0,Math.PI/2)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),V.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(ta.lookAt(ea,V,ft)),s.quaternion.multiply(Y),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(fe),s.visible=this.dragging):(s.quaternion.copy(r),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&(Rn.copy(r),V.copy(this.eye).applyQuaternion(Y.copy(r).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(ta.lookAt(this.eye,ea,ft)),s.name==="X"&&(Y.setFromAxisAngle(Kt,Math.atan2(-V.y,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Y"&&(Y.setFromAxisAngle(ft,Math.atan2(V.x,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Z"&&(Y.setFromAxisAngle(Jt,Math.atan2(V.y,V.x)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(l){return s.name===l}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(t)}}class q2 extends A{constructor(){super(new Co(1e5,1e5,2,2),new si({visible:!1,wireframe:!0,side:Fo,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),On.copy(Kt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Yt.copy(ft).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Wt.copy(Jt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),V.copy(Yt),this.mode){case"translate":case"scale":switch(this.axis){case"X":V.copy(this.eye).cross(On),_e.copy(On).cross(V);break;case"Y":V.copy(this.eye).cross(Yt),_e.copy(Yt).cross(V);break;case"Z":V.copy(this.eye).cross(Wt),_e.copy(Wt).cross(V);break;case"XY":_e.copy(Wt);break;case"YZ":_e.copy(On);break;case"XZ":V.copy(Wt),_e.copy(Yt);break;case"XYZ":case"E":_e.set(0,0,0);break}break;case"rotate":default:_e.set(0,0,0)}_e.length()===0?this.quaternion.copy(this.cameraQuaternion):(na.lookAt(fe.set(0,0,0),_e,V),this.quaternion.setFromRotationMatrix(na)),super.updateMatrixWorld(t)}}const O=Symbol("@@iwer/devui/input-scene"),H2=.016;class Z2{constructor(t){const n=t.canvasContainer,r=new zo,i=new No(t.fovy/Math.PI*180,n.offsetWidth/n.offsetHeight,.1,1e3),a=new Ri,s=new Ri;r.add(a),a.add(s),s.position.fromArray(t.position.vec3),s.quaternion.fromArray(t.quaternion.quat),s.add(i),i.position.x-=t.ipd/2;const o=new A(new ce(.1,.1,.1)),l=o.clone();o.position.fromArray(t.controllers.left.position.vec3),o.quaternion.fromArray(t.controllers.left.quaternion.quat),l.position.fromArray(t.controllers.right.position.vec3),l.quaternion.fromArray(t.controllers.right.quaternion.quat),s.attach(o),s.attach(l),o.visible=!1,l.visible=!1;const c=new A(new Do(.25,.27,32),new si({color:16777215,side:$o}));c.rotateX(-Math.PI/2),r.add(c);const u=new Vo({alpha:!0});u.setSize(n.offsetWidth,n.offsetHeight),u.setClearColor(0,0),n.appendChild(u.domElement);const h=new Js(i,u.domElement);h.attach(o),r.add(h);const p=new Js(i,u.domElement);p.attach(l),r.add(p);const g=new ResizeObserver(()=>{this.resize()});g.observe(n);const x=d=>{d.addEventListener("mouseDown",()=>{d.userData.pressStart=performance.now()}),d.addEventListener("mouseUp",()=>{const y=performance.now()-d.userData.pressStart;d.userData.pressStart=null,y<200&&(d.mode==="rotate"?d.setMode("translate"):d.setMode("rotate"))}),d.addEventListener("change",()=>{this.renderScene()})};x(h),x(p);const v=d=>{if(!this[O].isPointerLocked)return;const y=d.movementX||d.mozMovementX||d.webkitMovementX||0,b=d.movementY||d.mozMovementY||d.webkitMovementY||0;a.rotation.y-=y*.002,s.rotation.x-=b*.002,t.quaternion.copy(s.getWorldQuaternion(new Ae)),this.renderScene()};this[O]={canvasContainer:n,renderer:u,scene:r,camera:i,playerRig:a,cameraRig:s,xrDevice:t,controllerIndicators:{left:o,right:l},transformControls:{left:h,right:p},headsetDefaultPosition:s.position.clone(),headsetDefaultQuaternion:s.quaternion.clone(),controllerDefaultPositions:{left:o.position.clone(),right:l.position.clone()},controllerDefaultQuaternions:{left:o.quaternion.clone(),right:l.quaternion.clone()},resizeObserver:g,isPointerLocked:!1,vec3:new z,quat:new Ae,mouseMoveHandler:v,keyState:{ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},movePlayerRig:()=>this.movePlayerRig(),moveInterval:null},document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){this[O].renderer.domElement.requestPointerLock=this[O].renderer.domElement.requestPointerLock||this[O].renderer.domElement.mozRequestPointerLock||this[O].renderer.domElement.webkitRequestPointerLock,this[O].renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this[O].isPointerLocked=document.pointerLockElement===this[O].renderer.domElement||document.mozPointerLockElement===this[O].renderer.domElement||document.webkitPointerLockElement===this[O].renderer.domElement,this[O].isPointerLocked?(document.addEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!1,t.visible=!1})):(document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!0,t.visible=!0}))}keyDownHandler(t){const{keyState:n,movePlayerRig:r,moveInterval:i}=this[O];t.code in n&&(n[t.code]=!0),n.ShiftLeft&&(n.KeyW||n.KeyA||n.KeyS||n.KeyD)&&(i||(this[O].moveInterval=window.setInterval(r,16))),n.ShiftLeft&&n.ArrowUp&&(this[O].cameraRig.position.y+=.05,this.renderScene()),n.ShiftLeft&&n.ArrowDown&&(this[O].cameraRig.position.y-=.05,this.renderScene())}keyUpHandler(t){const{keyState:n,moveInterval:r}=this[O];t.code in n&&(n[t.code]=!1),(!n.ShiftLeft||!(n.KeyW||n.KeyA||n.KeyS||n.KeyD))&&r&&(window.clearInterval(r),this[O].moveInterval=null)}movePlayerRig(){const{playerRig:t,keyState:n,vec3:r}=this[O];r.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),r.lengthSq()>0&&(r.normalize().multiplyScalar(H2).applyQuaternion(t.quaternion),t.position.add(r),this.renderScene())}syncFovy(){this[O].camera.fov=this[O].xrDevice.fovy/Math.PI*180,this[O].camera.updateProjectionMatrix()}resetDeviceTransforms(){const{playerRig:t,cameraRig:n,controllerIndicators:r}=this[O];n.position.copy(this[O].headsetDefaultPosition),n.quaternion.set(0,0,0,1),t.position.set(0,0,0),t.quaternion.set(0,0,0,1),Object.entries(r).forEach(([i,a])=>{a.position.copy(this[O].controllerDefaultPositions[i]),a.quaternion.copy(this[O].controllerDefaultQuaternions[i])}),this.syncDeviceTransforms(),this.renderScene()}syncDeviceTransforms(){const{xrDevice:t,cameraRig:n,controllerIndicators:r}=this[O];t.position.copy(n.getWorldPosition(this[O].vec3)),t.quaternion.copy(n.getWorldQuaternion(this[O].quat)),Object.entries(r).forEach(([i,a])=>{t.controllers[i].position.copy(a.getWorldPosition(this[O].vec3)),t.controllers[i].quaternion.copy(a.getWorldQuaternion(this[O].quat))})}renderScene(){this.syncDeviceTransforms(),this[O].renderer.render(this[O].scene,this[O].camera)}get domElement(){return this[O].renderer.domElement}resize(){const t=this[O].canvasContainer.offsetWidth,n=this[O].canvasContainer.offsetHeight;this[O].renderer.setSize(t,n),this[O].camera.aspect=t/n,this[O].camera.updateProjectionMatrix(),this.renderScene()}dispose(){this[O].resizeObserver.disconnect(),this[O].renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const X2=Symbol("@@iwer/devui/devui");class B2{constructor(t){t.ipd=0;const n=t.canvasContainer,r=document.createElement("div");r.style.position="fixed",r.style.width="100%",r.style.height="100%",r.style.top="0",r.style.left="0",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="3",n.appendChild(r);const i=new Z2(t),a=i.domElement;a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.zIndex="2",n.appendChild(a),qo(r).render(f.jsx(Y2,{xrDevice:t,inputLayer:i})),this[X2]={xrDevice:t,inputLayer:i}}}const Y2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(!1),[i,a]=D.useState(w2),[s,o]=D.useState(!1),[l,c]=D.useState(!1);return D.useEffect(()=>{const u=()=>{const h=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!h)};return document.addEventListener("pointerlockchange",u,!1),document.addEventListener("mozpointerlockchange",u,!1),document.addEventListener("webkitpointerlockchange",u,!1),()=>{document.removeEventListener("pointerlockchange",u,!1),document.removeEventListener("mozpointerlockchange",u,!1),document.removeEventListener("webkitpointerlockchange",u,!1)}},[]),f.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsx(C2,{xrDevice:e,inputLayer:t,keyMapOpen:s,setKeyMapOpen:o,fovSettingOpen:l,setFovSettingOpen:c}),s&&f.jsx(S2,{keyMap:i,setKeyMap:a}),l&&f.jsx(j2,{xrDevice:e,inputLayer:t}),f.jsx(L2,{xrDevice:e,keyMap:i,pointerLocked:n})]})},W2={metaQuest3:C0,metaQuest2:j0,metaQuestPro:_0,oculusQuest1:T0};function G2(e){const t=new A0(W2[e]);t.ipd=0,t.installRuntime(),new B2(t)}export{G2 as emulate}; diff --git a/examples/stage/assets/index-Da-88g1w.js b/examples/stage/assets/index-BZrPM0HJ.js similarity index 99% rename from examples/stage/assets/index-Da-88g1w.js rename to examples/stage/assets/index-BZrPM0HJ.js index 76f320b..6c57462 100644 --- a/examples/stage/assets/index-Da-88g1w.js +++ b/examples/stage/assets/index-BZrPM0HJ.js @@ -4152,4 +4152,4 @@ void main() { `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),e.fragmentShader=`varying float vFade; `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function n5(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function i5(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,c=`${i}end`,h=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(c,a)}}function r5(n){var e;return n.getButtonsDown().size>0?.6:BB(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function og(n){return n.getButtonsDown().size>0?.6:.4}function s5(n){var e;return BB(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function BB(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function o5(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function LB(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function a5(n,e,t,i){i==null||i.copy(n.matrix);const r=DB(n,i);return r!=null||e==null||t==null?r:(i!=null&&LB(n,e,i),t)}function DB({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??DB(n,e)}function l5(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:c=!1,hitTest:h=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Ks(t,"anchors",m,y),Ks(i,"hand-tracking",m,y),Ks(r,"layers",m,y),Ks(s,"mesh-detection",m,y),Ks(o,"plane-detection",m,y),Ks(c,"depth-sensing",m,y),Ks(p,"dom-overlay",m,y),Ks(h,"hit-test",m,y),n!="immersive-vr"&&Ks(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Ks(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function Ko(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&u5(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function u5(n,e){return e in n}function FB(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const NB={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function QT(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?lV(()=>import("./emulate-DM86Bhli.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n)})}function c5(n){const e="metaQuest3";let t;{window.location.hostname==="localhost"&&QT(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&QT(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=SB(()=>({...NB,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=Q8({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=p5(r,o),l=d5(n==null?void 0:n.enterGrantedSession,p=>em(i,p,n,d));let c;const h=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>h.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}={};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),c==null||c(),c=h5(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&OB(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({hand:x})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({controller:x})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({transientPointer:x})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({detectedPlane:x})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({detectedMesh:x})},destroy(){t==null||t(),s==null||s(),c==null||c(),l==null||l(),a(void 0,void 0)},enterXR:p=>em(i,p,n,d),enterAR:()=>em(i,"immersive-ar",n,d),enterVR:()=>em(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:x}=r.getState(),_=m.parent??p,g=(d==null?void 0:d.getReferenceSpace())??void 0;x!=_&&(_.xrSpace=g,r.setState({origin:_}));const{originReferenceSpace:S}=r.getState();if(g!=S&&(_.xrSpace=g,r.setState({originReferenceSpace:g})),y==null)return;d!=null&&m5(r,y,d);const M=h.length;for(let E=0;E component?"));const r=await navigator.xr.requestSession(e,l5(e,n,t));return OB(r,"high"),f5(i,r),r}function f5(n,e,t){n!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(e),n==null||n.setSession(e))}const ZT=["immersive-ar","immersive-vr","inline"];function h5(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function d5(n=ZT,e){var i;if(n===!1)return;n===!0&&(n=ZT);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function p5(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(NB)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function m5(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const c=qT(s,e.detectedPlanes),h=qT(r,e.detectedMeshes);(s!=c||r!=h)&&n.setState({detectedPlanes:c,detectedMeshes:h});const d=a.length;for(let m=0;m{t instanceof an&&t.material instanceof _n&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function x5(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>A5(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=S5(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function S5(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?$T(n).x:.5;case"yAxis":return i?$T(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const pf=new pe;function $T({xAxis:n=0,yAxis:e=0}){if(pf.lengthSq()>1){const i=Math.atan2(e,n);pf.set(Math.cos(i),Math.sin(i))}else pf.set(n,e);return pf.multiplyScalar(.5).addScalar(.5),pf}function M5({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function E5({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[w5[t]];if(i!=null)return[i]}const w5={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class Ui{constructor(e,t,i,r,s,o=s.object,a=o){Nt(this,"type");Nt(this,"bubbles");Nt(this,"nativeEvent");Nt(this,"pointer");Nt(this,"intersection");Nt(this,"currentObject");Nt(this,"object");Nt(this,"stopPropagation");Nt(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new Ui(t,i,r,s,o,e,a)}}class DS extends Ui{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new DS(r,s,o,e,a)}}function Lr(n){UB(n,n.currentObject)}function UB(n,e){if(e==null)return;const t=E5(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];Lr(new Ui("pointerenter",!1,e,this,i,l))}if(i!=null&&Lr(new Ui("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}Lr(new Ui("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&Lr(new Ui("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&Lr(new DS(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function HB(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),HB(n.parent,e,t,i)}function T5(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function OS(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function C5(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function sv(n,e,t,i,r,s=!1,o,a,l){const c=s||M5(n),h=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;C5(c,h??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let x=0;x0)&&(n=c,o=l)}return o}function R5(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Qs=new Uh,b5=new qe,_u=[];function I5(n,e,t,i,r,s,o,a){if(o!=null)return P5(n,e,o);let l,c;if(sv(t,i,r,s,(h,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(Ky.origin.copy(r).applyMatrix4(n),Ky.direction.copy(s).applyMatrix4(n).sub(Qs.ray.origin).normalize(),Ky.intersectPlane(t,tC)!=null)return tC.clone()}}const Yy=new Uh,Qy=new O,nC=new Ur,L5=new qe,tm=[];function D5(n,e,t,i,r,s,o,a,l){if(a!=null)return F5(n,e,t,a);let c,h;if(Yy.ray.origin.copy(n),Yy.ray.direction.copy(t).applyQuaternion(e),sv(i,r,s,o,(d,p)=>{d.raycast(Yy,tm);const m=US(c,h,tm,p,l);m!=null&&(c=tm[m],h=p),tm.length=0}),c!=null)return Object.assign(c,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:c.point,localPoint:c.point.clone().applyMatrix4(L5.copy(c.object.matrixWorld).invert())})}const iC=new yo;function F5(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;Qy.copy(t).applyQuaternion(e),iC.set(n,Qy),OS(nC,i,r);const s=iC.intersectPlane(nC,new O)??i.point;return{...i,object:r,pointOnFace:s,point:Qy.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const Zy=new Vn,nm=[];function zB(n,e,t,i,r,s,o,a,l){if(a!=null)return U5(n,e,a);let c,h;if(Zy.center.copy(n),Zy.radius=t,sv(i,r,s,o,(d,p)=>{O5(Zy,d,nm);const m=US(c,h,nm,p,l);m!=null&&(c=nm[m],h=p),nm.length=0}),c!=null)return Object.assign(c,{details:{type:"sphere"},pointOnFace:c.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:c.point.clone().applyMatrix4(ag.copy(c.object.matrixWorld).invert())})}const im=new qe;function N5(n){return"spherecast"in n}function O5(n,e,t){if(e.updateWorldMatrix(!0,!1),N5(e)){e.spherecast(n,t);return}if(e instanceof Ph){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;qy.max(k5);const o=Ju.center.clone().sub(lC);o.divide(qy),H5(o);const a=rm.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function H5(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const Vx={radius:.07};function z5(n,e,t=Vx,i="grab"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),zB(r,s,t.radius??Vx.radius,a,o,i,e,c,t)},void 0,void 0,void 0,t)}const G5=new O(0,0,-1),V5=new O,Ef={direction:G5,minDistance:0,linePoints:null};function W5(n,e,t=Ef,i="ray"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h==null)return;h.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Ef.linePoints;if(p==null?(r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),d=D5(r,s,t.direction??Ef.direction,a,o,i,e,c,t)):d=I5(h.matrixWorld,p,a,o,i,e,c,t),!(d==null||d.distance*h.getWorldScale(V5).x<(t.minDistance??Ef.minDistance)))return d},void 0,void 0,void 0,t)}const Ku={button:0,downRadius:.03,hoverRadius:.1};function X5(n,e,t=Ku,i="touch"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),zB(r,s,t.hoverRadius??Ku.hoverRadius,a,o,i,e,c,t)},j5(t),void 0,void 0,t)}function j5(n=Ku){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=J5(i,n.downRadius??Ku.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??Ku.button};r?t.down(s):t.up(s),e=r}}function J5(n,e){return n==null?!1:n.distance<=e}let K5=23412;function kS(){return K5++}new O;new pe;let Y5=class{constructor(){Nt(this,"pointers",[]);Nt(this,"isDefaults",[]);Nt(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new At;return t.setIndex(new xt(n.indices,1)),t.setAttribute("position",new xt(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function fC(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(Q5(n.polygon),{createdAt:n.lastChangedTime})}const gf=new LP,sm=new pe;function Q5(n){const e=new aa,t=n.map(({x:r,z:s})=>new pe(r,s));gf.setFromPoints(t),gf.getSize(sm);for(const r of t)r.sub(gf.min),r.divide(sm);e.setFromPoints(t);const i=new Nh(e);return i.scale(sm.x,sm.y,1),i.translate(gf.min.x,gf.min.y,0),i.rotateX(Math.PI/2),i}new O;new O;new O;const vf=new ir(0,0,0,"YXZ"),om=new un;function Z5(n,e,t){n.matrixWorld.decompose(e.position,om,e.scale),vf.setFromQuaternion(om),vf.z=0,vf.x=bm(vf.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),om.setFromEuler(vf),e.quaternion.slerp(om,t/100)}function q5(n){return n.userData.teleportTarget===!0}function $5(n={}){return e=>!(!q5(e.object)||n.customFilter!=null&&!n.customFilter(e))}function e9(){return new kg(new O(0,0,0),new O(0,0,-8),new O(0,-20,-15)).getPoints(20)}let t9=class extends an{constructor(t){const i=new $4,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:c=.4,size:h=.01}=this.options;this.material.lineWidth=h,this.material.opacity=typeof c=="function"?c(t):c;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const am=new qe,lm=new O,hC=new un;async function n9(n,e,t=["point","plane","mesh"]){var l,c;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=a5(e,o.origin,o.originReferenceSpace,am)??o.originReferenceSpace,r===o.originReferenceSpace&&LB(e,o.origin,am),lm.setFromMatrixPosition(am);const h={...lm};hC.setFromRotationMatrix(am),lm.set(0,0,-1).applyQuaternion(hC);const d={...lm};i=new XRRay(h,d)}const a=await((c=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:c.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:i9.bind(null,r,s)}}function i9(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new O(1,1,1);new O(1,1,1);new qe;new qe;new O;new O;const GB=new t8,VB="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",r9="generic-trigger";class s9{constructor(e){Nt(this,"baseAssetPath");Nt(this,"defaultProfileId");Nt(this,"profilesListPromise");Nt(this,"profilePromisesMap",new Map);Nt(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??VB,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??r9}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=dC(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;sn.visibilityState)}function c9(n,e){const t=Y.useRef(e);t.current=e;const[i,r]=Y.useMemo(()=>{let s;return[o=>{let a=!1;return navigator.xr==null?(s=!1,()=>{}):(navigator.xr.isSessionSupported(n).then(l=>{s=l,!a&&o()}).catch(l=>{var c;a||(c=t.current)==null||c.call(t,l)}),()=>a=!0)},()=>s]},[n]);return Y.useSyncExternalStore(i,r)}Y.forwardRef(({id:n,children:e,onPress:t,onRelease:i},r)=>{const s=HS(),[o,a]=Y.useState(void 0);if(Y.useImperativeHandle(r,()=>o,[o]),f9(n,l=>l==="pressed"?t==null?void 0:t():i==null?void 0:i()),di(()=>{var l;return a((l=s.gamepad[n])==null?void 0:l.object)}),o!=null)return iv(e,o)});function f9(n,e,t){const i=HS(),r=Y.useRef();di(()=>{var o;const s=(o=i==null?void 0:i.gamepad[n])==null?void 0:o.state;s!=null&&s!=r.current&&e(s),r.current=s})}function HS(n){const e=Y.useContext(Ds);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const h9=Symbol("loadXRControllerModel"),d9=Y.forwardRef((n,e)=>{const t=HS(),i=TS(y5,[t.layout,void 0,h9]);_5(i,n),t.object=i,Y.useImperativeHandle(e,()=>i,[i]);const r=Y.useMemo(()=>x5(i,t.layout,t.gamepad),[i,t.layout,t.gamepad]);return di(r),ie.jsx("primitive",{object:i})});function zS(n){const e=Y.useContext(Ds);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const p9=Symbol("loadXRHandModel"),m9=Y.forwardRef((n,e)=>{const t=zS(),i=TS(G8,[t.assetPath,void 0,p9]);V8(i,n),Y.useImperativeHandle(e,()=>i,[i]);const r=U9(),s=Y.useMemo(()=>J8(t.inputSource.hand,i,r),[t.inputSource,i,r]);return di((o,a,l)=>s(l)),ie.jsx("primitive",{object:i})});Y.forwardRef(({joint:n,children:e},t)=>{const i=zS();return ie.jsx(Jr,{ref:t,space:i.inputSource.hand.get(n),children:e})});function KB({children:n}){const e=Y.useMemo(()=>new Y5,[]);return QB(e),di(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),ie.jsx(JB.Provider,{value:e,children:n})}function g9(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Vx,t);const s=Y.useMemo(()=>z5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}function YB(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Ef,t);const s=Y.useMemo(()=>W5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}function v9(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Ku,t);const s=Y.useMemo(()=>X5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}const y9=Y.forwardRef((n,e)=>{const t=Y.useMemo(()=>new t5,[]),i=Y.useRef(null);return Y.useImperativeHandle(e,()=>i.current,[]),di(()=>i.current!=null&&n5(i.current,t,n.pointer,n)),ie.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:n.renderOrder??2,ref:i,material:t,children:ie.jsx("boxGeometry",{})})}),ov=Y.forwardRef((n,e)=>{const t=Y.useMemo(()=>new q8,[]),i=Y.useRef(null);Y.useImperativeHandle(e,()=>i.current,[]),di(()=>i.current!=null&&e5(i.current,t,n.pointer,n));const r=gi(s=>s.scene);return iv(ie.jsx("mesh",{renderOrder:n.renderOrder??1,ref:i,matrixAutoUpdate:!1,material:t,children:ie.jsx("planeGeometry",{})}),r)});function GS(n,e,t,i){const r=Xn(s=>s.session);Y.useEffect(()=>{if(r!=null)return i5(n,r,e,t,i)},[t,e,n,r,i])}function VS(n,e=!1){const t=Y.useContext(JB);t==null?(QB(n),di(i=>n.move(i.scene,{timeStamp:performance.now()}),-50)):Y.useEffect(()=>t.register(n,e),[t,n,e]),Y.useEffect(()=>()=>n.exit({timeStamp:performance.now()}),[n])}function QB(n){const e=WS();Y.useEffect(()=>Z8(e,t=>n.setEnabled(t,{timeStamp:performance.now()})),[e,n])}const _9=Y.forwardRef(({pointer:n,linePoints:e,...t},i)=>{const r=Y.useMemo(()=>new t9(e),[e]);return Y.useImperativeHandle(i,()=>r,[r]),r.options=t,di(()=>r.update(n)),ie.jsx("primitive",{object:r})});function ZB(n,e,t){const i=Y.useContext(Ds);if(i==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const r=Y.useRef(null),s=g9(r,i,t);GS(s,i.inputSource,n,i.events);const o=t.cursorModel;return ie.jsx(Jr,{ref:r,space:e(i.inputSource),children:o!==!1&&ie.jsx(ov,{pointer:s,opacity:r5,...vi(o)})})}const x9=ZB.bind(null,"select",n=>n.hand.get("index-finger-tip")),A9=ZB.bind(null,"squeeze",n=>n.gripSpace);function Wh(n){const e=Y.useContext(Ds);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=Y.useRef(null),i=YB(t,e,n);GS(i,e.inputSource,"select",e.events);const r=n.rayModel,s=n.cursorModel;return ie.jsxs(Jr,{ref:t,space:e.inputSource.targetRaySpace,children:[r!==!1&&ie.jsx(y9,{pointer:i,opacity:og,...vi(r)}),s!==!1&&ie.jsx(ov,{pointer:i,opacity:og,...vi(s)})]})}function S9(n){const e=zS(),t=Y.useRef(null),i=v9(t,e,n),r=n.cursorModel;return ie.jsx(Jr,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:r!==!1&&ie.jsx(ov,{pointer:i,opacity:s5,...vi(r)})})}function M9(n){const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.teleportPointer??!1;return ie.jsxs(ie.Fragment,{children:[e!==!1&&ie.jsx(Y.Suspense,{children:ie.jsx(d9,{...vi(e)})}),ie.jsxs(KB,{children:[t!==!1&&ie.jsx(A9,{...vi(t)}),i!==!1&&ie.jsx(Wh,{makeDefault:!0,minDistance:.2,...vi(i)}),r!==!1&&ie.jsx(qB,{...vi(r)})]})]})}function E9(n){var a;const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.touchPointer,s=n.teleportPointer??!1,o=i===!1?!1:(a=vi(i))==null?void 0:a.rayModel;return ie.jsxs(ie.Fragment,{children:[e!==!1&&ie.jsx(Y.Suspense,{children:ie.jsx(m9,{...vi(e)})}),ie.jsxs(KB,{children:[t!==!1&&ie.jsx(x9,{...vi(t)}),r!==!1&&ie.jsx(S9,{...vi(r)}),i!==!1&&ie.jsx(Wh,{makeDefault:!0,minDistance:.2,...vi(i),rayModel:o===!1?!1:{maxLength:.2,...vi(o)}}),s!==!1&&ie.jsx(qB,{...vi(s)})]})]})}function w9(n){return ie.jsx(Wh,{...n,rayModel:!1})}function T9(n){return ie.jsx(Wh,{...n,rayModel:!1})}function C9(n){return ie.jsx(Wh,{...n,cursorModel:!1,rayModel:!1})}function qB(n){const e=Y.useContext(Ds);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=Y.useRef(null),i=Y.useRef(null),r=Y.useMemo(()=>e9(),[]),s=YB(i,e,{...n,linePoints:r,customFilter:$5(n)},"teleport");GS(s,e.inputSource,"select",e.events);const o=n.rayModel,a=n.cursorModel,l=gi(h=>h.scene),c=Y.useRef(null);return di((h,d)=>{c.current!=null&&(c.current.visible=s.getEnabled()&&s.getButtonsDown().size>0);const p=i.current,m=t.current;p==null||m==null||Z5(m,p,d*1e3)}),ie.jsxs(ie.Fragment,{children:[ie.jsx(Jr,{ref:t,space:e.inputSource.targetRaySpace}),iv(ie.jsxs("group",{ref:i,children:[o!==!1&&ie.jsx(_9,{linePoints:r,pointer:s,opacity:og,...vi(o)}),a!==!1&&ie.jsx(ov,{ref:c,pointer:s,opacity:og,...vi(a)})]}),l)]})}function vi(n){if(n!==!0)return n}function R9({children:n}){const e=Xn(o=>o.originReferenceSpace),t=Xn(o=>o.origin),i=u9()==="visible",r=Hh(),s=Y.useMemo(()=>Object.assign({},r,{getState(){return{...r.getState(),scene:t}}}),[t,r]);return t==null||e==null?null:ie.jsx(ie.Fragment,{children:lc.createPortal(ie.jsx(nv.Provider,{value:r,children:ie.jsxs(Vh.Provider,{value:e,children:[ie.jsxs("group",{matrixAutoUpdate:!1,visible:i,children:[ie.jsx(b9,{}),ie.jsx(I9,{}),ie.jsx(P9,{}),ie.jsx(B9,{}),ie.jsx(L9,{})]}),ie.jsx(D9,{}),ie.jsx(F9,{}),n]})}),s,null)})}function b9(){const n=Xn(t=>t.controllerStates);let e=Xn(t=>t.controller);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.gripSpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(M9,{...i})})})},Bl(t))})})}function I9(){const n=Xn(t=>t.handStates),e=Xn(t=>t.hand);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.hand.get("wrist"),children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(E9,{...i})})})},Bl(t))})})}function P9(){const n=Xn(t=>t.transientPointerStates),e=Xn(t=>t.transientPointer);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(w9,{...i})})})},Bl(t))})})}function B9(){const n=Xn(t=>t.gazeStates),e=Xn(t=>t.gaze);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof e=="function"?ie.jsx(e,{}):ie.jsx(T9,{...$B(e)})})})},Bl(t)))})}function L9(){const n=Xn(t=>t.screenInputStates),e=Xn(t=>t.screenInput);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof e=="function"?ie.jsx(e,{}):ie.jsx(C9,{...$B(e)})})})},Bl(t)))})}function $B(n){if(n!==!0)return n}function D9(){const n=Xn(t=>t.detectedMeshes),e=Xn(t=>t.detectedMesh);if(e!==!1)return ie.jsx(ie.Fragment,{children:n.map(t=>{const i=FB(e,t.semanticLabel,!1);return i===!1?null:ie.jsx(Jr,{space:t.meshSpace,children:ie.jsx(XB.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:ie.jsx(i,{})})})},Bl(t))})})}function F9(){const n=Xn(t=>t.detectedPlanes),e=Xn(t=>t.detectedPlane);if(e!=null)return ie.jsx(ie.Fragment,{children:n.map(t=>{const i=FB(e,t.semanticLabel,!1);return i===!1?null:ie.jsx(Jr,{space:t.planeSpace,children:ie.jsx(jB.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:ie.jsx(i,{})})})},Bl(t))})})}function N9(n){return c5(n)}function O9({children:n,store:e}){e.setWebXRManager(gi(i=>i.gl.xr));const t=Hh();return Y.useEffect(()=>{let i;return e.subscribe((r,s)=>{const o=r.mode!=null,a=s.mode!=null;if(o!==a){if(o){const{camera:l,gl:c}=t.getState();i=l,t.setState({camera:c.xr.getCamera()});return}i!=null&&t.setState({camera:i})}})},[t,e]),di((i,r,s)=>e.onBeforeFrame(i.scene,i.camera,s),-1e3),ie.jsxs(WB.Provider,{value:e,children:[ie.jsx(R9,{}),n]})}function WS(){const n=Y.useContext(WB);if(n==null)throw new Error("XR features can only be used inside the component");return n}function Xn(n=e=>e){return LS(WS(),n)}const Jr=Y.forwardRef(({space:n,children:e},t)=>{const i=Y.useRef(null);return Y.useImperativeHandle(t,()=>i.current,[]),H9(i,n,(r,s,o)=>{i.current!=null&&(i.current.visible=o!=null)}),ie.jsx("group",{xrSpace:n,visible:!1,matrixAutoUpdate:!1,ref:i,children:ie.jsx(Vh.Provider,{value:n,children:e})})});function U9(){const n=Y.useContext(Vh);if(n==null)throw new Error("XR objects must be placed inside the XROrigin");return n}function k9(n){const e=Y.useContext(Vh),t=Xn(i=>e??i.originReferenceSpace);return Y.useMemo(()=>t==null?void 0:o5(n,t),[n,t])}function H9(n,e,t){const i=k9(e);di((r,s,o)=>{n.current==null||i==null||(i(n.current.matrix,o),t==null||t(r,s,o))},-100)}Y.forwardRef((n,e)=>{const t=z9(),i=G9(t);return ie.jsx("mesh",{ref:e,geometry:i,...n})});function z9(){const n=Y.useContext(XB);if(n==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return n}function G9(n,e=!0){const[t,i]=Y.useState(cC(n,void 0));return di(()=>i(r=>cC(n,r))),Y.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}Y.forwardRef((n,e)=>{const t=V9(),i=W9(t);return ie.jsx("mesh",{ref:e,geometry:i,...n})});function V9(){const n=Y.useContext(jB);if(n==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return n}function W9(n,e=!0){const[t,i]=Y.useState(fC(n,void 0));return di(()=>i(r=>fC(n,r))),Y.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const X9=Y.forwardRef(({children:n,...e},t)=>{const i=gi(s=>s.gl.xr.getCamera()),r=Xn(s=>s.originReferenceSpace);return r==null?null:ie.jsxs("group",{ref:t,...e,children:[ie.jsx("primitive",{object:i}),ie.jsx(Vh.Provider,{value:r,children:n})]})});function j9(n,e,t){const i=Y.useRef(void 0);J9(e,t,Y.useCallback(r=>i.current=r,[])),di((r,s,o)=>{n==null||o==null||i.current==null||n(o.getHitTestResults(i.current.source),i.current.getWorldMatrix)})}function J9(n,e,t){const i=WS();Y.useEffect(()=>{let r,s=!1;const o=n instanceof XRSpace?n:n.current;if(o!=null)return n9(i,o,e).then(a=>{s||(r=a,t(a))}),()=>{t(void 0),s=!0,r==null||r.source.cancel()}},[i,n,e,t])}Y.forwardRef((n,e)=>{const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current),j9(n.onResults,t,n.trackableType),ie.jsx("group",{...n,ref:t})});Y.forwardRef((n,e)=>{const t=Xn(s=>s.domOverlayRoot),{In:i,Out:r}=Y.useMemo(qV,[]);return Y.useEffect(()=>{const s=UA(t);return s.render(ie.jsx(r,{})),()=>s.unmount()},[t,r]),ie.jsx(i,{children:ie.jsx("div",{...n,ref:e})})});const eL=Y.forwardRef(({store:n,mode:e,onError:t,children:i,...r},s)=>{const o=LS(n,l=>l.session),a=c9(e,t);return ie.jsx("button",{ref:s,...r,onClick:()=>o!=null?o.end():n.enterXR(e).catch(t),children:typeof i=="function"?i(a?o!=null?"entered":"exited":"unsupported"):i})});Y.forwardRef((n,e)=>ie.jsx(eL,{ref:e,mode:"immersive-ar",...n}));Y.forwardRef((n,e)=>ie.jsx(eL,{ref:e,mode:"immersive-vr",...n}));const K9={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:n=>n.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:n=>n.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:n=>n.pointerType==="ray"},onSqueeze:{type:"click",filter:n=>n.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:n=>n.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:n=>n.pointerType==="grab"}};function Ys(n,e,t){const i=Y.useRef(t);i.current=t,Y.useEffect(()=>{const{current:r}=n;if(r==null)return;const s=K9[e],o=typeof s=="string"?l=>{var c;return(c=i.current)==null?void 0:c.call(i,{intersection:l,intersections:[l],target:l.pointerState})}:l=>{var c;l instanceof Ui&&!s.filter(l)||(c=i.current)==null||c.call(i,{intersection:l,intersections:[l],target:l.pointerState})},a=typeof s=="string"?s:s.type;return r.addEventListener(a,o),()=>r.removeEventListener(a,o)},[n,e])}const Y9=Y.forwardRef(({onHover:n,onBlur:e,onSelectStart:t,onSelectEnd:i,onSelect:r,onSqueezeStart:s,onSqueezeEnd:o,onSqueeze:a,onMove:l,children:c},h)=>{const d=Y.useRef(null);return Y.useImperativeHandle(h,()=>d.current),Ys(d,"onHover",n),Ys(d,"onBlur",e),Ys(d,"onSelectStart",t),Ys(d,"onSelectEnd",i),Ys(d,"onSelect",r),Ys(d,"onSqueezeStart",s),Ys(d,"onSqueezeEnd",o),Ys(d,"onSqueeze",a),Ys(d,"onMove",l),ie.jsx("group",{ref:d,children:c})});Y.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:i,...r},s){const o=Y.useRef(),a=Y.useRef(null),l=Y.useMemo(()=>new qe,[]);return Y.useImperativeHandle(s,()=>a.current),di(()=>{const c=o.current,h=a.current;!h||!c||(h.applyMatrix4(l),h.applyMatrix4(c.matrixWorld),h.updateMatrixWorld(),l.copy(c.matrixWorld).invert())}),ie.jsx(Y9,{ref:a,onSelectStart:c=>{K8(c.target)&&(c.target.type==="controller"||c.target.type==="hand")&&c.target.object!=null&&(o.current=c.target.object,l.copy(c.target.object.matrixWorld).invert(),e==null||e(c))},onSelectEnd:c=>{c.target.controller===o.current&&(o.current=void 0),t==null||t(c)},...r,children:i})});const mC=N9();function Q9(){return ie.jsxs(ie.Fragment,{children:[ie.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>mC.enterAR(),children:"Enter AR"}),ie.jsx(WG,{shadows:!0,camera:{position:[4,0,6],fov:35},children:ie.jsxs(O9,{store:mC,children:[ie.jsxs("group",{position:[0,-.75,0],children:[ie.jsx(Y.Suspense,{children:ie.jsx(uV,{top:!0,children:ie.jsx($V,{})})}),ie.jsx("directionalLight",{position:[1,8,1],castShadow:!0}),ie.jsx("ambientLight",{}),ie.jsxs("mesh",{receiveShadow:!0,"rotation-x":-Math.PI/2,scale:100,children:[ie.jsx("shadowMaterial",{opacity:.7}),ie.jsx("planeGeometry",{})]}),ie.jsx("group",{position:[0,0,2.6],children:ie.jsx(X9,{})})]}),ie.jsx(sV,{}),ie.jsx(TV,{preset:"dawn",blur:1})]})})]})}UA(document.getElementById("root")).render(ie.jsx(Y.StrictMode,{children:ie.jsx(Q9,{})}));export{ya as B,yc as C,fr as D,ir as E,ot as F,Gr as G,Ai as L,qe as M,kt as O,_o as P,un as Q,Uh as R,Oh as S,Kg as T,O as V,aS as W,Gn as a,At as b,an as c,Fh as d,Ps as e,oc as f,lg as g,Mn as h,jg as i,ie as j,us as k,UA as l,kf as o,Y as r}; + diffuseColor.a *= vFade;`)}}function n5(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function i5(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,c=`${i}end`,h=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(c,a)}}function r5(n){var e;return n.getButtonsDown().size>0?.6:BB(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function og(n){return n.getButtonsDown().size>0?.6:.4}function s5(n){var e;return BB(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function BB(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function o5(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function LB(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function a5(n,e,t,i){i==null||i.copy(n.matrix);const r=DB(n,i);return r!=null||e==null||t==null?r:(i!=null&&LB(n,e,i),t)}function DB({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??DB(n,e)}function l5(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:c=!1,hitTest:h=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Ks(t,"anchors",m,y),Ks(i,"hand-tracking",m,y),Ks(r,"layers",m,y),Ks(s,"mesh-detection",m,y),Ks(o,"plane-detection",m,y),Ks(c,"depth-sensing",m,y),Ks(p,"dom-overlay",m,y),Ks(h,"hit-test",m,y),n!="immersive-vr"&&Ks(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Ks(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function Ko(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&u5(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function u5(n,e){return e in n}function FB(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const NB={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function QT(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?lV(()=>import("./emulate-Cko4tTGd.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n)})}function c5(n){const e="metaQuest3";let t;{window.location.hostname==="localhost"&&QT(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&QT(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=SB(()=>({...NB,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=Q8({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=p5(r,o),l=d5(n==null?void 0:n.enterGrantedSession,p=>em(i,p,n,d));let c;const h=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>h.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}={};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),c==null||c(),c=h5(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&OB(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({hand:x})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({controller:x})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({transientPointer:x})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({detectedPlane:x})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,x={};typeof y=="object"&&Object.assign(x,y),Object.assign(x,{default:Ko(y,void 0,{}),[m]:p}),r.setState({detectedMesh:x})},destroy(){t==null||t(),s==null||s(),c==null||c(),l==null||l(),a(void 0,void 0)},enterXR:p=>em(i,p,n,d),enterAR:()=>em(i,"immersive-ar",n,d),enterVR:()=>em(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:x}=r.getState(),_=m.parent??p,g=(d==null?void 0:d.getReferenceSpace())??void 0;x!=_&&(_.xrSpace=g,r.setState({origin:_}));const{originReferenceSpace:S}=r.getState();if(g!=S&&(_.xrSpace=g,r.setState({originReferenceSpace:g})),y==null)return;d!=null&&m5(r,y,d);const M=h.length;for(let E=0;E component?"));const r=await navigator.xr.requestSession(e,l5(e,n,t));return OB(r,"high"),f5(i,r),r}function f5(n,e,t){n!=null&&(XRWebGLLayer.getNativeFramebufferScaleFactor(e),n==null||n.setSession(e))}const ZT=["immersive-ar","immersive-vr","inline"];function h5(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function d5(n=ZT,e){var i;if(n===!1)return;n===!0&&(n=ZT);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function p5(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(NB)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function m5(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const c=qT(s,e.detectedPlanes),h=qT(r,e.detectedMeshes);(s!=c||r!=h)&&n.setState({detectedPlanes:c,detectedMeshes:h});const d=a.length;for(let m=0;m{t instanceof an&&t.material instanceof _n&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function x5(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>A5(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=S5(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function S5(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?$T(n).x:.5;case"yAxis":return i?$T(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const pf=new pe;function $T({xAxis:n=0,yAxis:e=0}){if(pf.lengthSq()>1){const i=Math.atan2(e,n);pf.set(Math.cos(i),Math.sin(i))}else pf.set(n,e);return pf.multiplyScalar(.5).addScalar(.5),pf}function M5({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function E5({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[w5[t]];if(i!=null)return[i]}const w5={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class Ui{constructor(e,t,i,r,s,o=s.object,a=o){Nt(this,"type");Nt(this,"bubbles");Nt(this,"nativeEvent");Nt(this,"pointer");Nt(this,"intersection");Nt(this,"currentObject");Nt(this,"object");Nt(this,"stopPropagation");Nt(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new Ui(t,i,r,s,o,e,a)}}class DS extends Ui{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new DS(r,s,o,e,a)}}function Lr(n){UB(n,n.currentObject)}function UB(n,e){if(e==null)return;const t=E5(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];Lr(new Ui("pointerenter",!1,e,this,i,l))}if(i!=null&&Lr(new Ui("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}Lr(new Ui("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&Lr(new Ui("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&Lr(new DS(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function HB(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),HB(n.parent,e,t,i)}function T5(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function OS(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function C5(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function sv(n,e,t,i,r,s=!1,o,a,l){const c=s||M5(n),h=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;C5(c,h??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let x=0;x0)&&(n=c,o=l)}return o}function R5(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Qs=new Uh,b5=new qe,_u=[];function I5(n,e,t,i,r,s,o,a){if(o!=null)return P5(n,e,o);let l,c;if(sv(t,i,r,s,(h,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(Ky.origin.copy(r).applyMatrix4(n),Ky.direction.copy(s).applyMatrix4(n).sub(Qs.ray.origin).normalize(),Ky.intersectPlane(t,tC)!=null)return tC.clone()}}const Yy=new Uh,Qy=new O,nC=new Ur,L5=new qe,tm=[];function D5(n,e,t,i,r,s,o,a,l){if(a!=null)return F5(n,e,t,a);let c,h;if(Yy.ray.origin.copy(n),Yy.ray.direction.copy(t).applyQuaternion(e),sv(i,r,s,o,(d,p)=>{d.raycast(Yy,tm);const m=US(c,h,tm,p,l);m!=null&&(c=tm[m],h=p),tm.length=0}),c!=null)return Object.assign(c,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:c.point,localPoint:c.point.clone().applyMatrix4(L5.copy(c.object.matrixWorld).invert())})}const iC=new yo;function F5(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;Qy.copy(t).applyQuaternion(e),iC.set(n,Qy),OS(nC,i,r);const s=iC.intersectPlane(nC,new O)??i.point;return{...i,object:r,pointOnFace:s,point:Qy.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const Zy=new Vn,nm=[];function zB(n,e,t,i,r,s,o,a,l){if(a!=null)return U5(n,e,a);let c,h;if(Zy.center.copy(n),Zy.radius=t,sv(i,r,s,o,(d,p)=>{O5(Zy,d,nm);const m=US(c,h,nm,p,l);m!=null&&(c=nm[m],h=p),nm.length=0}),c!=null)return Object.assign(c,{details:{type:"sphere"},pointOnFace:c.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:c.point.clone().applyMatrix4(ag.copy(c.object.matrixWorld).invert())})}const im=new qe;function N5(n){return"spherecast"in n}function O5(n,e,t){if(e.updateWorldMatrix(!0,!1),N5(e)){e.spherecast(n,t);return}if(e instanceof Ph){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;qy.max(k5);const o=Ju.center.clone().sub(lC);o.divide(qy),H5(o);const a=rm.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function H5(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const Vx={radius:.07};function z5(n,e,t=Vx,i="grab"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),zB(r,s,t.radius??Vx.radius,a,o,i,e,c,t)},void 0,void 0,void 0,t)}const G5=new O(0,0,-1),V5=new O,Ef={direction:G5,minDistance:0,linePoints:null};function W5(n,e,t=Ef,i="ray"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h==null)return;h.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Ef.linePoints;if(p==null?(r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),d=D5(r,s,t.direction??Ef.direction,a,o,i,e,c,t)):d=I5(h.matrixWorld,p,a,o,i,e,c,t),!(d==null||d.distance*h.getWorldScale(V5).x<(t.minDistance??Ef.minDistance)))return d},void 0,void 0,void 0,t)}const Ku={button:0,downRadius:.03,hoverRadius:.1};function X5(n,e,t=Ku,i="touch"){const r=new O,s=new un,o=kS();return new NS(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),zB(r,s,t.hoverRadius??Ku.hoverRadius,a,o,i,e,c,t)},j5(t),void 0,void 0,t)}function j5(n=Ku){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=J5(i,n.downRadius??Ku.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??Ku.button};r?t.down(s):t.up(s),e=r}}function J5(n,e){return n==null?!1:n.distance<=e}let K5=23412;function kS(){return K5++}new O;new pe;let Y5=class{constructor(){Nt(this,"pointers",[]);Nt(this,"isDefaults",[]);Nt(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new At;return t.setIndex(new xt(n.indices,1)),t.setAttribute("position",new xt(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function fC(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(Q5(n.polygon),{createdAt:n.lastChangedTime})}const gf=new LP,sm=new pe;function Q5(n){const e=new aa,t=n.map(({x:r,z:s})=>new pe(r,s));gf.setFromPoints(t),gf.getSize(sm);for(const r of t)r.sub(gf.min),r.divide(sm);e.setFromPoints(t);const i=new Nh(e);return i.scale(sm.x,sm.y,1),i.translate(gf.min.x,gf.min.y,0),i.rotateX(Math.PI/2),i}new O;new O;new O;const vf=new ir(0,0,0,"YXZ"),om=new un;function Z5(n,e,t){n.matrixWorld.decompose(e.position,om,e.scale),vf.setFromQuaternion(om),vf.z=0,vf.x=bm(vf.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),om.setFromEuler(vf),e.quaternion.slerp(om,t/100)}function q5(n){return n.userData.teleportTarget===!0}function $5(n={}){return e=>!(!q5(e.object)||n.customFilter!=null&&!n.customFilter(e))}function e9(){return new kg(new O(0,0,0),new O(0,0,-8),new O(0,-20,-15)).getPoints(20)}let t9=class extends an{constructor(t){const i=new $4,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:c=.4,size:h=.01}=this.options;this.material.lineWidth=h,this.material.opacity=typeof c=="function"?c(t):c;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const am=new qe,lm=new O,hC=new un;async function n9(n,e,t=["point","plane","mesh"]){var l,c;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=a5(e,o.origin,o.originReferenceSpace,am)??o.originReferenceSpace,r===o.originReferenceSpace&&LB(e,o.origin,am),lm.setFromMatrixPosition(am);const h={...lm};hC.setFromRotationMatrix(am),lm.set(0,0,-1).applyQuaternion(hC);const d={...lm};i=new XRRay(h,d)}const a=await((c=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:c.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:i9.bind(null,r,s)}}function i9(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new O(1,1,1);new O(0,0,0);new qe;new qe;new O;new O;const GB=new t8,VB="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",r9="generic-trigger";class s9{constructor(e){Nt(this,"baseAssetPath");Nt(this,"defaultProfileId");Nt(this,"profilesListPromise");Nt(this,"profilePromisesMap",new Map);Nt(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??VB,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??r9}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=dC(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;sn.visibilityState)}function c9(n,e){const t=Y.useRef(e);t.current=e;const[i,r]=Y.useMemo(()=>{let s;return[o=>{let a=!1;return navigator.xr==null?(s=!1,()=>{}):(navigator.xr.isSessionSupported(n).then(l=>{s=l,!a&&o()}).catch(l=>{var c;a||(c=t.current)==null||c.call(t,l)}),()=>a=!0)},()=>s]},[n]);return Y.useSyncExternalStore(i,r)}Y.forwardRef(({id:n,children:e,onPress:t,onRelease:i},r)=>{const s=HS(),[o,a]=Y.useState(void 0);if(Y.useImperativeHandle(r,()=>o,[o]),f9(n,l=>l==="pressed"?t==null?void 0:t():i==null?void 0:i()),di(()=>{var l;return a((l=s.gamepad[n])==null?void 0:l.object)}),o!=null)return iv(e,o)});function f9(n,e,t){const i=HS(),r=Y.useRef();di(()=>{var o;const s=(o=i==null?void 0:i.gamepad[n])==null?void 0:o.state;s!=null&&s!=r.current&&e(s),r.current=s})}function HS(n){const e=Y.useContext(Ds);if(e==null||e.type!="controller")throw new Error('useXRControllerState() can only be used inside a or using useXRControllerState("left")');return e}const h9=Symbol("loadXRControllerModel"),d9=Y.forwardRef((n,e)=>{const t=HS(),i=TS(y5,[t.layout,void 0,h9]);_5(i,n),t.object=i,Y.useImperativeHandle(e,()=>i,[i]);const r=Y.useMemo(()=>x5(i,t.layout,t.gamepad),[i,t.layout,t.gamepad]);return di(r),ie.jsx("primitive",{object:i})});function zS(n){const e=Y.useContext(Ds);if(e==null||e.type!="hand")throw new Error('useXRHandState() can only be used inside a or with using useXRHandState("left")');return e}const p9=Symbol("loadXRHandModel"),m9=Y.forwardRef((n,e)=>{const t=zS(),i=TS(G8,[t.assetPath,void 0,p9]);V8(i,n),Y.useImperativeHandle(e,()=>i,[i]);const r=U9(),s=Y.useMemo(()=>J8(t.inputSource.hand,i,r),[t.inputSource,i,r]);return di((o,a,l)=>s(l)),ie.jsx("primitive",{object:i})});Y.forwardRef(({joint:n,children:e},t)=>{const i=zS();return ie.jsx(Jr,{ref:t,space:i.inputSource.hand.get(n),children:e})});function KB({children:n}){const e=Y.useMemo(()=>new Y5,[]);return QB(e),di(t=>e.move(t.scene,{timeStamp:performance.now()}),-50),ie.jsx(JB.Provider,{value:e,children:n})}function g9(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Vx,t);const s=Y.useMemo(()=>z5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}function YB(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Ef,t);const s=Y.useMemo(()=>W5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}function v9(n,e,t,i){const r=Y.useMemo(()=>({}),[]);Object.assign(r,Ku,t);const s=Y.useMemo(()=>X5(n,e,r,i),[n,e,r,i]);return VS(s,t==null?void 0:t.makeDefault),s}const y9=Y.forwardRef((n,e)=>{const t=Y.useMemo(()=>new t5,[]),i=Y.useRef(null);return Y.useImperativeHandle(e,()=>i.current,[]),di(()=>i.current!=null&&n5(i.current,t,n.pointer,n)),ie.jsx("mesh",{matrixAutoUpdate:!1,renderOrder:n.renderOrder??2,ref:i,material:t,children:ie.jsx("boxGeometry",{})})}),ov=Y.forwardRef((n,e)=>{const t=Y.useMemo(()=>new q8,[]),i=Y.useRef(null);Y.useImperativeHandle(e,()=>i.current,[]),di(()=>i.current!=null&&e5(i.current,t,n.pointer,n));const r=gi(s=>s.scene);return iv(ie.jsx("mesh",{renderOrder:n.renderOrder??1,ref:i,matrixAutoUpdate:!1,material:t,children:ie.jsx("planeGeometry",{})}),r)});function GS(n,e,t,i){const r=Xn(s=>s.session);Y.useEffect(()=>{if(r!=null)return i5(n,r,e,t,i)},[t,e,n,r,i])}function VS(n,e=!1){const t=Y.useContext(JB);t==null?(QB(n),di(i=>n.move(i.scene,{timeStamp:performance.now()}),-50)):Y.useEffect(()=>t.register(n,e),[t,n,e]),Y.useEffect(()=>()=>n.exit({timeStamp:performance.now()}),[n])}function QB(n){const e=WS();Y.useEffect(()=>Z8(e,t=>n.setEnabled(t,{timeStamp:performance.now()})),[e,n])}const _9=Y.forwardRef(({pointer:n,linePoints:e,...t},i)=>{const r=Y.useMemo(()=>new t9(e),[e]);return Y.useImperativeHandle(i,()=>r,[r]),r.options=t,di(()=>r.update(n)),ie.jsx("primitive",{object:r})});function ZB(n,e,t){const i=Y.useContext(Ds);if(i==null)throw new Error("DefaultXRInputSourceGrabPointer can only be used inside a XRInputSource");const r=Y.useRef(null),s=g9(r,i,t);GS(s,i.inputSource,n,i.events);const o=t.cursorModel;return ie.jsx(Jr,{ref:r,space:e(i.inputSource),children:o!==!1&&ie.jsx(ov,{pointer:s,opacity:r5,...vi(o)})})}const x9=ZB.bind(null,"select",n=>n.hand.get("index-finger-tip")),A9=ZB.bind(null,"squeeze",n=>n.gripSpace);function Wh(n){const e=Y.useContext(Ds);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=Y.useRef(null),i=YB(t,e,n);GS(i,e.inputSource,"select",e.events);const r=n.rayModel,s=n.cursorModel;return ie.jsxs(Jr,{ref:t,space:e.inputSource.targetRaySpace,children:[r!==!1&&ie.jsx(y9,{pointer:i,opacity:og,...vi(r)}),s!==!1&&ie.jsx(ov,{pointer:i,opacity:og,...vi(s)})]})}function S9(n){const e=zS(),t=Y.useRef(null),i=v9(t,e,n),r=n.cursorModel;return ie.jsx(Jr,{ref:t,space:e.inputSource.hand.get("index-finger-tip"),children:r!==!1&&ie.jsx(ov,{pointer:i,opacity:s5,...vi(r)})})}function M9(n){const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.teleportPointer??!1;return ie.jsxs(ie.Fragment,{children:[e!==!1&&ie.jsx(Y.Suspense,{children:ie.jsx(d9,{...vi(e)})}),ie.jsxs(KB,{children:[t!==!1&&ie.jsx(A9,{...vi(t)}),i!==!1&&ie.jsx(Wh,{makeDefault:!0,minDistance:.2,...vi(i)}),r!==!1&&ie.jsx(qB,{...vi(r)})]})]})}function E9(n){var a;const e=n.model,t=n.grabPointer,i=n.rayPointer,r=n.touchPointer,s=n.teleportPointer??!1,o=i===!1?!1:(a=vi(i))==null?void 0:a.rayModel;return ie.jsxs(ie.Fragment,{children:[e!==!1&&ie.jsx(Y.Suspense,{children:ie.jsx(m9,{...vi(e)})}),ie.jsxs(KB,{children:[t!==!1&&ie.jsx(x9,{...vi(t)}),r!==!1&&ie.jsx(S9,{...vi(r)}),i!==!1&&ie.jsx(Wh,{makeDefault:!0,minDistance:.2,...vi(i),rayModel:o===!1?!1:{maxLength:.2,...vi(o)}}),s!==!1&&ie.jsx(qB,{...vi(s)})]})]})}function w9(n){return ie.jsx(Wh,{...n,rayModel:!1})}function T9(n){return ie.jsx(Wh,{...n,rayModel:!1})}function C9(n){return ie.jsx(Wh,{...n,cursorModel:!1,rayModel:!1})}function qB(n){const e=Y.useContext(Ds);if(e==null)throw new Error("DefaultXRInputSourceRayPointer can only be used inside a XRInputSource");const t=Y.useRef(null),i=Y.useRef(null),r=Y.useMemo(()=>e9(),[]),s=YB(i,e,{...n,linePoints:r,customFilter:$5(n)},"teleport");GS(s,e.inputSource,"select",e.events);const o=n.rayModel,a=n.cursorModel,l=gi(h=>h.scene),c=Y.useRef(null);return di((h,d)=>{c.current!=null&&(c.current.visible=s.getEnabled()&&s.getButtonsDown().size>0);const p=i.current,m=t.current;p==null||m==null||Z5(m,p,d*1e3)}),ie.jsxs(ie.Fragment,{children:[ie.jsx(Jr,{ref:t,space:e.inputSource.targetRaySpace}),iv(ie.jsxs("group",{ref:i,children:[o!==!1&&ie.jsx(_9,{linePoints:r,pointer:s,opacity:og,...vi(o)}),a!==!1&&ie.jsx(ov,{ref:c,pointer:s,opacity:og,...vi(a)})]}),l)]})}function vi(n){if(n!==!0)return n}function R9({children:n}){const e=Xn(o=>o.originReferenceSpace),t=Xn(o=>o.origin),i=u9()==="visible",r=Hh(),s=Y.useMemo(()=>Object.assign({},r,{getState(){return{...r.getState(),scene:t}}}),[t,r]);return t==null||e==null?null:ie.jsx(ie.Fragment,{children:lc.createPortal(ie.jsx(nv.Provider,{value:r,children:ie.jsxs(Vh.Provider,{value:e,children:[ie.jsxs("group",{matrixAutoUpdate:!1,visible:i,children:[ie.jsx(b9,{}),ie.jsx(I9,{}),ie.jsx(P9,{}),ie.jsx(B9,{}),ie.jsx(L9,{})]}),ie.jsx(D9,{}),ie.jsx(F9,{}),n]})}),s,null)})}function b9(){const n=Xn(t=>t.controllerStates);let e=Xn(t=>t.controller);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.gripSpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(M9,{...i})})})},Bl(t))})})}function I9(){const n=Xn(t=>t.handStates),e=Xn(t=>t.hand);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.hand.get("wrist"),children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(E9,{...i})})})},Bl(t))})})}function P9(){const n=Xn(t=>t.transientPointerStates),e=Xn(t=>t.transientPointer);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>{const i=Ko(e,t.inputSource.handedness,{});return i===!1?null:ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof i=="function"?ie.jsx(i,{}):ie.jsx(w9,{...i})})})},Bl(t))})})}function B9(){const n=Xn(t=>t.gazeStates),e=Xn(t=>t.gaze);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof e=="function"?ie.jsx(e,{}):ie.jsx(T9,{...$B(e)})})})},Bl(t)))})}function L9(){const n=Xn(t=>t.screenInputStates),e=Xn(t=>t.screenInput);return e===!1?null:ie.jsx(ie.Fragment,{children:n.map(t=>ie.jsx(Jr,{space:t.inputSource.targetRaySpace,children:ie.jsx(Ds.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:typeof e=="function"?ie.jsx(e,{}):ie.jsx(C9,{...$B(e)})})})},Bl(t)))})}function $B(n){if(n!==!0)return n}function D9(){const n=Xn(t=>t.detectedMeshes),e=Xn(t=>t.detectedMesh);if(e!==!1)return ie.jsx(ie.Fragment,{children:n.map(t=>{const i=FB(e,t.semanticLabel,!1);return i===!1?null:ie.jsx(Jr,{space:t.meshSpace,children:ie.jsx(XB.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:ie.jsx(i,{})})})},Bl(t))})})}function F9(){const n=Xn(t=>t.detectedPlanes),e=Xn(t=>t.detectedPlane);if(e!=null)return ie.jsx(ie.Fragment,{children:n.map(t=>{const i=FB(e,t.semanticLabel,!1);return i===!1?null:ie.jsx(Jr,{space:t.planeSpace,children:ie.jsx(jB.Provider,{value:t,children:ie.jsx(Y.Suspense,{children:ie.jsx(i,{})})})},Bl(t))})})}function N9(n){return c5(n)}function O9({children:n,store:e}){e.setWebXRManager(gi(i=>i.gl.xr));const t=Hh();return Y.useEffect(()=>{let i;return e.subscribe((r,s)=>{const o=r.mode!=null,a=s.mode!=null;if(o!==a){if(o){const{camera:l,gl:c}=t.getState();i=l,t.setState({camera:c.xr.getCamera()});return}i!=null&&t.setState({camera:i})}})},[t,e]),di((i,r,s)=>e.onBeforeFrame(i.scene,i.camera,s),-1e3),ie.jsxs(WB.Provider,{value:e,children:[ie.jsx(R9,{}),n]})}function WS(){const n=Y.useContext(WB);if(n==null)throw new Error("XR features can only be used inside the component");return n}function Xn(n=e=>e){return LS(WS(),n)}const Jr=Y.forwardRef(({space:n,children:e},t)=>{const i=Y.useRef(null);return Y.useImperativeHandle(t,()=>i.current,[]),H9(i,n,(r,s,o)=>{i.current!=null&&(i.current.visible=o!=null)}),ie.jsx("group",{xrSpace:n,visible:!1,matrixAutoUpdate:!1,ref:i,children:ie.jsx(Vh.Provider,{value:n,children:e})})});function U9(){const n=Y.useContext(Vh);if(n==null)throw new Error("XR objects must be placed inside the XROrigin");return n}function k9(n){const e=Y.useContext(Vh),t=Xn(i=>e??i.originReferenceSpace);return Y.useMemo(()=>t==null?void 0:o5(n,t),[n,t])}function H9(n,e,t){const i=k9(e);di((r,s,o)=>{n.current==null||i==null||(i(n.current.matrix,o),t==null||t(r,s,o))},-100)}Y.forwardRef((n,e)=>{const t=z9(),i=G9(t);return ie.jsx("mesh",{ref:e,geometry:i,...n})});function z9(){const n=Y.useContext(XB);if(n==null)throw new Error("useXRMesh can only be used inside XRMesh or ForEachXRMesh");return n}function G9(n,e=!0){const[t,i]=Y.useState(cC(n,void 0));return di(()=>i(r=>cC(n,r))),Y.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}Y.forwardRef((n,e)=>{const t=V9(),i=W9(t);return ie.jsx("mesh",{ref:e,geometry:i,...n})});function V9(){const n=Y.useContext(jB);if(n==null)throw new Error("useXRPlane can only be used inside XRPlane or ForEachXRPlane");return n}function W9(n,e=!0){const[t,i]=Y.useState(fC(n,void 0));return di(()=>i(r=>fC(n,r))),Y.useEffect(()=>{if(e)return()=>t.dispose()},[t]),t}const X9=Y.forwardRef(({children:n,...e},t)=>{const i=gi(s=>s.gl.xr.getCamera()),r=Xn(s=>s.originReferenceSpace);return r==null?null:ie.jsxs("group",{ref:t,...e,children:[ie.jsx("primitive",{object:i}),ie.jsx(Vh.Provider,{value:r,children:n})]})});function j9(n,e,t){const i=Y.useRef(void 0);J9(e,t,Y.useCallback(r=>i.current=r,[])),di((r,s,o)=>{n==null||o==null||i.current==null||n(o.getHitTestResults(i.current.source),i.current.getWorldMatrix)})}function J9(n,e,t){const i=WS();Y.useEffect(()=>{let r,s=!1;const o=n instanceof XRSpace?n:n.current;if(o!=null)return n9(i,o,e).then(a=>{s||(r=a,t(a))}),()=>{t(void 0),s=!0,r==null||r.source.cancel()}},[i,n,e,t])}Y.forwardRef((n,e)=>{const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current),j9(n.onResults,t,n.trackableType),ie.jsx("group",{...n,ref:t})});Y.forwardRef((n,e)=>{const t=Xn(s=>s.domOverlayRoot),{In:i,Out:r}=Y.useMemo(qV,[]);return Y.useEffect(()=>{const s=UA(t);return s.render(ie.jsx(r,{})),()=>s.unmount()},[t,r]),ie.jsx(i,{children:ie.jsx("div",{...n,ref:e})})});const eL=Y.forwardRef(({store:n,mode:e,onError:t,children:i,...r},s)=>{const o=LS(n,l=>l.session),a=c9(e,t);return ie.jsx("button",{ref:s,...r,onClick:()=>o!=null?o.end():n.enterXR(e).catch(t),children:typeof i=="function"?i(a?o!=null?"entered":"exited":"unsupported"):i})});Y.forwardRef((n,e)=>ie.jsx(eL,{ref:e,mode:"immersive-ar",...n}));Y.forwardRef((n,e)=>ie.jsx(eL,{ref:e,mode:"immersive-vr",...n}));const K9={onBlur:"pointerleave",onHover:"pointerenter",onMove:"pointermove",onSelect:{type:"click",filter:n=>n.pointerType==="ray"},onSelectEnd:{type:"pointerup",filter:n=>n.pointerType==="ray"},onSelectStart:{type:"pointerdown",filter:n=>n.pointerType==="ray"},onSqueeze:{type:"click",filter:n=>n.pointerType==="grab"},onSqueezeEnd:{type:"pointerup",filter:n=>n.pointerType==="grab"},onSqueezeStart:{type:"pointerdown",filter:n=>n.pointerType==="grab"}};function Ys(n,e,t){const i=Y.useRef(t);i.current=t,Y.useEffect(()=>{const{current:r}=n;if(r==null)return;const s=K9[e],o=typeof s=="string"?l=>{var c;return(c=i.current)==null?void 0:c.call(i,{intersection:l,intersections:[l],target:l.pointerState})}:l=>{var c;l instanceof Ui&&!s.filter(l)||(c=i.current)==null||c.call(i,{intersection:l,intersections:[l],target:l.pointerState})},a=typeof s=="string"?s:s.type;return r.addEventListener(a,o),()=>r.removeEventListener(a,o)},[n,e])}const Y9=Y.forwardRef(({onHover:n,onBlur:e,onSelectStart:t,onSelectEnd:i,onSelect:r,onSqueezeStart:s,onSqueezeEnd:o,onSqueeze:a,onMove:l,children:c},h)=>{const d=Y.useRef(null);return Y.useImperativeHandle(h,()=>d.current),Ys(d,"onHover",n),Ys(d,"onBlur",e),Ys(d,"onSelectStart",t),Ys(d,"onSelectEnd",i),Ys(d,"onSelect",r),Ys(d,"onSqueezeStart",s),Ys(d,"onSqueezeEnd",o),Ys(d,"onSqueeze",a),Ys(d,"onMove",l),ie.jsx("group",{ref:d,children:c})});Y.forwardRef(function({onSelectStart:e,onSelectEnd:t,children:i,...r},s){const o=Y.useRef(),a=Y.useRef(null),l=Y.useMemo(()=>new qe,[]);return Y.useImperativeHandle(s,()=>a.current),di(()=>{const c=o.current,h=a.current;!h||!c||(h.applyMatrix4(l),h.applyMatrix4(c.matrixWorld),h.updateMatrixWorld(),l.copy(c.matrixWorld).invert())}),ie.jsx(Y9,{ref:a,onSelectStart:c=>{K8(c.target)&&(c.target.type==="controller"||c.target.type==="hand")&&c.target.object!=null&&(o.current=c.target.object,l.copy(c.target.object.matrixWorld).invert(),e==null||e(c))},onSelectEnd:c=>{c.target.controller===o.current&&(o.current=void 0),t==null||t(c)},...r,children:i})});const mC=N9();function Q9(){return ie.jsxs(ie.Fragment,{children:[ie.jsx("button",{style:{position:"absolute",zIndex:1e4,background:"black",borderRadius:"0.5rem",border:"none",fontWeight:"bold",color:"white",padding:"1rem 2rem",cursor:"pointer",fontSize:"1.5rem",bottom:"1rem",left:"50%",boxShadow:"0px 0px 20px rgba(0,0,0,1)",transform:"translate(-50%, 0)"},onClick:()=>mC.enterAR(),children:"Enter AR"}),ie.jsx(WG,{shadows:!0,camera:{position:[4,0,6],fov:35},children:ie.jsxs(O9,{store:mC,children:[ie.jsxs("group",{position:[0,-.75,0],children:[ie.jsx(Y.Suspense,{children:ie.jsx(uV,{top:!0,children:ie.jsx($V,{})})}),ie.jsx("directionalLight",{position:[1,8,1],castShadow:!0}),ie.jsx("ambientLight",{}),ie.jsxs("mesh",{receiveShadow:!0,"rotation-x":-Math.PI/2,scale:100,children:[ie.jsx("shadowMaterial",{opacity:.7}),ie.jsx("planeGeometry",{})]}),ie.jsx("group",{position:[0,0,2.6],children:ie.jsx(X9,{})})]}),ie.jsx(sV,{}),ie.jsx(TV,{preset:"dawn",blur:1})]})})]})}UA(document.getElementById("root")).render(ie.jsx(Y.StrictMode,{children:ie.jsx(Q9,{})}));export{ya as B,yc as C,fr as D,ir as E,ot as F,Gr as G,Ai as L,qe as M,kt as O,_o as P,un as Q,Uh as R,Oh as S,Kg as T,O as V,aS as W,Gn as a,At as b,an as c,Fh as d,Ps as e,oc as f,lg as g,Mn as h,jg as i,ie as j,us as k,UA as l,kf as o,Y as r}; diff --git a/examples/stage/index.html b/examples/stage/index.html index dfd8b5b..a99df1e 100644 --- a/examples/stage/index.html +++ b/examples/stage/index.html @@ -4,7 +4,7 @@ Document - +
diff --git a/examples/watch/assets/emulate-B7RWhoU8.js b/examples/watch/assets/emulate-B7RWhoU8.js new file mode 100644 index 0000000..56c5478 --- /dev/null +++ b/examples/watch/assets/emulate-B7RWhoU8.js @@ -0,0 +1,819 @@ +import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-KwohaMom.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; + --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; + --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; +} + +svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} + +.svg-inline--fa { + display: var(--fa-display, inline-block); + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +.svg-inline--fa.fa-2xs { + vertical-align: 0.1em; +} +.svg-inline--fa.fa-xs { + vertical-align: 0em; +} +.svg-inline--fa.fa-sm { + vertical-align: -0.0714285705em; +} +.svg-inline--fa.fa-lg { + vertical-align: -0.2em; +} +.svg-inline--fa.fa-xl { + vertical-align: -0.25em; +} +.svg-inline--fa.fa-2xl { + vertical-align: -0.3125em; +} +.svg-inline--fa.fa-pull-left { + margin-right: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-pull-right { + margin-left: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-li { + width: var(--fa-li-width, 2em); + top: 0.25em; +} +.svg-inline--fa.fa-fw { + width: var(--fa-fw-width, 1.25em); +} + +.fa-layers svg.svg-inline--fa { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; +} + +.fa-layers-counter, .fa-layers-text { + display: inline-block; + position: absolute; + text-align: center; +} + +.fa-layers { + display: inline-block; + height: 1em; + position: relative; + text-align: center; + vertical-align: -0.125em; + width: 1em; +} +.fa-layers svg.svg-inline--fa { + transform-origin: center center; +} + +.fa-layers-text { + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + transform-origin: center center; +} + +.fa-layers-counter { + background-color: var(--fa-counter-background-color, #ff253a); + border-radius: var(--fa-counter-border-radius, 1em); + box-sizing: border-box; + color: var(--fa-inverse, #fff); + line-height: var(--fa-counter-line-height, 1); + max-width: var(--fa-counter-max-width, 5em); + min-width: var(--fa-counter-min-width, 1.5em); + overflow: hidden; + padding: var(--fa-counter-padding, 0.25em 0.5em); + right: var(--fa-right, 0); + text-overflow: ellipsis; + top: var(--fa-top, 0); + transform: scale(var(--fa-counter-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-bottom-right { + bottom: var(--fa-bottom, 0); + right: var(--fa-right, 0); + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom right; +} + +.fa-layers-bottom-left { + bottom: var(--fa-bottom, 0); + left: var(--fa-left, 0); + right: auto; + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom left; +} + +.fa-layers-top-right { + top: var(--fa-top, 0); + right: var(--fa-right, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-top-left { + left: var(--fa-left, 0); + right: auto; + top: var(--fa-top, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top left; +} + +.fa-1x { + font-size: 1em; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-6x { + font-size: 6em; +} + +.fa-7x { + font-size: 7em; +} + +.fa-8x { + font-size: 8em; +} + +.fa-9x { + font-size: 9em; +} + +.fa-10x { + font-size: 10em; +} + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; +} + +.fa-xs { + font-size: 0.75em; + line-height: 0.0833333337em; + vertical-align: 0.125em; +} + +.fa-sm { + font-size: 0.875em; + line-height: 0.0714285718em; + vertical-align: 0.0535714295em; +} + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; +} + +.fa-xl { + font-size: 1.5em; + line-height: 0.0416666682em; + vertical-align: -0.125em; +} + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; +} + +.fa-fw { + text-align: center; + width: 1.25em; +} + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + left: calc(-1 * var(--fa-li-width, 2em)); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; +} + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); +} + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); +} + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); +} + +.fa-beat { + animation-name: fa-beat; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-bounce { + animation-name: fa-bounce; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); +} + +.fa-fade { + animation-name: fa-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-beat-fade { + animation-name: fa-beat-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-flip { + animation-name: fa-flip; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-shake { + animation-name: fa-shake; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin { + animation-name: fa-spin; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 2s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin-reverse { + --fa-animation-direction: reverse; +} + +.fa-pulse, +.fa-spin-pulse { + animation-name: fa-spin; + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, steps(8)); +} + +@media (prefers-reduced-motion: reduce) { + .fa-beat, +.fa-bounce, +.fa-fade, +.fa-beat-fade, +.fa-flip, +.fa-pulse, +.fa-shake, +.fa-spin, +.fa-spin-pulse { + animation-delay: -1ms; + animation-duration: 1ms; + animation-iteration-count: 1; + transition-delay: 0s; + transition-duration: 0s; + } +} +@keyframes fa-beat { + 0%, 90% { + transform: scale(1); + } + 45% { + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@keyframes fa-bounce { + 0% { + transform: scale(1, 1) translateY(0); + } + 10% { + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + transform: scale(1, 1) translateY(0); + } + 100% { + transform: scale(1, 1) translateY(0); + } +} +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@keyframes fa-flip { + 50% { + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@keyframes fa-shake { + 0% { + transform: rotate(-15deg); + } + 4% { + transform: rotate(15deg); + } + 8%, 24% { + transform: rotate(-18deg); + } + 12%, 28% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-22deg); + } + 20% { + transform: rotate(22deg); + } + 32% { + transform: rotate(-12deg); + } + 36% { + transform: rotate(12deg); + } + 40%, 100% { + transform: rotate(0deg); + } +} +@keyframes fa-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +.fa-rotate-90 { + transform: rotate(90deg); +} + +.fa-rotate-180 { + transform: rotate(180deg); +} + +.fa-rotate-270 { + transform: rotate(270deg); +} + +.fa-flip-horizontal { + transform: scale(-1, 1); +} + +.fa-flip-vertical { + transform: scale(1, -1); +} + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + transform: scale(-1, -1); +} + +.fa-rotate-by { + transform: rotate(var(--fa-rotate-angle, 0)); +} + +.fa-stack { + display: inline-block; + vertical-align: middle; + height: 2em; + position: relative; + width: 2.5em; +} + +.fa-stack-1x, +.fa-stack-2x { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: var(--fa-stack-z-index, auto); +} + +.svg-inline--fa.fa-stack-1x { + height: 1em; + width: 1.25em; +} +.svg-inline--fa.fa-stack-2x { + height: 2em; + width: 2.5em; +} + +.fa-inverse { + color: var(--fa-inverse, #fff); +} + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.svg-inline--fa .fa-primary { + fill: var(--fa-primary-color, currentColor); + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa .fa-secondary { + fill: var(--fa-secondary-color, currentColor); + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-primary { + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-secondary { + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa mask .fa-primary, +.svg-inline--fa mask .fa-secondary { + fill: black; +} + +.fad.fa-inverse, +.fa-duotone.fa-inverse { + color: var(--fa-inverse, #fff); +}`;function Fa(){const e=Ia,t=Ra,n=P.cssPrefix,r=P.replacementClass;let i=g1;if(n!==e||r!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(o,".".concat(r))}return i}let as=!1;function wr(){P.autoAddCss&&!as&&(u1(Fa()),as=!0)}var y1={mixout(){return{dom:{css:Fa,insertCss:wr}}},hooks(){return{beforeDOMElementCreation(){wr()},beforeI2svg(){wr()}}}};const Xe=rt||{};Xe[Ze]||(Xe[Ze]={});Xe[Ze].styles||(Xe[Ze].styles={});Xe[Ze].hooks||(Xe[Ze].hooks={});Xe[Ze].shims||(Xe[Ze].shims=[]);var Ne=Xe[Ze];const za=[],Na=function(){Z.removeEventListener("DOMContentLoaded",Na),Bn=1,za.map(e=>e())};let Bn=!1;Be&&(Bn=(Z.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Z.readyState),Bn||Z.addEventListener("DOMContentLoaded",Na));function v1(e){Be&&(Bn?setTimeout(e,0):za.push(e))}function gn(e){const{tag:t,attributes:n={},children:r=[]}=e;return typeof e=="string"?Ca(e):"<".concat(t," ").concat(h1(n),">").concat(r.map(gn).join(""),"")}function os(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var br=function(t,n,r,i){var a=Object.keys(t),s=a.length,o=n,l,c,u;for(r===void 0?(l=1,u=t[a[0]]):(l=0,u=r);l=55296&&i<=56319&&n=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function ls(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return!!r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function Vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:r=!1}=n,i=ls(t);typeof Ne.hooks.addPack=="function"&&!r?Ne.hooks.addPack(e,ls(t)):Ne.styles[e]={...Ne.styles[e]||{},...i},e==="fas"&&Vr("fa",t)}const{styles:ut,shims:b1}=Ne,S1={[W]:Object.values(gt[W]),[Se]:Object.values(gt[Se]),[Me]:Object.values(gt[Me])};let mi=null,Da={},$a={},Va={},qa={},Ha={};const M1={[W]:Object.keys(mt[W]),[Se]:Object.keys(mt[Se]),[Me]:Object.keys(mt[Me])};function k1(e){return~o1.indexOf(e)}function E1(e,t){const n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!k1(i)?i:null}const Za=()=>{const e=r=>br(ut,(i,a,s)=>(i[s]=br(a,r,{}),i),{});Da=e((r,i,a)=>(i[3]&&(r[i[3]]=a),i[2]&&i[2].filter(o=>typeof o=="number").forEach(o=>{r[o.toString(16)]=a}),r)),$a=e((r,i,a)=>(r[a]=a,i[2]&&i[2].filter(o=>typeof o=="string").forEach(o=>{r[o]=a}),r)),Ha=e((r,i,a)=>{const s=i[2];return r[a]=a,s.forEach(o=>{r[o]=a}),r});const t="far"in ut||P.autoFetchSvg,n=br(b1,(r,i)=>{const a=i[0];let s=i[1];const o=i[2];return s==="far"&&!t&&(s="fas"),typeof a=="string"&&(r.names[a]={prefix:s,iconName:o}),typeof a=="number"&&(r.unicodes[a.toString(16)]={prefix:s,iconName:o}),r},{names:{},unicodes:{}});Va=n.names,qa=n.unicodes,mi=ar(P.styleDefault,{family:P.familyDefault})};f1(e=>{mi=ar(e.styleDefault,{family:P.familyDefault})});Za();function gi(e,t){return(Da[e]||{})[t]}function P1(e,t){return($a[e]||{})[t]}function nt(e,t){return(Ha[e]||{})[t]}function Xa(e){return Va[e]||{prefix:null,iconName:null}}function A1(e){const t=qa[e],n=gi("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function it(){return mi}const yi=()=>({prefix:null,iconName:null,rest:[]});function ar(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=W}=t,r=mt[n][e],i=cn[n][e]||cn[n][r],a=e in Ne.styles?e:null;return i||a||null}const I1={[W]:Object.keys(gt[W]),[Se]:Object.keys(gt[Se]),[Me]:Object.keys(gt[Me])};function or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=t,r={[W]:"".concat(P.cssPrefix,"-").concat(W),[Se]:"".concat(P.cssPrefix,"-").concat(Se),[Me]:"".concat(P.cssPrefix,"-").concat(Me)};let i=null,a=W;const s=F0.filter(l=>l!==Ea);s.forEach(l=>{(e.includes(r[l])||e.some(c=>I1[l].includes(c)))&&(a=l)});const o=e.reduce((l,c)=>{const u=E1(P.cssPrefix,c);if(ut[c]?(c=S1[a].includes(c)?n1[a][c]:c,i=c,l.prefix=c):M1[a].indexOf(c)>-1?(i=c,l.prefix=ar(c,{family:a})):u?l.iconName=u:c!==P.replacementClass&&!s.some(h=>c===r[h])&&l.rest.push(c),!n&&l.prefix&&l.iconName){const h=i==="fa"?Xa(l.iconName):{},p=nt(l.prefix,l.iconName);h.prefix&&(i=null),l.iconName=h.iconName||p||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!ut.far&&ut.fas&&!P.autoFetchSvg&&(l.prefix="fas")}return l},yi());return(e.includes("fa-brands")||e.includes("fab"))&&(o.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(o.prefix="fad"),!o.prefix&&a===Se&&(ut.fass||P.autoFetchSvg)&&(o.prefix="fass",o.iconName=nt(o.prefix,o.iconName)||o.iconName),!o.prefix&&a===Me&&(ut.fasds||P.autoFetchSvg)&&(o.prefix="fasds",o.iconName=nt(o.prefix,o.iconName)||o.iconName),(o.prefix==="fa"||i==="fa")&&(o.prefix=it()||"fas"),o}class R1{constructor(){this.definitions={}}add(){for(var t=arguments.length,n=new Array(t),r=0;r{this.definitions[a]={...this.definitions[a]||{},...i[a]},Vr(a,i[a]);const s=gt[W][a];s&&Vr(s,i[a]),Za()})}reset(){this.definitions={}}_pullDefinitions(t,n){const r=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(r).map(i=>{const{prefix:a,iconName:s,icon:o}=r[i],l=o[2];t[a]||(t[a]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(t[a][c]=o)}),t[a][s]=o}),t}}let cs=[],Pt={};const Rt={},O1=Object.keys(Rt);function L1(e,t){let{mixoutsTo:n}=t;return cs=e,Pt={},Object.keys(Rt).forEach(r=>{O1.indexOf(r)===-1&&delete Rt[r]}),cs.forEach(r=>{const i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(a=>{typeof i[a]=="function"&&(n[a]=i[a]),typeof i[a]=="object"&&Object.keys(i[a]).forEach(s=>{n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){const a=r.hooks();Object.keys(a).forEach(s=>{Pt[s]||(Pt[s]=[]),Pt[s].push(a[s])})}r.provides&&r.provides(Rt)}),n}function qr(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i{t=s.apply(null,[t,...r])}),t}function St(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{a.apply(null,n)})}function st(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Rt[e]?Rt[e].apply(null,t):void 0}function Hr(e){e.prefix==="fa"&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||it();if(t)return t=nt(n,t)||t,os(Ba.definitions,n,t)||os(Ne.styles,n,t)}const Ba=new R1,T1=()=>{P.autoReplaceSvg=!1,P.observeMutations=!1,St("noAuto")},j1={i2svg:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Be?(St("beforeI2svg",e),st("pseudoElements2svg",e),st("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;P.autoReplaceSvg===!1&&(P.autoReplaceSvg=!0),P.observeMutations=!0,v1(()=>{C1({autoReplaceSvgRoot:t}),St("watch",e)})}},_1={icon:e=>{if(e===null)return null;if(typeof e=="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:nt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){const t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],n=ar(e[0]);return{prefix:n,iconName:nt(n,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(P.cssPrefix,"-"))>-1||e.match(r1))){const t=or(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||it(),iconName:nt(t.prefix,t.iconName)||t.iconName}}if(typeof e=="string"){const t=it();return{prefix:t,iconName:nt(t,e)||e}}}},Ee={noAuto:T1,config:P,dom:j1,parse:_1,library:Ba,findIconDefinition:Hr,toHtml:gn},C1=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t=Z}=e;(Object.keys(Ne.styles).length>0||P.autoFetchSvg)&&Be&&P.autoReplaceSvg&&Ee.dom.i2svg({node:t})};function lr(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(n=>gn(n))}}),Object.defineProperty(e,"node",{get:function(){if(!Be)return;const n=Z.createElement("div");return n.innerHTML=e.html,n.children}}),e}function F1(e){let{children:t,main:n,mask:r,attributes:i,styles:a,transform:s}=e;if(pi(s)&&n.found&&!r.found){const{width:o,height:l}=n,c={x:o/l/2,y:.5};i.style=sr({...a,"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")})}return[{tag:"svg",attributes:i,children:t}]}function z1(e){let{prefix:t,iconName:n,children:r,attributes:i,symbol:a}=e;const s=a===!0?"".concat(t,"-").concat(P.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:s},children:r}]}]}function vi(e){const{icons:{main:t,mask:n},prefix:r,iconName:i,transform:a,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:p,height:g}=n.found?n:t,x=r==="fak",v=[P.replacementClass,i?"".concat(P.cssPrefix,"-").concat(i):""].filter(k=>u.classes.indexOf(k)===-1).filter(k=>k!==""||!!k).concat(u.classes).join(" ");let d={children:[],attributes:{...u.attributes,"data-prefix":r,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(g)}};const y=x&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/g*16*.0625,"em")}:{};h&&(d.attributes[bt]=""),o&&(d.children.push({tag:"title",attributes:{id:d.attributes["aria-labelledby"]||"title-".concat(c||fn())},children:[o]}),delete d.attributes.title);const b={...d,prefix:r,iconName:i,main:t,mask:n,maskId:l,transform:a,symbol:s,styles:{...y,...u.styles}},{children:w,attributes:M}=n.found&&t.found?st("generateAbstractMask",b)||{children:[],attributes:{}}:st("generateAbstractIcon",b)||{children:[],attributes:{}};return b.children=w,b.attributes=M,s?z1(b):F1(b)}function fs(e){const{content:t,width:n,height:r,transform:i,title:a,extra:s,watchable:o=!1}=e,l={...s.attributes,...a?{title:a}:{},class:s.classes.join(" ")};o&&(l[bt]="");const c={...s.styles};pi(i)&&(c.transform=m1({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);const u=sr(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function N1(e){const{content:t,title:n,extra:r}=e,i={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},a=sr(r.styles);a.length>0&&(i.style=a);const s=[];return s.push({tag:"span",attributes:i,children:[t]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}const{styles:Sr}=Ne;function Zr(e){const t=e[0],n=e[1],[r]=e.slice(4);let i=null;return Array.isArray(r)?i={tag:"g",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.GROUP)},children:[{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.PRIMARY),fill:"currentColor",d:r[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:t,height:n,icon:i}}const D1={found:!1,width:512,height:512};function $1(e,t){!Oa&&!P.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Xr(e,t){let n=t;return t==="fa"&&P.styleDefault!==null&&(t=it()),new Promise((r,i)=>{if(n==="fa"){const a=Xa(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&Sr[t]&&Sr[t][e]){const a=Sr[t][e];return r(Zr(a))}$1(e,t),r({...D1,icon:P.showMissingIcons&&e?st("missingIconAbstract")||{}:{}})})}const us=()=>{},Br=P.measurePerformance&&En&&En.mark&&En.measure?En:{mark:us,measure:us},Gt='FA "6.6.0"',V1=e=>(Br.mark("".concat(Gt," ").concat(e," begins")),()=>Ya(e)),Ya=e=>{Br.mark("".concat(Gt," ").concat(e," ends")),Br.measure("".concat(Gt," ").concat(e),"".concat(Gt," ").concat(e," begins"),"".concat(Gt," ").concat(e," ends"))};var xi={begin:V1,end:Ya};const Tn=()=>{};function ds(e){return typeof(e.getAttribute?e.getAttribute(bt):null)=="string"}function q1(e){const t=e.getAttribute?e.getAttribute(ui):null,n=e.getAttribute?e.getAttribute(di):null;return t&&n}function H1(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(P.replacementClass)}function Z1(){return P.autoReplaceSvg===!0?jn.replace:jn[P.autoReplaceSvg]||jn.replace}function X1(e){return Z.createElementNS("http://www.w3.org/2000/svg",e)}function B1(e){return Z.createElement(e)}function Wa(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=e.tag==="svg"?X1:B1}=t;if(typeof e=="string")return Z.createTextNode(e);const r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(a){r.setAttribute(a,e.attributes[a])}),(e.children||[]).forEach(function(a){r.appendChild(Wa(a,{ceFn:n}))}),r}function Y1(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}const jn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(n=>{t.parentNode.insertBefore(Wa(n),t)}),t.getAttribute(bt)===null&&P.keepOriginalSource){let n=Z.createComment(Y1(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~hi(t).indexOf(P.replacementClass))return jn.replace(e);const r=new RegExp("".concat(P.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const a=n[0].attributes.class.split(" ").reduce((s,o)=>(o===P.replacementClass||o.match(r)?s.toSvg.push(o):s.toNode.push(o),s),{toNode:[],toSvg:[]});n[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",a.toNode.join(" "))}const i=n.map(a=>gn(a)).join(` +`);t.setAttribute(bt,""),t.innerHTML=i}};function hs(e){e()}function Qa(e,t){const n=typeof t=="function"?t:Tn;if(e.length===0)n();else{let r=hs;P.mutateApproach===e1&&(r=rt.requestAnimationFrame||hs),r(()=>{const i=Z1(),a=xi.begin("mutate");e.map(i),a(),n()})}}let wi=!1;function Ga(){wi=!0}function Yr(){wi=!1}let Yn=null;function ps(e){if(!ns||!P.observeMutations)return;const{treeCallback:t=Tn,nodeCallback:n=Tn,pseudoElementsCallback:r=Tn,observeMutationsRoot:i=Z}=e;Yn=new ns(a=>{if(wi)return;const s=it();Nt(a).forEach(o=>{if(o.type==="childList"&&o.addedNodes.length>0&&!ds(o.addedNodes[0])&&(P.searchPseudoElements&&r(o.target),t(o.target)),o.type==="attributes"&&o.target.parentNode&&P.searchPseudoElements&&r(o.target.parentNode),o.type==="attributes"&&ds(o.target)&&~a1.indexOf(o.attributeName))if(o.attributeName==="class"&&q1(o.target)){const{prefix:l,iconName:c}=or(hi(o.target));o.target.setAttribute(ui,l||s),c&&o.target.setAttribute(di,c)}else H1(o.target)&&n(o.target)})}),Be&&Yn.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function W1(){Yn&&Yn.disconnect()}function Q1(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce((r,i)=>{const a=i.split(":"),s=a[0],o=a.slice(1);return s&&o.length>0&&(r[s]=o.join(":").trim()),r},{})),n}function G1(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"";let i=or(hi(e));return i.prefix||(i.prefix=it()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=P1(i.prefix,e.innerText)||gi(i.prefix,$r(e.innerText))),!i.iconName&&P.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function U1(e){const t=Nt(e.attributes).reduce((i,a)=>(i.name!=="class"&&i.name!=="style"&&(i[a.name]=a.value),i),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return P.autoA11y&&(n?t["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(r||fn()):(t["aria-hidden"]="true",t.focusable="false")),t}function K1(){return{iconName:null,title:null,titleId:null,prefix:null,transform:ze,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:i}=G1(e),a=U1(e),s=qr("parseNodeAttributes",{},e);let o=t.styleParser?Q1(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:r,transform:ze,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:o,attributes:a},...s}}const{styles:J1}=Ne;function Ua(e){const t=P.autoReplaceSvg==="nest"?ms(e,{styleParser:!1}):ms(e);return~t.extra.classes.indexOf(ja)?st("generateLayersText",e,t):st("generateSvgReplacementMutation",e,t)}let De=new Set;La.map(e=>{De.add("fa-".concat(e))});Object.keys(mt[W]).map(De.add.bind(De));Object.keys(mt[Se]).map(De.add.bind(De));Object.keys(mt[Me]).map(De.add.bind(De));De=[...De];function gs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Be)return Promise.resolve();const n=Z.documentElement.classList,r=u=>n.add("".concat(ss,"-").concat(u)),i=u=>n.remove("".concat(ss,"-").concat(u)),a=P.autoFetchSvg?De:La.map(u=>"fa-".concat(u)).concat(Object.keys(J1));a.includes("fa")||a.push("fa");const s=[".".concat(ja,":not([").concat(bt,"])")].concat(a.map(u=>".".concat(u,":not([").concat(bt,"])"))).join(", ");if(s.length===0)return Promise.resolve();let o=[];try{o=Nt(e.querySelectorAll(s))}catch{}if(o.length>0)r("pending"),i("complete");else return Promise.resolve();const l=xi.begin("onTree"),c=o.reduce((u,h)=>{try{const p=Ua(h);p&&u.push(p)}catch(p){Oa||p.name==="MissingIcon"&&console.error(p)}return u},[]);return new Promise((u,h)=>{Promise.all(c).then(p=>{Qa(p,()=>{r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),l(),u()})}).catch(p=>{l(),h(p)})})}function el(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ua(e).then(n=>{n&&Qa([n],t)})}function tl(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(t||{}).icon?t:Hr(t||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:Hr(i||{})),e(r,{...n,mask:i})}}const nl=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,symbol:r=!1,mask:i=null,maskId:a=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:p,icon:g}=e;return lr({type:"icon",...e},()=>(St("beforeDOMElementCreation",{iconDefinition:e,params:t}),P.autoA11y&&(s?c["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(o||fn()):(c["aria-hidden"]="true",c.focusable="false")),vi({icons:{main:Zr(g),mask:i?Zr(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:p,transform:{...ze,...n},symbol:r,title:s,maskId:a,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var rl={mixout(){return{icon:tl(nl)}},hooks(){return{mutationObserverCallbacks(e){return e.treeCallback=gs,e.nodeCallback=el,e}}},provides(e){e.i2svg=function(t){const{node:n=Z,callback:r=()=>{}}=t;return gs(n,r)},e.generateSvgReplacementMutation=function(t,n){const{iconName:r,title:i,titleId:a,prefix:s,transform:o,symbol:l,mask:c,maskId:u,extra:h}=n;return new Promise((p,g)=>{Promise.all([Xr(r,s),c.iconName?Xr(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(x=>{let[v,d]=x;p([t,vi({icons:{main:v,mask:d},prefix:s,iconName:r,transform:o,symbol:l,maskId:u,title:i,titleId:a,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){let{children:n,attributes:r,main:i,transform:a,styles:s}=t;const o=sr(s);o.length>0&&(r.style=o);let l;return pi(a)&&(l=st("generateAbstractTransformGrouping",{main:i,transform:a,containerWidth:i.width,iconWidth:i.width})),n.push(l||i.icon),{children:n,attributes:r}}}},il={mixout(){return{layer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=t;return lr({type:"layer"},()=>{St("beforeDOMElementCreation",{assembler:e,params:t});let r=[];return e(i=>{Array.isArray(i)?i.map(a=>{r=r.concat(a.abstract)}):r=r.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(P.cssPrefix,"-layers"),...n].join(" ")},children:r}]})}}}},sl={mixout(){return{counter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:r=[],attributes:i={},styles:a={}}=t;return lr({type:"counter",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),N1({content:e.toString(),title:n,extra:{attributes:i,styles:a,classes:["".concat(P.cssPrefix,"-layers-counter"),...r]}})))}}}},al={mixout(){return{text(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,title:r=null,classes:i=[],attributes:a={},styles:s={}}=t;return lr({type:"text",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),fs({content:e,transform:{...ze,...n},title:r,extra:{attributes:a,styles:s,classes:["".concat(P.cssPrefix,"-layers-text"),...i]}})))}}},provides(e){e.generateLayersText=function(t,n){const{title:r,transform:i,extra:a}=n;let s=null,o=null;if(ka){const l=parseInt(getComputedStyle(t).fontSize,10),c=t.getBoundingClientRect();s=c.width/l,o=c.height/l}return P.autoA11y&&!r&&(a.attributes["aria-hidden"]="true"),Promise.resolve([t,fs({content:t.innerHTML,width:s,height:o,transform:i,title:r,extra:a,watchable:!0})])}}};const ol=new RegExp('"',"ug"),ys=[1105920,1112319],vs={FontAwesome:{normal:"fas",400:"fas"},...q0,...V0,...G0},Wr=Object.keys(vs).reduce((e,t)=>(e[t.toLowerCase()]=vs[t],e),{}),ll=Object.keys(Wr).reduce((e,t)=>{const n=Wr[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e},{});function cl(e){const t=e.replace(ol,""),n=w1(t,0),r=n>=ys[0]&&n<=ys[1],i=t.length===2?t[0]===t[1]:!1;return{value:$r(i?t[0]:t),isSecondary:r||i}}function fl(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),i=isNaN(r)?"normal":r;return(Wr[n]||{})[i]||ll[n]}function xs(e,t){const n="".concat(J0).concat(t.replace(":","-"));return new Promise((r,i)=>{if(e.getAttribute(n)!==null)return r();const s=Nt(e.children).filter(p=>p.getAttribute(Fr)===t)[0],o=rt.getComputedStyle(e,t),l=o.getPropertyValue("font-family"),c=l.match(i1),u=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!c)return e.removeChild(s),r();if(c&&h!=="none"&&h!==""){const p=o.getPropertyValue("content");let g=fl(l,u);const{value:x,isSecondary:v}=cl(p),d=c[0].startsWith("FontAwesome");let y=gi(g,x),b=y;if(d){const w=A1(x);w.iconName&&w.prefix&&(y=w.iconName,g=w.prefix)}if(y&&!v&&(!s||s.getAttribute(ui)!==g||s.getAttribute(di)!==b)){e.setAttribute(n,b),s&&e.removeChild(s);const w=K1(),{extra:M}=w;M.attributes[Fr]=t,Xr(y,g).then(k=>{const E=vi({...w,icons:{main:k,mask:yi()},prefix:g,iconName:b,extra:M,watchable:!0}),R=Z.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(R,e.firstChild):e.appendChild(R),R.outerHTML=E.map(re=>gn(re)).join(` +`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function ul(e){return Promise.all([xs(e,"::before"),xs(e,"::after")])}function dl(e){return e.parentNode!==document.head&&!~t1.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Fr)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function ws(e){if(Be)return new Promise((t,n)=>{const r=Nt(e.querySelectorAll("*")).filter(dl).map(ul),i=xi.begin("searchPseudoElements");Ga(),Promise.all(r).then(()=>{i(),Yr(),t()}).catch(()=>{i(),Yr(),n()})})}var hl={hooks(){return{mutationObserverCallbacks(e){return e.pseudoElementsCallback=ws,e}}},provides(e){e.pseudoElements2svg=function(t){const{node:n=Z}=t;P.searchPseudoElements&&ws(n)}}};let bs=!1;var pl={mixout(){return{dom:{unwatch(){Ga(),bs=!0}}}},hooks(){return{bootstrap(){ps(qr("mutationObserverCallbacks",{}))},noAuto(){W1()},watch(e){const{observeMutationsRoot:t}=e;bs?Yr():ps(qr("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}};const Ss=e=>{let t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce((n,r)=>{const i=r.toLowerCase().split("-"),a=i[0];let s=i.slice(1).join("-");if(a&&s==="h")return n.flipX=!0,n;if(a&&s==="v")return n.flipY=!0,n;if(s=parseFloat(s),isNaN(s))return n;switch(a){case"grow":n.size=n.size+s;break;case"shrink":n.size=n.size-s;break;case"left":n.x=n.x-s;break;case"right":n.x=n.x+s;break;case"up":n.y=n.y-s;break;case"down":n.y=n.y+s;break;case"rotate":n.rotate=n.rotate+s;break}return n},t)};var ml={mixout(){return{parse:{transform:e=>Ss(e)}}},hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=Ss(n)),e}}},provides(e){e.generateAbstractTransformGrouping=function(t){let{main:n,transform:r,containerWidth:i,iconWidth:a}=t;const s={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(r.x*32,", ").concat(r.y*32,") "),l="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),c="rotate(".concat(r.rotate," 0 0)"),u={transform:"".concat(o," ").concat(l," ").concat(c)},h={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:u,path:h};return{tag:"g",attributes:{...p.outer},children:[{tag:"g",attributes:{...p.inner},children:[{tag:n.icon.tag,children:n.icon.children,attributes:{...n.icon.attributes,...p.path}}]}]}}}};const Mr={x:0,y:0,width:"100%",height:"100%"};function Ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function gl(e){return e.tag==="g"?e.children:[e]}var yl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),r=n?or(n.split(" ").map(i=>i.trim())):yi();return r.prefix||(r.prefix=it()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides(e){e.generateAbstractMask=function(t){let{children:n,attributes:r,main:i,mask:a,maskId:s,transform:o}=t;const{width:l,icon:c}=i,{width:u,icon:h}=a,p=p1({transform:o,containerWidth:u,iconWidth:l}),g={tag:"rect",attributes:{...Mr,fill:"white"}},x=c.children?{children:c.children.map(Ms)}:{},v={tag:"g",attributes:{...p.inner},children:[Ms({tag:c.tag,attributes:{...c.attributes,...p.path},...x})]},d={tag:"g",attributes:{...p.outer},children:[v]},y="mask-".concat(s||fn()),b="clip-".concat(s||fn()),w={tag:"mask",attributes:{...Mr,id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[g,d]},M={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:gl(h)},w]};return n.push(M,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")"),...Mr}}),{children:n,attributes:r}}}},vl={provides(e){let t=!1;rt.matchMedia&&(t=rt.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const n=[],r={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:{...r,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const a={...i,attributeName:"opacity"},s={tag:"circle",attributes:{...r,cx:"256",cy:"364",r:"28"},children:[]};return t||s.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...a,values:"1;0;1;1;0;1;"}}),n.push(s),n.push({tag:"path",attributes:{...r,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...a,values:"1;0;0;0;0;1;"}}]}),t||n.push({tag:"path",attributes:{...r,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...a,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},xl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),r=n===null?!1:n===""?!0:n;return e.symbol=r,e}}}},wl=[y1,rl,il,sl,al,hl,pl,ml,yl,vl,xl];L1(wl,{mixoutsTo:Ee});Ee.noAuto;Ee.config;Ee.library;Ee.dom;const Qr=Ee.parse;Ee.findIconDefinition;Ee.toHtml;const bl=Ee.icon;Ee.layer;Ee.text;Ee.counter;function ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Ml(e,t){if(e==null)return{};var n=Sl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gr(e){return kl(e)||El(e)||Pl(e)||Al()}function kl(e){if(Array.isArray(e))return Ur(e)}function El(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pl(e,t){if(e){if(typeof e=="string")return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(l){return Ja(e,l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.attrs.className=u,delete t.attributes.class;break;case"style":l.attrs.style=Tl(u);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?l.attrs[c.toLowerCase()]=u:l.attrs[Ka(c)]=u}return l},{attrs:{}}),a=n.style,s=a===void 0?{}:a,o=Ml(n,Ol);return i.attrs.style=Ce(Ce({},i.attrs.style),s),e.apply(void 0,[t.tag,Ce(Ce({},i.attrs),o)].concat(Gr(r)))}var eo=!1;try{eo=!0}catch{}function jl(){if(!eo&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Es(e){if(e&&Wn(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Qr.icon)return Qr.icon(e);if(e===null)return null;if(e&&Wn(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function kr(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?At({},e,t):{}}var Ps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},un=xt.forwardRef(function(e,t){var n=Ce(Ce({},Ps),e),r=n.icon,i=n.mask,a=n.symbol,s=n.className,o=n.title,l=n.titleId,c=n.maskId,u=Es(r),h=kr("classes",[].concat(Gr(Il(n)),Gr((s||"").split(" ")))),p=kr("transform",typeof n.transform=="string"?Qr.transform(n.transform):n.transform),g=kr("mask",Es(i)),x=bl(u,Ce(Ce(Ce(Ce({},h),p),g),{},{symbol:a,title:o,titleId:l,maskId:c}));if(!x)return jl("Could not find icon",u),null;var v=x.abstract,d={ref:t};return Object.keys(n).forEach(function(y){Ps.hasOwnProperty(y)||(d[y]=n[y])}),_l(v[0],d)});un.displayName="FontAwesomeIcon";un.propTypes={beat:C.bool,border:C.bool,beatFade:C.bool,bounce:C.bool,className:C.string,fade:C.bool,flash:C.bool,mask:C.oneOfType([C.object,C.array,C.string]),maskId:C.string,fixedWidth:C.bool,inverse:C.bool,flip:C.oneOf([!0,!1,"horizontal","vertical","both"]),icon:C.oneOfType([C.object,C.array,C.string]),listItem:C.bool,pull:C.oneOf(["right","left"]),pulse:C.bool,rotation:C.oneOf([0,90,180,270]),shake:C.bool,size:C.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:C.bool,spinPulse:C.bool,spinReverse:C.bool,symbol:C.oneOfType([C.bool,C.string]),title:C.string,titleId:C.string,transform:C.oneOfType([C.string,C.object]),swapOpacity:C.bool};var _l=Ja.bind(null,xt.createElement),me=function(){return me=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?ae(Dt,--Ie):0,jt--,ee===10&&(jt=1,fr--),ee}function Le(){return ee=Ie2||Jr(ee)>3?"":" "}function Zl(e,t){for(;--t&&Le()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return dr(e,Cn()+(t<6&&yt()==32&&Le()==32))}function ei(e){for(;Le();)switch(ee){case e:return Ie;case 34:case 39:e!==34&&e!==39&&ei(ee);break;case 40:e===41&&ei(e);break;case 92:Le();break}return Ie}function Xl(e,t){for(;Le()&&e+ee!==57;)if(e+ee===84&&yt()===47)break;return"/*"+dr(t,Ie-1)+"*"+Si(e===47?e:Le())}function Bl(e){for(;!Jr(yt());)Le();return dr(e,Ie)}function Yl(e){return ql(Fn("",null,null,null,[""],e=Vl(e),0,[0],e))}function Fn(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,h=s,p=0,g=0,x=0,v=1,d=1,y=1,b=0,w="",M=i,k=a,E=r,R=w;d;)switch(x=b,b=Le()){case 40:if(x!=108&&ae(R,h-1)==58){_n(R+=j(Er(b),"&","&\f"),"&\f",ro(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:R+=Er(b);break;case 9:case 10:case 13:case 32:R+=Hl(x);break;case 92:R+=Zl(Cn()-1,7);continue;case 47:switch(yt()){case 42:case 47:Ut(Wl(Xl(Le(),Cn()),t,n,l),l);break;default:R+="/"}break;case 123*v:o[c++]=Fe(R)*y;case 125*v:case 59:case 0:switch(b){case 0:case 125:d=0;case 59+u:y==-1&&(R=j(R,/\f/g,"")),g>0&&Fe(R)-h&&Ut(g>32?Rs(R+";",r,n,h-1,l):Rs(j(R," ","")+";",r,n,h-2,l),l);break;case 59:R+=";";default:if(Ut(E=Is(R,t,n,c,u,i,o,w,M=[],k=[],h,a),a),b===123)if(u===0)Fn(R,t,E,E,M,a,h,o,k);else switch(p===99&&ae(R,3)===110?100:p){case 100:case 108:case 109:case 115:Fn(e,E,E,r&&Ut(Is(e,E,E,0,0,i,o,w,i,M=[],h,k),k),i,k,h,o,r?M:k);break;default:Fn(R,E,E,E,[""],k,0,o,k)}}c=u=g=0,v=y=1,w=R="",h=s;break;case 58:h=1+Fe(R),g=x;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&$l()==125)continue}switch(R+=Si(b),b*v){case 38:y=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Fe(R)-1)*y,y=1;break;case 64:yt()===45&&(R+=Er(Le())),p=yt(),u=h=Fe(w=R+=Bl(Cn())),b++;break;case 45:x===45&&Fe(R)==2&&(v=0)}}return a}function Is(e,t,n,r,i,a,s,o,l,c,u,h){for(var p=i-1,g=i===0?a:[""],x=so(g),v=0,d=0,y=0;v0?g[b]+" "+w:j(w,/&\f/g,g[b])))&&(l[y++]=M);return ur(e,t,n,i===0?cr:o,l,c,u,h)}function Wl(e,t,n,r){return ur(e,t,n,to,Si(Dl()),Tt(e,2,-2),0,r)}function Rs(e,t,n,r,i){return ur(e,t,n,bi,Tt(e,0,r),Tt(e,r+1,-1),r,i)}function oo(e,t,n){switch(zl(e,t)){case 5103:return N+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return N+e+e;case 4789:return rn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return N+e+rn+e+q+e+e;case 5936:switch(ae(e,t+11)){case 114:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return N+e+q+e+e;case 6165:return N+e+q+"flex-"+e+e;case 5187:return N+e+j(e,/(\w+).+(:[^]+)/,N+"box-$1$2"+q+"flex-$1$2")+e;case 5443:return N+e+q+"flex-item-"+j(e,/flex-|-self/g,"")+(Ve(e,/flex-|baseline/)?"":q+"grid-row-"+j(e,/flex-|-self/g,""))+e;case 4675:return N+e+q+"flex-line-pack"+j(e,/align-content|flex-|-self/g,"")+e;case 5548:return N+e+q+j(e,"shrink","negative")+e;case 5292:return N+e+q+j(e,"basis","preferred-size")+e;case 6060:return N+"box-"+j(e,"-grow","")+N+e+q+j(e,"grow","positive")+e;case 4554:return N+j(e,/([^-])(transform)/g,"$1"+N+"$2")+e;case 6187:return j(j(j(e,/(zoom-|grab)/,N+"$1"),/(image-set)/,N+"$1"),e,"")+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,N+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,N+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+N+e+e;case 4200:if(!Ve(e,/flex-|baseline/))return q+"grid-column-align"+Tt(e,t)+e;break;case 2592:case 3360:return q+j(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Ve(r.props,/grid-\w+-end/)})?~_n(e+(n=n[t].value),"span",0)?e:q+j(e,"-start","")+e+q+"grid-row-span:"+(~_n(n,"span",0)?Ve(n,/\d+/):+Ve(n,/\d+/)-+Ve(e,/\d+/))+";":q+j(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Ve(r.props,/grid-\w+-start/)})?e:q+j(j(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,N+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Fe(e)-1-t>6)switch(ae(e,t+1)){case 109:if(ae(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+rn+(ae(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_n(e,"stretch",0)?oo(j(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return j(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,s,o,l,c){return q+i+":"+a+c+(s?q+i+"-span:"+(o?l:+l-+a)+c:"")+e});case 4949:if(ae(e,t+6)===121)return j(e,":",":"+N)+e;break;case 6444:switch(ae(e,ae(e,14)===45?18:11)){case 120:return j(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+N+(ae(e,14)===45?"inline-":"")+"box$3$1"+N+"$2$3$1"+q+"$2box$3")+e;case 100:return j(e,":",":"+q)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return j(e,"scroll-","scroll-snap-")+e}return e}function Gn(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case bi:e.return=oo(e.value,e.length,n);return;case no:return Gn([et(e,{value:j(e.value,"@","@"+N)})],r);case cr:if(e.length)return Nl(n=e.props,function(i){switch(Ve(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":kt(et(e,{props:[j(i,/:(read-\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break;case"::placeholder":kt(et(e,{props:[j(i,/:(plac\w+)/,":"+N+"input-$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,q+"input-$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break}return""})}}var Jl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},we={},_t=typeof process<"u"&&we!==void 0&&(we.REACT_APP_SC_ATTR||we.SC_ATTR)||"data-styled",lo="active",co="data-styled-version",hr="6.1.12",Mi=`/*!sc*/ +`,Un=typeof window<"u"&&"HTMLElement"in window,ec=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==""?we.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&we.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.SC_DISABLE_SPEEDY!==void 0&&we.SC_DISABLE_SPEEDY!==""&&we.SC_DISABLE_SPEEDY!=="false"&&we.SC_DISABLE_SPEEDY),pr=Object.freeze([]),Ct=Object.freeze({});function tc(e,t,n){return n===void 0&&(n=Ct),e.theme!==n.theme&&e.theme||t||n.theme}var fo=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),nc=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,rc=/(^-|-$)/g;function Os(e){return e.replace(nc,"-").replace(rc,"")}var ic=/(a)(d)/gi,Pn=52,Ls=function(e){return String.fromCharCode(e+(e>25?39:97))};function ti(e){var t,n="";for(t=Math.abs(e);t>Pn;t=t/Pn|0)n=Ls(t%Pn)+n;return(Ls(t%Pn)+n).replace(ic,"$1-$2")}var Pr,uo=5381,It=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ho=function(e){return It(uo,e)};function sc(e){return ti(ho(e)>>>0)}function ac(e){return e.displayName||e.name||"Component"}function Ar(e){return typeof e=="string"&&!0}var po=typeof Symbol=="function"&&Symbol.for,mo=po?Symbol.for("react.memo"):60115,oc=po?Symbol.for("react.forward_ref"):60112,lc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},go={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fc=((Pr={})[oc]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pr[mo]=go,Pr);function Ts(e){return("type"in(t=e)&&t.type.$$typeof)===mo?go:"$$typeof"in e?fc[e.$$typeof]:lc;var t}var uc=Object.defineProperty,dc=Object.getOwnPropertyNames,js=Object.getOwnPropertySymbols,hc=Object.getOwnPropertyDescriptor,pc=Object.getPrototypeOf,_s=Object.prototype;function yo(e,t,n){if(typeof t!="string"){if(_s){var r=pc(t);r&&r!==_s&&yo(e,r,n)}var i=dc(t);js&&(i=i.concat(js(t)));for(var a=Ts(e),s=Ts(t),o=0;o0?" Args: ".concat(t.join(", ")):""))}var mc=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;t>=a;)if((a<<=1)<0)throw yn(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=i;s=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),a=i+r,s=i;s=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(d+="".concat(y,","))}),l+="".concat(x).concat(v,'{content:"').concat(d,'"}').concat(Mi)},u=0;u0?".".concat(t):p},u=l.slice();u.push(function(p){p.type===cr&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(Pc,n).replace(r,c))}),s.prefix&&u.push(Kl),u.push(Ql);var h=function(p,g,x,v){g===void 0&&(g=""),x===void 0&&(x=""),v===void 0&&(v="&"),t=v,n=g,r=new RegExp("\\".concat(n,"\\b"),"g");var d=p.replace(Ac,""),y=Yl(x||g?"".concat(x," ").concat(g," { ").concat(d," }"):d);s.namespace&&(y=wo(y,s.namespace));var b=[];return Gn(y,Gl(u.concat(Ul(function(w){return b.push(w)})))),b};return h.hash=l.length?l.reduce(function(p,g){return g.name||yn(15),It(p,g.name)},uo).toString():"",h}var Rc=new xo,ri=Ic(),bo=xt.createContext({shouldForwardProp:void 0,styleSheet:Rc,stylis:ri});bo.Consumer;xt.createContext(void 0);function Ns(){return D.useContext(bo)}var Oc=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=ri);var s=r.name+a.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,a(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Ei(this,function(){throw yn(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ri),this.name+t.hash},e}(),Lc=function(e){return e>="A"&&e<="Z"};function Ds(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,s)){var o=r(a,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,o)}i=dt(i,s),this.staticRulesId=s}else{for(var l=It(this.baseHash,r.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,g)||n.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=dt(i,g)}}return i},e}(),ko=xt.createContext(void 0);ko.Consumer;var Ir={};function Cc(e,t,n){var r=ki(e),i=e,a=!Ar(e),s=t.attrs,o=s===void 0?pr:s,l=t.componentId,c=l===void 0?function(M,k){var E=typeof M!="string"?"sc":Os(M);Ir[E]=(Ir[E]||0)+1;var R="".concat(E,"-").concat(sc(hr+E+Ir[E]));return k?"".concat(k,"-").concat(R):R}(t.displayName,t.parentComponentId):l,u=t.displayName,h=u===void 0?function(M){return Ar(M)?"styled.".concat(M):"Styled(".concat(ac(M),")")}(e):u,p=t.displayName&&t.componentId?"".concat(Os(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,x=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var d=t.shouldForwardProp;x=function(M,k){return v(M,k)&&d(M,k)}}else x=v}var y=new _c(n,p,r?i.componentStyle:void 0);function b(M,k){return function(E,R,re){var X=E.attrs,ie=E.componentStyle,le=E.defaultProps,$=E.foldedComponentIds,F=E.styledComponentId,T=E.target,Q=xt.useContext(ko),Te=Ns(),te=E.shouldForwardProp||Te.shouldForwardProp,Pe=tc(R,Q,le)||Ct,B=function(xn,$t,wn){for(var Vt,at=me(me({},$t),{className:void 0,theme:wn}),mr=0;mre?"2px 8px 8px 2px":"8px 2px 2px 8px"}; + } + + &:last-child { + border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; + } +`,de=U.div` + background-color: ${({$pressed:e})=>e?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"}; + border: none; + display: flex; + align-items: center; + justify-content: center; + color: white; + border-radius: 5px; + font-size: 14px; + font-family: Arial, sans-serif; + height: 20px; + width: 20px; + transition: all 0.2s ease-in-out; +`,Po=U.div` + display: flex; + align-items: center; + height: 24px; + margin-bottom: 2px; + justify-content: flex-start; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; +`,zt=U.div` + display: flex; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; + height: 100%; + justify-content: space-between; + align-items: center; +`;U.button` + background-color: rgba(255, 255, 255, 0.3); + border: none; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + pointer-events: none; + width: 50px; + height: 50px; + border-radius: 50%; + position: relative; + margin: 0 5px; + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); +`;U.div` + position: absolute; + background-color: white; + border-radius: 50%; + width: 36px; + height: 36px; + cursor: pointer; + pointer-events: auto; +`;const Ao=U.input.attrs({type:"range"})` + -webkit-appearance: none; + appearance: none; + background-color: rgba(255, 255, 255, 0.3); + border: none; + height: 100%; + width: 49px; + cursor: pointer; + margin: 0 1px; + transition: all 0.2s ease-in-out; + border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; + + &::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } + + &::-moz-range-thumb { + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } + + &::-ms-thumb { + width: 8px; + height: 24px; + background-color: white; + border-radius: 3px; + } +`,zc=U.div` + display: flex; + flex-direction: column; + align-items: ${({$reverse:e})=>e?"flex-start":"flex-end"}; + justify-content: center; + margin: ${({$reverse:e})=>e?"2px -26px 0 0":"2px 0 0 -26px"}; +`,qs=U.div` + display: flex; + flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; + align-items: center; + justify-content: center; +`;U.div` + display: flex; + flex-direction: column; + height: 50px; + justify-content: space-between; +`;const K=U(un)` + height: 14px; + min-height: 14px; + max-height: 14px; + width: 14px; + min-width: 14px; + max-width: 14px; +`,Nc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),Dc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),$c=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),Vc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Hc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Zc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Xc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Bc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Yc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Wc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Gc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Uc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Kc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),Jc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),e2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),t2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),n2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),r2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),i2={"x-button-left":Nc,"y-button-left":Dc,"a-button-right":$c,"b-button-right":Vc,"thumbstick-left":qc,"thumbstick-up-left":Zc,"thumbstick-down-left":Xc,"thumbstick-right-left":Yc,"thumbstick-left-left":Bc,"thumbstick-right":Hc,"thumbstick-up-right":Wc,"thumbstick-down-right":Qc,"thumbstick-right-right":Uc,"thumbstick-left-right":Gc,"trigger-left":e2,"trigger-right":t2,"squeeze-left":Kc,"squeeze-right":Jc,"thumbrest-left":n2,"thumbrest-right":r2},hn=({buttonName:e,handedness:t})=>{const n=`${e}-${t}`,r=i2[n];return r?f.jsx(r,{}):f.jsx("div",{style:{width:"28px",height:"28px"}})},s2=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M1 11.2A5.2 5.2 0 0 1 6.2 6h15.6a5.2 5.2 0 0 1 5.2 5.2v5.2a5.2 5.2 0 0 1-5.2 5.2h-3.109c-1.149 0-2.199-.65-2.713-1.677l-.199-.398a1.733 1.733 0 0 0-1.55-.958h-.458c-.656 0-1.257.37-1.55.958l-.2.398A3.033 3.033 0 0 1 9.31 21.6H6.2A5.2 5.2 0 0 1 1 16.4v-5.2Zm9.1 2.167a2.6 2.6 0 1 1-5.2 0 2.6 2.6 0 0 1 5.2 0Zm15.538-1.426a.498.498 0 0 0 .141-.542l.002-.002a5.456 5.456 0 0 0-.347-.755l-.104-.178a5.586 5.586 0 0 0-.486-.686.502.502 0 0 0-.54-.15l-1.225.39a4.234 4.234 0 0 0-.968-.56l-.275-1.256a.497.497 0 0 0-.4-.392 5.686 5.686 0 0 0-1.871.003.497.497 0 0 0-.4.391l-.276 1.257a4.234 4.234 0 0 0-.968.559l-1.226-.39a.498.498 0 0 0-.539.15 5.586 5.586 0 0 0-.486.686l-.104.179c-.134.242-.25.492-.347.754a.498.498 0 0 0 .14.542l.953.867a4.26 4.26 0 0 0 0 1.12l-.952.867a.498.498 0 0 0-.141.541c.097.262.213.513.347.755l.104.178c.145.242.308.471.486.687.13.156.346.211.54.15l1.223-.392c.295.226.62.416.968.559l.275 1.256c.044.2.198.359.4.392a5.686 5.686 0 0 0 1.871 0 .497.497 0 0 0 .4-.392l.276-1.256c.347-.143.673-.333.968-.56l1.225.39c.194.062.41.009.54-.15a5.59 5.59 0 0 0 .486-.686l.103-.178a5.45 5.45 0 0 0 .348-.755.498.498 0 0 0-.14-.541l-.954-.867a4.258 4.258 0 0 0 0-1.118l.953-.867ZM20.5 15.967a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})}),a2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),o2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),l2={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Pi={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},c2={prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]},f2={prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]},Hs={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},u2={prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]},Io={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]},d2={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},h2={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},p2={prefix:"fas",iconName:"square-arrow-up-right",icon:[448,512,["external-link-square"],"f14c","M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]},m2={prefix:"fas",iconName:"keyboard",icon:[576,512,[9e3],"f11c","M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]},Ro={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]},g2={prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Zs={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},y2={prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]},v2={prefix:"fas",iconName:"arrows-up-down",icon:[320,512,["arrows-v"],"f07d","M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]},x2={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},qe={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:f.jsx(K,{icon:u2}),Backspace:f.jsx(K,{icon:g2}),Enter:f.jsx(K,{style:{transform:"rotate(90deg)"},icon:y2}),ShiftLeft:f.jsx(K,{icon:Zs}),ShiftRight:f.jsx(K,{icon:Zs}),Space:" ",ArrowUp:f.jsx(K,{icon:Io}),ArrowDown:f.jsx(K,{icon:Ro}),ArrowLeft:f.jsx(K,{icon:f2}),ArrowRight:f.jsx(K,{icon:c2}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:f.jsx(a2,{}),MouseRight:f.jsx(o2,{})},w2={left:{"thumbstick-up":"KeyW","thumbstick-down":"KeyS","thumbstick-left":"KeyA","thumbstick-right":"KeyD",thumbstick:"KeyR","x-button":"KeyX","y-button":"KeyZ",trigger:"KeyQ",squeeze:"KeyE"},right:{"thumbstick-up":"ArrowUp","thumbstick-down":"ArrowDown","thumbstick-left":"ArrowLeft","thumbstick-right":"ArrowRight",thumbstick:"Slash","a-button":"Enter","b-button":"ShiftRight",trigger:"MouseLeft",squeeze:"MouseRight"}},b2=U.div` + display: flex; + justify-content: space-between; + pointer-events: all; + position: fixed; + display: flex; + top: 40px; + left: calc(50vw - 156px); + width: 312px; +`,Xs=U.div` + display: flex; + flex-direction: column; + width: 50%; +`,Bs=U.div` + display: flex; + height: 24px; + align-items: center; + margin-bottom: 2px; +`,S2=({keyMap:e,setKeyMap:t})=>{const[n,r]=D.useState(null),i=(s,o)=>{r({controller:s,action:o})},a=(s,o)=>{t(l=>({...l,[s]:{...l[s],[o]:"Unmapped"}}))};return D.useEffect(()=>{const s=c=>{n&&qe[c.code]&&(t(u=>({...u,[n.controller]:{...u[n.controller],[n.action]:c.code}})),r(null))},o=c=>{if(n){const u=c.button===0?"MouseLeft":c.button===2?"MouseRight":null;u&&qe[u]&&(t(h=>({...h,[n.controller]:{...h[n.controller],[n.action]:u}})),r(null))}},l=c=>{c.preventDefault()};return window.addEventListener("keydown",s),window.addEventListener("mousedown",o),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("mousedown",o),window.removeEventListener("contextmenu",l)}},[n,t]),f.jsxs(b2,{children:[f.jsx(Xs,{children:Object.keys(e.left).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"left"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="left"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("left",s),onContextMenu:o=>o.preventDefault(),children:e.left[s]}),f.jsx(oe,{style:{width:"24px"},$reverse:!1,onClick:()=>a("left",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))}),f.jsx(Xs,{children:Object.keys(e.right).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"right"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="right"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("right",s),onContextMenu:o=>o.preventDefault(),children:e.right[s]}),f.jsx(oe,{$reverse:!1,style:{width:"24px"},onClick:()=>a("right",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))})]})},M2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(0),p=e.inputSource.handedness;return D.useEffect(()=>{const g=y=>{y.code===r&&(e.updateButtonValue(t,1),c(!0))},x=y=>{y.code===r&&(e.updateButtonValue(t,0),c(!1))},v=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,1),c(!0))},d=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,0),c(!1))};return n?r==="MouseLeft"||r==="MouseRight"?(window.addEventListener("mousedown",v),window.addEventListener("mouseup",d)):(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x))}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:l,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{o(!0),e.updateButtonValue(t,1),setTimeout(()=>{o(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ao,{$reverse:p==="right",value:u,onChange:g=>{const x=Number(g.target.value);h(x),e.updateButtonValue(t,x/100)},min:"0",max:"100"})]})})]})},k2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(!1),p=e.inputSource.handedness;return D.useEffect(()=>{const g=v=>{v.code===r&&(e.updateButtonValue(t,1),h(!0))},x=v=>{v.code===r&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:u,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:l?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout(()=>{c(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{o(!s),e.updateButtonValue(t,s?0:1)},children:"Hold"})]})})]})},E2=U.div` + display: flex; + align-items: center; + margin-bottom: 2px; +`,P2=U.button` + background-color: rgba(255, 255, 255, 0.3); + border: none; + display: flex; + justify-content: center; + align-items: center; + padding: 0; + pointer-events: none; + width: 50px; + height: 50px; + border-radius: 50%; + position: relative; + margin: 0 5px; + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); +`,A2=U.div` + position: absolute; + background-color: white; + border-radius: 50%; + width: 36px; + height: 36px; + cursor: pointer; + pointer-events: auto; +`,Ys=U(oe)` + width: 49px; + font-size: 14px; + + ${({$reverse:e})=>e?` + &:first-child { + margin-left: 1px; + border-radius: 2px 8px 8px 2px; + } + + &:last-child { + margin-right: 1px; + border-radius: 8px 2px 2px 8px; + } + `:` + &:first-child { + margin-right: 1px; + border-radius: 8px 2px 2px 8px; + } + + &:last-child { + margin-left: 1px; + border-radius: 2px 8px 8px 2px; + } + `} +`,I2=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:r,mappedKeyDown:i,mappedKeyLeft:a,mappedKeyRight:s,mappedKeyPressed:o})=>{const l=D.useRef(null),[c,u]=D.useState(!1),[h,p]=D.useState(!1),[g,x]=D.useState(!1),[v,d]=D.useState(!1),[y,b]=D.useState({x:0,y:0}),[w,M]=D.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),k=e.inputSource.handedness,E=()=>{if(l.current){const X=l.current.getBoundingClientRect();b({x:X.left+X.width/2,y:X.top+X.height/2}),u(!0)}},R=X=>{if(c&&l.current){const ie=X.clientX-y.x,le=X.clientY-y.y,$=Math.sqrt(ie*ie+le*le),F=12;let T,Q;if(${u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return D.useEffect(()=>{const X=$=>{const F={...w};$.code===r&&(F.up=!0),$.code===i&&(F.down=!0),$.code===a&&(F.left=!0),$.code===s&&(F.right=!0),$.code===o&&(F.pressed=!0,e.updateButtonValue(n,1)),M(F),le(F)},ie=$=>{const F={...w};$.code===r&&(F.up=!1),$.code===i&&(F.down=!1),$.code===a&&(F.left=!1),$.code===s&&(F.right=!1),$.code===o&&(F.pressed=!1,e.updateButtonValue(n,0)),M(F),le(F)},le=$=>{const F=($.right?1:0)-($.left?1:0),T=($.down?1:0)-($.up?1:0),Q=Math.sqrt(F*F+T*T);if(Q===0){e.updateAxes(n,0,0);return}const Te=F/Q,te=T/Q;e.updateAxes(n,Te,te)};return t?(window.addEventListener("keydown",X),window.addEventListener("keyup",ie)):(window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)}},[r,i,a,s,t,w]),D.useEffect(()=>(document.addEventListener("mousemove",R),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",re)}),[c,y]),f.jsxs(E2,{style:{flexDirection:e.inputSource.handedness==="left"?"row":"row-reverse",alignItems:"flex-start"},children:[f.jsx(hn,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),t?f.jsxs(zc,{$reverse:k==="right",children:[f.jsxs(qs,{$reverse:k==="right",children:[f.jsx(de,{$pressed:w.up,style:{margin:"2px"},children:qe[r]}),f.jsx(de,{$pressed:w.pressed,style:{margin:"2px"},children:qe[o]})]}),f.jsxs(qs,{$reverse:!1,children:[f.jsx(de,{$pressed:w.left,style:{margin:"2px"},children:qe[a]}),f.jsx(de,{$pressed:w.down,style:{margin:"2px"},children:qe[i]}),f.jsx(de,{$pressed:w.right,style:{margin:"2px"},children:qe[s]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(P2,{style:{margin:e.inputSource.handedness==="left"?"0 5px 0 -3px":"0 -3px 0 5px"},children:f.jsx(A2,{ref:l,onMouseDown:E})}),f.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[f.jsx(oe,{$reverse:k==="right",style:{backgroundColor:v?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"80px",marginBottom:"2px",borderRadius:"8px"},onClick:()=>{d(!0),e.updateButtonValue(n,1),setTimeout(()=>{d(!1),e.updateButtonValue(n,0)},500)},children:"Press"}),f.jsxs(zt,{$reverse:k==="right",children:[f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:h?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{p(!h),e.updateButtonTouch(n,!h)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:g?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{x(!g),e.updateButtonValue(n,g?0:1)},children:"Hold"})]})]})]})]})},R2=U.div` + padding: ${({$reverse:e})=>e?"6px 2px 3px 5px":"6px 5px 3px 2px"}; + pointer-events: all; + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border-radius: ${({$reverse:e})=>e?"12px 0 0 0":"0 12px 0 0"}; +`;function O2(e){const t=new Set;for(const r of e.axes)r&&r.id&&t.add(r.id);const n=e.buttons.filter(r=>r!==null).map(r=>({id:r.id,type:r.type,hasAxes:t.has(r.id)}));return n.sort((r,i)=>r.hasAxes&&!i.hasAxes?-1:!r.hasAxes&&i.hasAxes?1:0),n}const L2=({xrDevice:e,keyMap:t,pointerLocked:n})=>f.jsx("div",{style:{display:"flex",justifyContent:"space-between",flexDirection:"row"},children:Object.entries(e.controllers).map(([r,i])=>f.jsx(R2,{$reverse:r!=="left",children:O2(i.gamepadConfig).map(a=>{const s=t[r];return a.hasAxes?f.jsx(I2,{xrController:i,pointerLocked:n,buttonId:a.id,mappedKeyUp:t[r][`${a.id}-up`],mappedKeyDown:s[`${a.id}-down`],mappedKeyLeft:s[`${a.id}-left`],mappedKeyRight:s[`${a.id}-right`],mappedKeyPressed:s[a.id]},a.id):a.type==="analog"?f.jsx(M2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id):f.jsx(k2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id)})},r))}),T2=U.div` + display: flex; + justify-content: center; + pointer-events: all; + position: fixed; + display: flex; + top: 40px; + left: calc(50vw - 156px); + width: 312px; +`,j2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(e.fovy);return f.jsx(T2,{children:f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,disabled:!0,children:"FOV-Y"}),f.jsx(Ao,{$reverse:!1,value:n,style:{width:"100px",borderRadius:"2px"},onChange:i=>{const a=Number(i.target.value);r(a),e.fovy=a,t.syncFovy(),t.renderScene()},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48}),f.jsxs(oe,{$reverse:!1,disabled:!0,children:[(n/Math.PI*180).toFixed(2),"°"]})]})})},_2=U.div` + padding: 6px 5px; + display: flex; + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + justify-content: center; + pointer-events: all; + border-radius: 0 0 12px 12px; + align-items: center; + height: 24px; +`,Ws=U.div` + background-color: rgba(43, 43, 43, 0.5); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border: none; + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: center; + cursor: pointer; + color: white; + white-space: nowrap; + font-size: 14px; + text-transform: none; + box-shadow: none; + font-family: Arial, sans-serif; + border-radius: ${({$reverse:e})=>e?"0 0 0 12px":"0 0 12px 0"}; + padding: 5px; + + > div { + display: flex; + flex-direction: row; + align-items: center; + gap: 2px; + margin: 2px; + } +`,C2=({xrDevice:e,inputLayer:t,keyMapOpen:n,setKeyMapOpen:r,fovSettingOpen:i,setFovSettingOpen:a})=>f.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[f.jsxs(_2,{children:[f.jsx(s2,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",marginLeft:"4px"},children:[f.jsx(oe,{$reverse:!1,onClick:()=>{t.resetDeviceTransforms()},children:f.jsx(K,{icon:d2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{t.lockPointer(),r(!1),a(!1)},children:f.jsx(K,{icon:h2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{r(!n),a(!1)},children:f.jsx(K,{icon:m2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{a(!i),r(!1)},children:f.jsx(K,{icon:x2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{const s=e.activeSession;s==null||s.end()},children:f.jsx(K,{icon:l2})})]})]}),f.jsxs(Ws,{$reverse:!1,style:{position:"fixed",left:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:p2,style:{marginRight:"4px"}})," ","Roomscale Movement"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:"W"}),f.jsx(de,{$pressed:!1,children:"A"}),f.jsx(de,{$pressed:!1,children:"S"}),f.jsx(de,{$pressed:!1,children:"D"})]})]}),f.jsxs(Ws,{$reverse:!0,style:{position:"fixed",right:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:v2,style:{marginRight:"4px"}})," Camera Height"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Io})}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Ro})})]})]})]}),lt=new Lo,fe=new z,Ue=new z,Y=new Ae,Qs={X:new z(1,0,0),Y:new z(0,1,0),Z:new z(0,0,1)},Rr={type:"change"},Gs={type:"mouseDown"},Us={type:"mouseUp",mode:null},Ks={type:"objectChange"};class Js extends Lr{constructor(t,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const r=new V2;this._gizmo=r,this.add(r);const i=new q2;this._plane=i,this.add(i);const a=this;function s(b,w){let M=w;Object.defineProperty(a,b,{get:function(){return M!==void 0?M:w},set:function(k){M!==k&&(M=k,i[b]=k,r[b]=k,a.dispatchEvent({type:b+"-changed",value:k}),a.dispatchEvent(Rr))}}),a[b]=w,i[b]=w,r[b]=w}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new z,l=new z,c=new Ae,u=new Ae,h=new z,p=new Ae,g=new z,x=new z,v=new z,d=0,y=new z;s("worldPosition",o),s("worldPositionStart",l),s("worldQuaternion",c),s("worldQuaternionStart",u),s("cameraPosition",h),s("cameraQuaternion",p),s("pointStart",g),s("pointEnd",x),s("rotationAxis",v),s("rotationAngle",d),s("eye",y),this._offset=new z,this._startNorm=new z,this._endNorm=new z,this._cameraScale=new z,this._parentPosition=new z,this._parentQuaternion=new Ae,this._parentQuaternionInv=new Ae,this._parentScale=new z,this._worldScaleStart=new z,this._worldQuaternionInv=new Ae,this._worldScale=new z,this._positionStart=new z,this._quaternionStart=new Ae,this._scaleStart=new z,this._getPointer=F2.bind(this),this._onPointerDown=N2.bind(this),this._onPointerHover=z2.bind(this),this._onPointerMove=D2.bind(this),this._onPointerUp=$2.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(t){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(t)}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&<.setFromCamera(t,this.camera);const n=Or(this._gizmo.picker[this.mode],lt);n?this.axis=n.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&<.setFromCamera(t,this.camera);const n=Or(this._plane,lt,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Gs.mode=this.mode,this.dispatchEvent(Gs)}}pointerMove(t){const n=this.axis,r=this.mode,i=this.object;let a=this.space;if(r==="scale"?a="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(a="world"),i===void 0||n===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&<.setFromCamera(t,this.camera);const s=Or(this._plane,lt,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),a==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(i.position.applyQuaternion(Y.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),a==="world"&&(i.parent&&i.position.add(fe.setFromMatrixPosition(i.parent.matrixWorld)),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(fe.setFromMatrixPosition(i.parent.matrixWorld))));else if(r==="scale"){if(n.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ue.set(o,o,o)}else fe.copy(this.pointStart),Ue.copy(this.pointEnd),fe.applyQuaternion(this._worldQuaternionInv),Ue.applyQuaternion(this._worldQuaternionInv),Ue.divide(fe),n.search("X")===-1&&(Ue.x=1),n.search("Y")===-1&&(Ue.y=1),n.search("Z")===-1&&(Ue.z=1);i.scale.copy(this._scaleStart).multiply(Ue),this.scaleSnap&&(n.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(fe.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(fe.copy(this.rotationAxis).cross(this.eye))*o):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Qs[n]),fe.copy(Qs[n]),a==="local"&&fe.applyQuaternion(this.worldQuaternion),fe.cross(this.eye),fe.length()===0?l=!0:this.rotationAngle=this._offset.dot(fe.normalize())*o),(n==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),a==="local"&&n!=="E"&&n!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Rr),this.dispatchEvent(Ks)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Us.mode=this.mode,this.dispatchEvent(Us)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Rr),this.dispatchEvent(Ks),this.pointStart.copy(this.pointEnd))}getRaycaster(){return lt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function F2(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function z2(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e));break}}function N2(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function D2(e){this.enabled&&this.pointerMove(this._getPointer(e))}function $2(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Or(e,t,n){const r=t.intersectObject(e,!0);for(let i=0;i.9&&(s.visible=!1)),this.axis==="Y"&&(Y.setFromEuler(In.set(0,0,Math.PI/2)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),V.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(ta.lookAt(ea,V,ft)),s.quaternion.multiply(Y),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(fe),s.visible=this.dragging):(s.quaternion.copy(r),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&(Rn.copy(r),V.copy(this.eye).applyQuaternion(Y.copy(r).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(ta.lookAt(this.eye,ea,ft)),s.name==="X"&&(Y.setFromAxisAngle(Kt,Math.atan2(-V.y,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Y"&&(Y.setFromAxisAngle(ft,Math.atan2(V.x,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Z"&&(Y.setFromAxisAngle(Jt,Math.atan2(V.y,V.x)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(l){return s.name===l}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(t)}}class q2 extends A{constructor(){super(new Co(1e5,1e5,2,2),new si({visible:!1,wireframe:!0,side:Fo,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),On.copy(Kt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Yt.copy(ft).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Wt.copy(Jt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),V.copy(Yt),this.mode){case"translate":case"scale":switch(this.axis){case"X":V.copy(this.eye).cross(On),_e.copy(On).cross(V);break;case"Y":V.copy(this.eye).cross(Yt),_e.copy(Yt).cross(V);break;case"Z":V.copy(this.eye).cross(Wt),_e.copy(Wt).cross(V);break;case"XY":_e.copy(Wt);break;case"YZ":_e.copy(On);break;case"XZ":V.copy(Wt),_e.copy(Yt);break;case"XYZ":case"E":_e.set(0,0,0);break}break;case"rotate":default:_e.set(0,0,0)}_e.length()===0?this.quaternion.copy(this.cameraQuaternion):(na.lookAt(fe.set(0,0,0),_e,V),this.quaternion.setFromRotationMatrix(na)),super.updateMatrixWorld(t)}}const O=Symbol("@@iwer/devui/input-scene"),H2=.016;class Z2{constructor(t){const n=t.canvasContainer,r=new zo,i=new No(t.fovy/Math.PI*180,n.offsetWidth/n.offsetHeight,.1,1e3),a=new Ri,s=new Ri;r.add(a),a.add(s),s.position.fromArray(t.position.vec3),s.quaternion.fromArray(t.quaternion.quat),s.add(i),i.position.x-=t.ipd/2;const o=new A(new ce(.1,.1,.1)),l=o.clone();o.position.fromArray(t.controllers.left.position.vec3),o.quaternion.fromArray(t.controllers.left.quaternion.quat),l.position.fromArray(t.controllers.right.position.vec3),l.quaternion.fromArray(t.controllers.right.quaternion.quat),s.attach(o),s.attach(l),o.visible=!1,l.visible=!1;const c=new A(new Do(.25,.27,32),new si({color:16777215,side:$o}));c.rotateX(-Math.PI/2),r.add(c);const u=new Vo({alpha:!0});u.setSize(n.offsetWidth,n.offsetHeight),u.setClearColor(0,0),n.appendChild(u.domElement);const h=new Js(i,u.domElement);h.attach(o),r.add(h);const p=new Js(i,u.domElement);p.attach(l),r.add(p);const g=new ResizeObserver(()=>{this.resize()});g.observe(n);const x=d=>{d.addEventListener("mouseDown",()=>{d.userData.pressStart=performance.now()}),d.addEventListener("mouseUp",()=>{const y=performance.now()-d.userData.pressStart;d.userData.pressStart=null,y<200&&(d.mode==="rotate"?d.setMode("translate"):d.setMode("rotate"))}),d.addEventListener("change",()=>{this.renderScene()})};x(h),x(p);const v=d=>{if(!this[O].isPointerLocked)return;const y=d.movementX||d.mozMovementX||d.webkitMovementX||0,b=d.movementY||d.mozMovementY||d.webkitMovementY||0;a.rotation.y-=y*.002,s.rotation.x-=b*.002,t.quaternion.copy(s.getWorldQuaternion(new Ae)),this.renderScene()};this[O]={canvasContainer:n,renderer:u,scene:r,camera:i,playerRig:a,cameraRig:s,xrDevice:t,controllerIndicators:{left:o,right:l},transformControls:{left:h,right:p},headsetDefaultPosition:s.position.clone(),headsetDefaultQuaternion:s.quaternion.clone(),controllerDefaultPositions:{left:o.position.clone(),right:l.position.clone()},controllerDefaultQuaternions:{left:o.quaternion.clone(),right:l.quaternion.clone()},resizeObserver:g,isPointerLocked:!1,vec3:new z,quat:new Ae,mouseMoveHandler:v,keyState:{ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},movePlayerRig:()=>this.movePlayerRig(),moveInterval:null},document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){this[O].renderer.domElement.requestPointerLock=this[O].renderer.domElement.requestPointerLock||this[O].renderer.domElement.mozRequestPointerLock||this[O].renderer.domElement.webkitRequestPointerLock,this[O].renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this[O].isPointerLocked=document.pointerLockElement===this[O].renderer.domElement||document.mozPointerLockElement===this[O].renderer.domElement||document.webkitPointerLockElement===this[O].renderer.domElement,this[O].isPointerLocked?(document.addEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!1,t.visible=!1})):(document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!0,t.visible=!0}))}keyDownHandler(t){const{keyState:n,movePlayerRig:r,moveInterval:i}=this[O];t.code in n&&(n[t.code]=!0),n.ShiftLeft&&(n.KeyW||n.KeyA||n.KeyS||n.KeyD)&&(i||(this[O].moveInterval=window.setInterval(r,16))),n.ShiftLeft&&n.ArrowUp&&(this[O].cameraRig.position.y+=.05,this.renderScene()),n.ShiftLeft&&n.ArrowDown&&(this[O].cameraRig.position.y-=.05,this.renderScene())}keyUpHandler(t){const{keyState:n,moveInterval:r}=this[O];t.code in n&&(n[t.code]=!1),(!n.ShiftLeft||!(n.KeyW||n.KeyA||n.KeyS||n.KeyD))&&r&&(window.clearInterval(r),this[O].moveInterval=null)}movePlayerRig(){const{playerRig:t,keyState:n,vec3:r}=this[O];r.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),r.lengthSq()>0&&(r.normalize().multiplyScalar(H2).applyQuaternion(t.quaternion),t.position.add(r),this.renderScene())}syncFovy(){this[O].camera.fov=this[O].xrDevice.fovy/Math.PI*180,this[O].camera.updateProjectionMatrix()}resetDeviceTransforms(){const{playerRig:t,cameraRig:n,controllerIndicators:r}=this[O];n.position.copy(this[O].headsetDefaultPosition),n.quaternion.set(0,0,0,1),t.position.set(0,0,0),t.quaternion.set(0,0,0,1),Object.entries(r).forEach(([i,a])=>{a.position.copy(this[O].controllerDefaultPositions[i]),a.quaternion.copy(this[O].controllerDefaultQuaternions[i])}),this.syncDeviceTransforms(),this.renderScene()}syncDeviceTransforms(){const{xrDevice:t,cameraRig:n,controllerIndicators:r}=this[O];t.position.copy(n.getWorldPosition(this[O].vec3)),t.quaternion.copy(n.getWorldQuaternion(this[O].quat)),Object.entries(r).forEach(([i,a])=>{t.controllers[i].position.copy(a.getWorldPosition(this[O].vec3)),t.controllers[i].quaternion.copy(a.getWorldQuaternion(this[O].quat))})}renderScene(){this.syncDeviceTransforms(),this[O].renderer.render(this[O].scene,this[O].camera)}get domElement(){return this[O].renderer.domElement}resize(){const t=this[O].canvasContainer.offsetWidth,n=this[O].canvasContainer.offsetHeight;this[O].renderer.setSize(t,n),this[O].camera.aspect=t/n,this[O].camera.updateProjectionMatrix(),this.renderScene()}dispose(){this[O].resizeObserver.disconnect(),this[O].renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const X2=Symbol("@@iwer/devui/devui");class B2{constructor(t){t.ipd=0;const n=t.canvasContainer,r=document.createElement("div");r.style.position="fixed",r.style.width="100%",r.style.height="100%",r.style.top="0",r.style.left="0",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="3",n.appendChild(r);const i=new Z2(t),a=i.domElement;a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.zIndex="2",n.appendChild(a),qo(r).render(f.jsx(Y2,{xrDevice:t,inputLayer:i})),this[X2]={xrDevice:t,inputLayer:i}}}const Y2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(!1),[i,a]=D.useState(w2),[s,o]=D.useState(!1),[l,c]=D.useState(!1);return D.useEffect(()=>{const u=()=>{const h=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!h)};return document.addEventListener("pointerlockchange",u,!1),document.addEventListener("mozpointerlockchange",u,!1),document.addEventListener("webkitpointerlockchange",u,!1),()=>{document.removeEventListener("pointerlockchange",u,!1),document.removeEventListener("mozpointerlockchange",u,!1),document.removeEventListener("webkitpointerlockchange",u,!1)}},[]),f.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsx(C2,{xrDevice:e,inputLayer:t,keyMapOpen:s,setKeyMapOpen:o,fovSettingOpen:l,setFovSettingOpen:c}),s&&f.jsx(S2,{keyMap:i,setKeyMap:a}),l&&f.jsx(j2,{xrDevice:e,inputLayer:t}),f.jsx(L2,{xrDevice:e,keyMap:i,pointerLocked:n})]})},W2={metaQuest3:C0,metaQuest2:j0,metaQuestPro:_0,oculusQuest1:T0};function G2(e){const t=new A0(W2[e]);t.ipd=0,t.installRuntime(),new B2(t)}export{G2 as emulate}; diff --git a/examples/watch/assets/emulate-BFmWTp6L.js b/examples/watch/assets/emulate-BFmWTp6L.js deleted file mode 100644 index ef8f0b7..0000000 --- a/examples/watch/assets/emulate-BFmWTp6L.js +++ /dev/null @@ -1,819 +0,0 @@ -import{g as Oo,o as xt,r as D,j as f,R as Lo,V as z,O as Lr,Q as Ae,E as To,M as ra,a as si,L as jo,C as he,B as ce,b as Ai,F as Ii,c as A,d as Sn,e as We,S as _o,T as qt,P as Co,D as Fo,f as zo,h as No,G as Ri,i as Do,k as $o,W as Vo,l as qo}from"./index-Cajzeqhw.js";var ia={exports:{}},Ho="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zo=Ho,Xo=Zo;function sa(){}function aa(){}aa.resetWarningCache=sa;var Bo=function(){function e(r,i,a,s,o,l){if(l!==Xo){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:aa,resetWarningCache:sa};return n.PropTypes=n,n};ia.exports=Bo();var Yo=ia.exports;const C=Oo(Yo);var Wo=1e-6,ye=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Qo(){var e=new ye(9);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(){var e=new ye(16);return ye!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Go(e){var t=new ye(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function la(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],g=t[11],x=t[12],v=t[13],d=t[14],y=t[15],b=n*o-r*s,w=n*l-i*s,M=n*c-a*s,k=r*l-i*o,E=r*c-a*o,R=i*c-a*l,re=u*v-h*x,X=u*d-p*x,ie=u*y-g*x,le=h*d-p*v,$=h*y-g*v,F=p*y-g*d,T=b*F-w*$+M*le+k*ie-E*X+R*re;return T?(T=1/T,e[0]=(o*F-l*$+c*le)*T,e[1]=(i*$-r*F-a*le)*T,e[2]=(v*R-d*E+y*k)*T,e[3]=(p*E-h*R-g*k)*T,e[4]=(l*ie-s*F-c*X)*T,e[5]=(n*F-i*ie+a*X)*T,e[6]=(d*M-x*R-y*w)*T,e[7]=(u*R-p*M+g*w)*T,e[8]=(s*$-o*ie+c*re)*T,e[9]=(r*ie-n*$-a*re)*T,e[10]=(x*E-v*M+y*b)*T,e[11]=(h*M-u*E-g*b)*T,e[12]=(o*X-s*le-l*re)*T,e[13]=(n*le-r*X+i*re)*T,e[14]=(v*w-x*k-d*b)*T,e[15]=(u*k-h*w+p*b)*T,e):null}function ca(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],g=t[10],x=t[11],v=t[12],d=t[13],y=t[14],b=t[15],w=n[0],M=n[1],k=n[2],E=n[3];return e[0]=w*r+M*o+k*h+E*v,e[1]=w*i+M*l+k*p+E*d,e[2]=w*a+M*c+k*g+E*y,e[3]=w*s+M*u+k*x+E*b,w=n[4],M=n[5],k=n[6],E=n[7],e[4]=w*r+M*o+k*h+E*v,e[5]=w*i+M*l+k*p+E*d,e[6]=w*a+M*c+k*g+E*y,e[7]=w*s+M*u+k*x+E*b,w=n[8],M=n[9],k=n[10],E=n[11],e[8]=w*r+M*o+k*h+E*v,e[9]=w*i+M*l+k*p+E*d,e[10]=w*a+M*c+k*g+E*y,e[11]=w*s+M*u+k*x+E*b,w=n[12],M=n[13],k=n[14],E=n[15],e[12]=w*r+M*o+k*h+E*v,e[13]=w*i+M*l+k*p+E*d,e[14]=w*a+M*c+k*g+E*y,e[15]=w*s+M*u+k*x+E*b,e}function sn(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function pn(e,t,n){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,p=r*c,g=i*l,x=i*c,v=a*c,d=s*o,y=s*l,b=s*c;return e[0]=1-(g+v),e[1]=h+b,e[2]=p-y,e[3]=0,e[4]=h-b,e[5]=1-(u+v),e[6]=x+d,e[7]=0,e[8]=p+y,e[9]=x-d,e[10]=1-(u+g),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function an(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Tr(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,c,u),e}function $n(e,t){var n=new ye(3);Tr(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,p=t[8]*r,g=t[9]*i,x=t[10]*a,v=s+u+x,d=0;return v>0?(d=Math.sqrt(v+1)*2,e[3]=.25*d,e[0]=(h-g)/d,e[1]=(p-l)/d,e[2]=(o-c)/d):s>u&&s>x?(d=Math.sqrt(1+s-u-x)*2,e[3]=(h-g)/d,e[0]=.25*d,e[1]=(o+c)/d,e[2]=(p+l)/d):u>x?(d=Math.sqrt(1+u-s-x)*2,e[3]=(p-l)/d,e[0]=(o+c)/d,e[1]=.25*d,e[2]=(h+g)/d):(d=Math.sqrt(1+x-s-u)*2,e[3]=(o-c)/d,e[0]=(p+l)/d,e[1]=(h+g)/d,e[2]=.25*d),e}function Uo(e,t,n,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,p=i*c,g=i*u,x=a*c,v=a*u,d=s*u,y=o*l,b=o*c,w=o*u,M=r[0],k=r[1],E=r[2];return e[0]=(1-(x+d))*M,e[1]=(p+w)*M,e[2]=(g-b)*M,e[3]=0,e[4]=(p-w)*k,e[5]=(1-(h+d))*k,e[6]=(v+y)*k,e[7]=0,e[8]=(g+b)*E,e[9]=(v-y)*E,e[10]=(1-(h+x))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Ko(e,t,n,r,i){var a=1/Math.tan(t/2),s;return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(s=1/(r-i),e[10]=(i+r)*s,e[14]=2*i*r*s):(e[10]=-1,e[14]=-2*r),e}var Oi=Ko;function ke(){var e=new ye(3);return ye!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Jo(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Re(e,t,n){var r=new ye(3);return r[0]=e,r[1]=t,r[2]=n,r}function gr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function e0(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function t0(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function fa(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function n0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yr(e,t,n){var r=t[0],i=t[1],a=t[2],s=n[0],o=n[1],l=n[2];return e[0]=i*l-a*o,e[1]=a*s-r*l,e[2]=r*o-i*s,e}function jr(e,t,n,r){var i=t[0],a=t[1],s=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=s+r*(n[2]-s),e}function r0(e,t,n){var r=n[0],i=n[1],a=n[2],s=n[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,p=r*l-i*o,g=i*p-a*h,x=a*u-r*p,v=r*h-i*u,d=s*2;return u*=d,h*=d,p*=d,g*=2,x*=2,v*=2,e[0]=o+u+g,e[1]=l+h+x,e[2]=c+p+v,e}var i0=Jo;(function(){var e=ke();return function(t,n,r,i,a,s){var o,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;o0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=a*s,e}(function(){var e=s0();return function(t,n,r,i,a,s){var o,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,o=r;oWo?(p=Math.acos(g),x=Math.sin(p),v=Math.sin((1-r)*p)/x,d=Math.sin(r*p)/x):(v=1-r,d=r),e[0]=v*i+d*l,e[1]=v*a+d*c,e[2]=v*s+d*u,e[3]=v*o+d*h,e}function u0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function d0(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),e[i]=.5*r,r=.5/r,e[3]=(t[a*3+s]-t[s*3+a])*r,e[a]=(t[a*3+i]+t[i*3+a])*r,e[s]=(t[s*3+i]+t[i*3+s])*r}return e}var Vn=a0,vr=o0,Li=l0,Jn=c0;(function(){var e=ke(),t=Re(1,0,0),n=Re(0,1,0);return function(r,i,a){var s=n0(i,a);return s<-.999999?(yr(e,t,i),i0(e)<1e-6&&yr(e,n,i),fa(e,e),ua(r,e,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(yr(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+s,Jn(r,r))}})();(function(){var e=Oe(),t=Oe();return function(n,r,i,a,s,o){return en(e,r,s,o),en(t,i,a,o),en(n,e,t,2*o*(1-o)),n}})();(function(){var e=Qo();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jn(t,d0(t,e))}})();const ne=Symbol("@immersive-web-emulation-runtime/xr-space");class ue extends EventTarget{constructor(t,n){super(),this[ne]={parentSpace:t,offsetMatrix:n?Go(n):ge(),emulated:!0}}}class h0 extends ue{constructor(){super(void 0,ge())}}class qn{static updateOffsetPosition(t,n){const r=t[ne].offsetMatrix;sn(r,n)}static updateOffsetQuaternion(t,n){const r=t[ne].offsetMatrix,i=ke();an(i,r),pn(r,n,i)}static updateOffsetMatrix(t,n){const r=t[ne].offsetMatrix;oa(r,n)}static calculateGlobalOffsetMatrix(t,n=ge()){const r=t[ne].parentSpace?qn.calculateGlobalOffsetMatrix(t[ne].parentSpace):ge();return ca(n,r,t[ne].offsetMatrix),n}}class He{constructor(t=0,n=0,r=0){this.vec3=Re(t,n,r),this.tempVec3=ke()}get x(){return this.vec3[0]}set x(t){this.vec3[0]=t}get y(){return this.vec3[1]}set y(t){this.vec3[1]=t}get z(){return this.vec3[2]}set z(t){this.vec3[2]=t}set(t,n,r){return e0(this.vec3,t,n,r),this}clone(){return new He(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return gr(this.tempVec3,this.vec3),fa(this.vec3,this.tempVec3),this}add(t){return gr(this.tempVec3,this.vec3),t0(this.vec3,this.tempVec3,t.vec3),this}applyQuaternion(t){return gr(this.tempVec3,this.vec3),r0(this.vec3,this.tempVec3,t.quat),this}}class ht{constructor(t=0,n=0,r=0,i=1){this.quat=Vn(t,n,r,i),this.tempQuat=Oe()}get x(){return this.quat[0]}set x(t){this.quat[0]=t}get y(){return this.quat[1]}set y(t){this.quat[1]=t}get z(){return this.quat[2]}set z(t){this.quat[2]=t}get w(){return this.quat[3]}set w(t){this.quat[3]=t}set(t,n,r,i){return Li(this.quat,t,n,r,i),this}clone(){return new ht(this.x,this.y,this.z,this.w)}copy(t){return Li(this.quat,t.x,t.y,t.z,t.w),this}normalize(){return vr(this.tempQuat,this.quat),Jn(this.quat,this.tempQuat),this}invert(){return vr(this.tempQuat,this.quat),u0(this.quat,this.tempQuat),this}multiply(t){return vr(this.tempQuat,this.quat),f0(this.quat,this.tempQuat,t.quat),this}setFromAxisAngle(t,n){return ua(this.quat,t.vec3,n),this}}const I=Symbol("@immersive-web-emulation-runtime/gamepad");var on;(function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"})(on||(on={}));class da{constructor(t,n){this[I]={type:t,eventTrigger:n,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return this[I].type==="manual"?this[I].pressed:this[I].value>0}get touched(){return this[I].type==="manual"?this[I].touched:this[I].touched||this.pressed}get value(){return this[I].value}}class p0{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ai{constructor(t,n="",r=-1){this[I]={id:n,index:r,connected:!1,timestamp:performance.now(),mapping:t.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},t.buttons.forEach(i=>{var a;i===null?this[I].buttonsSequence.push(null):(this[I].buttonsSequence.push(i.id),this[I].buttonsMap[i.id]=new da(i.type,(a=i.eventTrigger)!==null&&a!==void 0?a:null))}),t.axes.forEach(i=>{i===null?this[I].axesSequence.push(null):(this[I].axesSequence.push(i.id+i.type),this[I].axesMap[i.id]||(this[I].axesMap[i.id]={x:0,y:0}))})}get id(){return this[I].id}get index(){return this[I].index}get connected(){return this[I].connected}get timestamp(){return this[I].timestamp}get mapping(){return this[I].mapping}get axes(){const t=[];return this[I].axesSequence.forEach(n=>{if(n===null)t.push(null);else{const r=n.substring(0,n.length-6),i=n.substring(n.length-6);t.push(i==="y-axis"?this[I].axesMap[r].y:this[I].axesMap[r].x)}}),t}get buttons(){return this[I].buttonsSequence.map(t=>t===null?new p0:this[I].buttonsMap[t])}get hapticActuators(){return this[I].hapticActuators}get vibrationActuator(){return null}}var be;(function(e){e.None="none",e.Left="left",e.Right="right"})(be||(be={}));var Hn;(function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"})(Hn||(Hn={}));class m0 extends Array{}const Qe=Symbol("@immersive-web-emulation-runtime/xr-input-source");class er{constructor(t,n,r,i,a,s,o){this[Qe]={handedness:t,targetRayMode:n,targetRaySpace:i,gripSpace:s,profiles:r,gamepad:a,hand:o}}get handedness(){return this[Qe].handedness}get targetRayMode(){return this[Qe].targetRayMode}get targetRaySpace(){return this[Qe].targetRaySpace}get gripSpace(){return this[Qe].gripSpace}get profiles(){return this[Qe].profiles}get gamepad(){return this[Qe].gamepad}get hand(){return this[Qe].hand}}class Ln extends Event{constructor(t,n){if(super(t,n),!n.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!n.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=n.frame,this.inputSource=n.inputSource}}const G=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),Ti={[be.Left]:{position:new He(-.25,1.5,-.4),quaternion:new ht},[be.Right]:{position:new He(.25,1.5,-.4),quaternion:new ht},[be.None]:{position:new He(.25,1.5,-.4),quaternion:new ht}};class ha{constructor(t){this[G]={inputSource:t,position:Ti[t.handedness].position.clone(),quaternion:Ti[t.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[G].position}get quaternion(){return this[G].quaternion}get inputSource(){return this[G].inputSource}get connected(){return this[G].connected}set connected(t){this[G].connected=t,this[G].inputSource.gamepad[I].connected=t}onFrameStart(t){const n=this[G].inputSource.targetRaySpace;pn(n[ne].offsetMatrix,this[G].quaternion.quat,this[G].position.vec3);const r=t.session;this[G].inputSource.gamepad.buttons.forEach(i=>{i instanceof da&&(i[I].lastFrameValue=i[I].value,i[I].pendingValue!=null&&(i[I].value=i[I].pendingValue,i[I].pendingValue=null),i[I].eventTrigger!=null&&(i[I].lastFrameValue===0&&i[I].value>0?(r.dispatchEvent(new Ln(i[I].eventTrigger,{frame:t,inputSource:this[G].inputSource})),r.dispatchEvent(new Ln(i[I].eventTrigger+"start",{frame:t,inputSource:this[G].inputSource}))):i[I].lastFrameValue>0&&i[I].value===0&&r.dispatchEvent(new Ln(i[I].eventTrigger+"end",{frame:t,inputSource:this[G].inputSource}))))}),this[G].inputSourceChanged=this.connected!==this[G].lastFrameConnected,this[G].lastFrameConnected=this.connected}}const ji=Symbol("@immersive-web-emulation-runtime/xr-controller");class g0 extends ha{constructor(t,n,r){if(!t.layout[n])throw new DOMException("Handedness not supported","InvalidStateError");const i=new ue(r),a=t.layout[n].gripOffsetMatrix?new ue(i,t.layout[n].gripOffsetMatrix):void 0,s=[t.profileId,...t.fallbackProfileIds],o=new er(n,Hn.TrackedPointer,s,i,new ai(t.layout[n].gamepad),a);super(o),this[ji]={gamepadConfig:t.layout[n].gamepad}}get gamepadConfig(){return this[ji].gamepadConfig}updateButtonValue(t,n){if(n>1||n<0){console.warn(`Out-of-range value ${n} provided for button ${t}.`);return}const r=this[G].inputSource.gamepad[I].buttonsMap[t];if(r){if(r[I].type==="binary"&&n!=1&&n!=0){console.warn(`Non-binary value ${n} provided for binary button ${t}.`);return}r[I].pendingValue=n}else console.warn(`Current controller does not have button ${t}.`)}updateButtonTouch(t,n){const r=this[G].inputSource.gamepad[I].buttonsMap[t];r?r[I].touched=n:console.warn(`Current controller does not have button ${t}.`)}updateAxis(t,n,r){if(r>1||r<-1){console.warn(`Out-of-range value ${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?n==="x-axis"?i.x=r:n==="y-axis"&&(i.y=r):console.warn(`Current controller does not have ${t} axes.`)}updateAxes(t,n,r){if(n>1||n<-1||r>1||r<-1){console.warn(`Out-of-range value x:${n}, y:${r} provided for ${t} axes.`);return}const i=this[G].inputSource.gamepad[I].axesMap[t];i?(i.x=n,i.y=r):console.warn(`Current controller does not have ${t} axes.`)}}const ct=Symbol("@immersive-web-emulation-runtime/xr-view");var H;(function(e){e.None="none",e.Left="left",e.Right="right"})(H||(H={}));class pa{constructor(t,n,r,i){this[ct]={eye:t,projectionMatrix:n,transform:r,recommendedViewportScale:null,requestedViewportScale:1,session:i}}get eye(){return this[ct].eye}get projectionMatrix(){return this[ct].projectionMatrix}get transform(){return this[ct].transform}get recommendedViewportScale(){return this[ct].recommendedViewportScale}requestViewportScale(t){if(t===null||t<=0||t>1){console.warn("Invalid scale value. Scale must be > 0 and <= 1.");return}this[ct].requestedViewportScale=t}}var ln;(function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"})(ln||(ln={}));class oi extends Map{}const pt=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class li extends ue{constructor(t,n,r){super(n,r),this[pt]={jointName:t,radius:0}}get jointName(){return this[pt].jointName}}const y0={jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},v0={jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]},x0={jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},_i={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:x0,pinch:y0,point:v0}},w0={mapping:on.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},Ci=ke(),Fi=Oe(),zi=ke(),Ni=ke(),Di=Oe(),$i=ke(),Vi=ke(),qi=Oe(),Hi=ke(),Zi=(e,t,n,r)=>(an(Ci,t),$n(Fi,t),Tr(zi,t),an(Ni,n),$n(Di,n),Tr($i,n),jr(Vi,Ci,Ni,r),en(qi,Fi,Di,r),jr(Hi,zi,$i,r),Uo(e,qi,Vi,Hi),e),b0=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],S0=e=>{for(let t=0;t<16;t++)e[t]*=b0[t]},ot=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class Xi extends ha{constructor(t,n,r){if(n!==be.Left&&n!==be.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!t.poses.default||!t.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const i=new ue(r),a=new ue(i),s=[t.profileId,...t.fallbackProfileIds],o=new oi;Object.values(ln).forEach(c=>{o.set(c,new li(c,i))});const l=new er(n,Hn.TrackedPointer,s,i,new ai(w0),a,o);super(l),this[ot]={poseId:"default",poses:t.poses},this.updateHandPose()}get poseId(){return this[ot].poseId}set poseId(t){if(!this[ot].poses[t]){console.warn(`Pose config ${t} not found`);return}this[ot].poseId=t}updateHandPose(){const t=this[ot].poses[this[ot].poseId],n=this[ot].poses.pinch;Object.values(ln).forEach(r=>{const i=t.jointTransforms[r].offsetMatrix,a=n.jointTransforms[r].offsetMatrix,s=this.inputSource.hand.get(r);Zi(s[ne].offsetMatrix,i,a,this.pinchValue),this.inputSource.handedness===be.Right&&S0(s[ne].offsetMatrix),s[pt].radius=(1-this.pinchValue)*t.jointTransforms[r].radius+this.pinchValue*n.jointTransforms[r].radius}),t.gripOffsetMatrix&&n.gripOffsetMatrix&&Zi(this.inputSource.gripSpace[ne].offsetMatrix,t.gripOffsetMatrix,n.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[G].inputSource.gamepad[I].buttonsMap.pinch.value}updatePinchValue(t){if(t>1||t<0){console.warn(`Out-of-range value ${t} provided for pinch`);return}const n=this[G].inputSource.gamepad[I].buttonsMap.pinch;n[I].pendingValue=t}onFrameStart(t){super.onFrameStart(t),this.updateHandPose()}}const Ht=Symbol("@immersive-web-emulation-runtime/xr-pose");class tr{constructor(t,n=!1,r=void 0,i=void 0){this[Ht]={transform:t,emulatedPosition:n,linearVelocity:r,angularVelocity:i}}get transform(){return this[Ht].transform}get emulatedPosition(){return this[Ht].emulatedPosition}get linearVelocity(){return this[Ht].linearVelocity}get angularVelocity(){return this[Ht].angularVelocity}}const Bi=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class ma extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Bi]={radius:n}}get radius(){return this[Bi].radius}}class Zn{constructor(t=0,n=0,r=0,i=1){this.x=t,this.y=n,this.z=r,this.w=i,Object.freeze(this)}static fromPoint(t){return new Zn(t.x,t.y,t.z,t.w)}matrixTransform(t){return new Zn}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn=typeof globalThis.DOMPointReadOnly<"u"?globalThis.DOMPointReadOnly:Zn,xe=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class nr{constructor(t,n){const r=Re(0,0,0),i=Oe();this[xe]={matrix:ge(),position:t?Re(t.x,t.y,t.z):r,orientation:n?Jn(Oe(),Vn(n.x,n.y,n.z,n.w)):i,inverse:null},this.updateMatrix()}updateMatrix(){pn(this[xe].matrix,this[xe].orientation,this[xe].position)}get matrix(){return this[xe].matrix}get position(){const t=this[xe].position;return new Mn(t[0],t[1],t[2],1)}get orientation(){const t=this[xe].orientation;return new Mn(t[0],t[1],t[2],t[3])}get inverse(){if(!this[xe].inverse){const t=ge();if(!la(t,this[xe].matrix))throw new Error("Matrix is not invertible.");let n=ke();an(n,t);let r=Oe();$n(r,t),this[xe].inverse=new nr(new Mn(n[0],n[1],n[2],1),new Mn(r[0],r[1],r[2],r[3])),this[xe].inverse[xe].inverse=this}return this[xe].inverse}}const Yi=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class ga extends tr{constructor(t,n,r=!1,i=void 0,a=void 0){super(t,r,i,a),this[Yi]={views:Object.freeze(n)}}get views(){return this[Yi].views}}const pe=Symbol("@immersive-web-emulation-runtime/xr-frame"),Wi=ge(),Qi=ge(),Gi=ge(),Ui=(e,t,n)=>{qn.calculateGlobalOffsetMatrix(t,Wi),qn.calculateGlobalOffsetMatrix(n,Qi),la(Gi,Qi),ca(e,Gi,Wi)};class ya{constructor(t,n,r,i,a){this[pe]={session:t,id:n,active:r,animationFrame:i,predictedDisplayTime:a,tempMat4:ge()}}get session(){return this[pe].session}get predictedDisplayTime(){return this[pe].predictedDisplayTime}getPose(t,n){if(!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Ui(this[pe].tempMat4,t,n);const r=ke();an(r,this[pe].tempMat4);const i=Oe();return $n(i,this[pe].tempMat4),new tr(new nr({x:r[0],y:r[1],z:r[2],w:1},{x:i[0],y:i[1],z:i[2],w:i[3]}),t[ne].emulated)}getViewerPose(t){if(!this[pe].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const n=this[pe].session,r=n[m].device,i=this.getPose(r.viewerSpace,t),a=n[m].mode===J.Inline?[H.None]:[H.Left,H.Right],s=[];return a.forEach(o=>{const l=r.viewSpaces[o],c=this.getPose(l,t),u=n[m].getProjectionMatrix(o),h=new pa(o,new Float32Array(u),c.transform,n);s.push(h)}),new ga(i.transform,s,!1)}getJointPose(t,n){const r=this.getPose(t,n),i=t[pt].radius;return new ma(r.transform,i,!1)}fillJointRadii(t,n){if(t=Array.from(t),!this[pe].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(t.length>n.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let r=!0;for(let i=0;ir.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return t.forEach((i,a)=>{Ui(this[pe].tempMat4,i,n);for(let s=0;s<16;s++)r[a*16+s]=this[pe].tempMat4[s]}),!0}}class va extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!n.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!n.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=n.session,this.added=n.added,this.removed=n.removed}}var xa;const tt=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var se;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"})(se||(se={}));class wt extends ue{constructor(t,n,r){super(n,r),this[xa]={type:null,onreset:()=>{}},this[tt].type=t}get onreset(){var t;return(t=this[tt].onreset)!==null&&t!==void 0?t:()=>{}}set onreset(t){this[tt].onreset&&this.removeEventListener("reset",this[tt].onreset),this[tt].onreset=t,t&&this.addEventListener("reset",t)}getOffsetReferenceSpace(t){return new wt(this[tt].type,this,t)}}xa=tt;const Zt=Symbol("@immersive-web-emulation-runtime/xr-render-state");class _r{constructor(t={},n){this[Zt]={depthNear:t.depthNear||(n==null?void 0:n.depthNear)||.1,depthFar:t.depthFar||(n==null?void 0:n.depthFar)||1e3,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||(n==null?void 0:n.inlineVerticalFieldOfView)||null,baseLayer:t.baseLayer||(n==null?void 0:n.baseLayer)||null}}get depthNear(){return this[Zt].depthNear}get depthFar(){return this[Zt].depthFar}get inlineVerticalFieldOfView(){return this[Zt].inlineVerticalFieldOfView}get baseLayer(){return this[Zt].baseLayer}}class Xn extends Event{constructor(t,n){if(super(t,n),!n.session)throw new Error("XRSessionEventInit.session is required");this.session=n.session}}var Et;(function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"})(Et||(Et={}));var J;(function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"})(J||(J={}));const m=Symbol("@immersive-web-emulation-runtime/xr-session");class ci extends EventTarget{constructor(t,n,r){super(),this[m]={device:t,mode:n,renderState:new _r,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[H.Left]:ge(),[H.Right]:ge(),[H.None]:ge()},getProjectionMatrix:i=>this[m].projectionMatrices[i],referenceSpaceIsSupported:i=>{if(!this[m].enabledFeatures.includes(i))return!1;switch(i){case se.Viewer:return!0;case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:return this[m].mode!=J.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[m].ended)return;this[m].deviceFrameHandle=globalThis.requestAnimationFrame(this[m].onDeviceFrame),this[m].pendingRenderState!=null&&(this[m].renderState=this[m].pendingRenderState,this[m].pendingRenderState=null,this[m].device[S].onBaseLayerSet(this[m].renderState.baseLayer));const i=this[m].renderState.baseLayer;if(i===null)return;const a=i.context,s=a.canvas;if(this[m].mode!=J.Inline){const x=a.getParameter(a.COLOR_CLEAR_VALUE),v=a.getParameter(a.DEPTH_CLEAR_VALUE),d=a.getParameter(a.STENCIL_CLEAR_VALUE);a.clearColor(0,0,0,0),a.clearDepth(1),a.clearStencil(0),a.clear(a.DEPTH_BUFFER_BIT|a.COLOR_BUFFER_BIT|a.STENCIL_BUFFER_BIT),a.clearColor(x[0],x[1],x[2],x[3]),a.clearDepth(v),a.clearStencil(d)}const{depthNear:o,depthFar:l}=this[m].renderState,{width:c,height:u}=s;if(this[m].mode!==J.Inline){const x=c*(this[m].device.stereoEnabled?.5:1)/u;Oi(this[m].projectionMatrices[H.Left],this[m].device.fovy,x,o,l),oa(this[m].projectionMatrices[H.Right],this[m].projectionMatrices[H.Left])}else{const x=c/u;Oi(this[m].projectionMatrices[H.None],this[m].renderState.inlineVerticalFieldOfView,x,o,l)}const h=new ya(this,this[m].frameHandle,!0,!0,performance.now());this[m].device[S].onFrameStart(h),this[m].updateActiveInputSources();const p=this[m].currentFrameCallbacks=this[m].frameCallbacks;this[m].frameCallbacks=[];const g=performance.now();for(let x=0;x{const i=this[m].enabledFeatures.includes(L.HandTracking),a=this[m].activeInputSources,s=this[m].device.inputSources.filter(c=>!c.hand||i),o=s.filter(c=>!a.includes(c)),l=a.filter(c=>!s.includes(c));this[m].activeInputSources=s,(o.length>0||l.length>0)&&this.dispatchEvent(new va("inputsourceschange",{session:this,added:o,removed:l}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[m].onDeviceFrame()}get visibilityState(){return this[m].device.visibilityState}get frameRate(){return this[m].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[m].device.supportedFrameRates)}get renderState(){return this[m].renderState}get inputSources(){return this[m].inputSourceArray.length=0,!this[m].ended&&this[m].mode!==J.Inline&&this[m].inputSourceArray.push(...this[m].activeInputSources),this[m].inputSourceArray}get enabledFeatures(){return this[m].enabledFeatures}get isSystemKeyboardSupported(){return this[m].isSystemKeyboardSupported}updateRenderState(t={}){var n,r,i,a;if(this[m].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(t.baseLayer&&t.baseLayer[Ke].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(t.inlineVerticalFieldOfView!=null&&this[m].mode!==J.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:t.baseLayer||((n=this[m].pendingRenderState)===null||n===void 0?void 0:n.baseLayer)||void 0,depthFar:t.depthFar||((r=this[m].pendingRenderState)===null||r===void 0?void 0:r.depthFar)||void 0,depthNear:t.depthNear||((i=this[m].pendingRenderState)===null||i===void 0?void 0:i.depthNear)||void 0,inlineVerticalFieldOfView:t.inlineVerticalFieldOfView||((a=this[m].pendingRenderState)===null||a===void 0?void 0:a.inlineVerticalFieldOfView)||void 0};this[m].pendingRenderState=new _r(s,this[m].renderState)}async updateTargetFrameRate(t){return new Promise((n,r)=>{this[m].ended?r(new DOMException("XRSession has already ended.","InvalidStateError")):this[m].device.supportedFrameRates.includes(t)?(this[m].nominalFrameRate===t?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[m].nominalFrameRate=t,this.dispatchEvent(new Xn("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${t}`)),n()):r(new DOMException("Requested frame rate not supported.","InvalidStateError"))})}async requestReferenceSpace(t){return new Promise((n,r)=>{if(this[m].ended||!this[m].referenceSpaceIsSupported(t)){r(new DOMException("The requested reference space type is not supported.","NotSupportedError"));return}let i;switch(t){case se.Viewer:i=this[m].device.viewerSpace;break;case se.Local:i=new wt(t,this[m].device[S].globalSpace,this[m].device.viewerSpace[ne].offsetMatrix);break;case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:i=new wt(t,this[m].device[S].globalSpace);break}this[m].referenceSpaces.push(i),n(i)})}requestAnimationFrame(t){if(this[m].ended)return 0;const n=++this[m].frameHandle;return this[m].frameCallbacks.push({handle:n,callback:t,cancelled:!1}),n}cancelAnimationFrame(t){let n=this[m].frameCallbacks,r=n.findIndex(i=>i&&i.handle===t);r>-1&&(n[r].cancelled=!0,n.splice(r,1)),n=this[m].currentFrameCallbacks,n&&(r=n.findIndex(i=>i&&i.handle===t),r>-1&&(n[r].cancelled=!0))}async end(){return new Promise((t,n)=>{this[m].ended||this[m].deviceFrameHandle===null?n(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[m].deviceFrameHandle),this[m].device[S].onSessionEnd(),this.dispatchEvent(new Xn("end",{session:this})),t())})}get onend(){var t;return(t=this[m].onend)!==null&&t!==void 0?t:()=>{}}set onend(t){this[m].onend&&this.removeEventListener("end",this[m].onend),this[m].onend=t,t&&this.addEventListener("end",t)}get oninputsourceschange(){var t;return(t=this[m].oninputsourceschange)!==null&&t!==void 0?t:()=>{}}set oninputsourceschange(t){this[m].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[m].oninputsourceschange),this[m].oninputsourceschange=t,t&&this.addEventListener("inputsourceschange",t)}get onselect(){var t;return(t=this[m].onselect)!==null&&t!==void 0?t:()=>{}}set onselect(t){this[m].onselect&&this.removeEventListener("select",this[m].onselect),this[m].onselect=t,t&&this.addEventListener("select",t)}get onselectstart(){var t;return(t=this[m].onselectstart)!==null&&t!==void 0?t:()=>{}}set onselectstart(t){this[m].onselectstart&&this.removeEventListener("selectstart",this[m].onselectstart),this[m].onselectstart=t,t&&this.addEventListener("selectstart",t)}get onselectend(){var t;return(t=this[m].onselectend)!==null&&t!==void 0?t:()=>{}}set onselectend(t){this[m].onselectend&&this.removeEventListener("selectend",this[m].onselectend),this[m].onselectend=t,t&&this.addEventListener("selectend",t)}get onsqueeze(){var t;return(t=this[m].onsqueeze)!==null&&t!==void 0?t:()=>{}}set onsqueeze(t){this[m].onsqueeze&&this.removeEventListener("squeeze",this[m].onsqueeze),this[m].onsqueeze=t,t&&this.addEventListener("squeeze",t)}get onsqueezestart(){var t;return(t=this[m].onsqueezestart)!==null&&t!==void 0?t:()=>{}}set onsqueezestart(t){this[m].onsqueezestart&&this.removeEventListener("squeezestart",this[m].onsqueezestart),this[m].onsqueezestart=t,t&&this.addEventListener("squeezestart",t)}get onsqueezeend(){var t;return(t=this[m].onsqueezeend)!==null&&t!==void 0?t:()=>{}}set onsqueezeend(t){this[m].onsqueezeend&&this.removeEventListener("squeezeend",this[m].onsqueezeend),this[m].onsqueezeend=t,t&&this.addEventListener("squeezeend",t)}get onvisibilitychange(){var t;return(t=this[m].onvisibilitychange)!==null&&t!==void 0?t:()=>{}}set onvisibilitychange(t){this[m].onvisibilitychange&&this.removeEventListener("visibilitychange",this[m].onvisibilitychange),this[m].onvisibilitychange=t,t&&this.addEventListener("visibilitychange",t)}get onframeratechange(){var t;return(t=this[m].onframeratechange)!==null&&t!==void 0?t:()=>{}}set onframeratechange(t){this[m].onframeratechange&&this.removeEventListener("frameratechange",this[m].onframeratechange),this[m].onframeratechange=t,t&&this.addEventListener("frameratechange",t)}}class wa extends EventTarget{}const Ke=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),M0={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class k0 extends wa{constructor(t,n,r={}){if(super(),t[m].ended)throw new DOMException("Session has ended","InvalidStateError");const i={...M0,...r};this[Ke]={session:t,context:n,antialias:i.antialias}}get context(){return this[Ke].context}get antialias(){return this[Ke].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ke].context.drawingBufferWidth}get framebufferHeight(){return this[Ke].context.drawingBufferHeight}getViewport(t){if(t[ct].session!==this[Ke].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ke].session[m].device[S].getViewport(this,t)}static getNativeFramebufferScaleFactor(t){if(!(t instanceof ci))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return t[m].ended?0:1}}const Je=Symbol("@immersive-web-emulation-runtime/xr-system");class Ki extends EventTarget{constructor(t){super(),this[Je]={device:t}}isSessionSupported(t){return new Promise((n,r)=>{t===J.Inline?n(!0):n(this[Je].device.supportedSessionModes.includes(t))})}requestSession(t,n={}){return new Promise((r,i)=>{this.isSessionSupported(t).then(a=>{if(!a){i(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));return}if(this[Je].activeSession){i(new DOMException("An active XRSession already exists.","InvalidStateError"));return}const{requiredFeatures:s=[],optionalFeatures:o=[]}=n,{supportedFeatures:l}=this[Je].device;if(!s.every(g=>l.includes(g))){i(new Error("One or more required features are not supported by the device."));return}const u=o.filter(g=>l.includes(g)),h=Array.from(new Set([...s,...u,L.Viewer,L.Local])),p=new ci(this[Je].device,t,h);this[Je].activeSession=p,p.addEventListener("end",()=>{this[Je].activeSession=void 0}),r(p)}).catch(i)})}}const _=Symbol("@immersive-web-emulation-runtime/action-player");class E0{constructor(t,n,r){const{schema:i,frames:a}=n;if(!a||!i||a.length===0)throw new DOMException("wrong recording format","NotSupportedError");const s=new wt(se.Viewer,t),o={[H.Left]:new ue(s),[H.Right]:new ue(s),[H.None]:new ue(s)};this[_]={refSpace:t,inputSources:new Map,inputSchemas:new Map,frames:a,recordedFramePointer:0,startingTimeStamp:a[0][0],endingTimeStamp:a[a.length-1][0],playbackTime:a[0][0],playing:!1,viewerSpace:s,viewSpaces:o,vec3:ke(),quat:Oe()},sn(this[_].viewSpaces[H.Left][ne].offsetMatrix,Re(-r/2,0,0)),sn(this[_].viewSpaces[H.Right][ne].offsetMatrix,Re(r/2,0,0)),i.forEach(l=>{const c=l[0],u=l[1];let h;if(u.hasGamepad){const v=[];for(let y=0;y{g.set(v,new li(v,p))}));const x=new er(u.handedness,u.targetRayMode,u.profiles,p,h,u.hasGrip?new ue(t):void 0,u.hasHand?g:void 0);this[_].inputSources.set(c,{active:!1,source:x}),this[_].inputSchemas.set(c,u)})}play(){this[_].recordedFramePointer=0,this[_].playbackTime=this[_].startingTimeStamp,this[_].playing=!0,this[_].actualTimeStamp=performance.now()}stop(){this[_].playing=!1}get playing(){return this[_].playing}get viewerSpace(){return this[_].viewerSpace}get viewSpaces(){return this[_].viewSpaces}get inputSources(){return Array.from(this[_].inputSources.values()).filter(t=>t.active).map(t=>t.source)}playFrame(){const t=performance.now(),n=t-this[_].actualTimeStamp;if(this[_].actualTimeStamp=t,this[_].playbackTime+=n,this[_].playbackTime>this[_].endingTimeStamp){this.stop();return}for(;this[_].frames[this[_].recordedFramePointer+1][0]{l.active=!1}),o.forEach((l,c)=>{this[_].inputSources.get(c).active=!0;const u=this[_].inputSources.get(c).source,h=this[_].inputSchemas.get(c);this.updateInputSource(u,h,s.has(c)?s.get(c):l,l,a)})}updateInputSource(t,n,r,i,a){if(this.updateXRSpaceFromMergedFrames(t.targetRaySpace,r.targetRayTransform,i.targetRayTransform,a),n.hasGrip&&this.updateXRSpaceFromMergedFrames(t.gripSpace,r.gripTransform,i.gripTransform,a),n.hasHand)for(let s=0;s<25;s++){const o=r.handTransforms.slice(s*8,s*8+7),l=i.handTransforms.slice(s*8,s*8+7),c=r.handTransforms[s*8+7],u=i.handTransforms[s*8+7],h=t.hand.get(n.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,l,a),h[pt].radius=(u-c)*a+c}if(n.hasGamepad){const s=t.gamepad;i.buttons.forEach((o,l)=>{const c=s.buttons[l];c[I].pressed=o[0]===1,c[I].touched=o[1]===1;const u=r.buttons[l][2],h=o[2];c[I].value=(h-u)*a+u}),i.axes.forEach((o,l)=>{const c=r.axes[l];s[I].axesMap[l.toString()].x=(o-c)*a+c})}}updateXRSpaceFromMergedFrames(t,n,r,i){const a=Re(n[0],n[1],n[2]),s=Vn(n[3],n[4],n[5],n[6]),o=Re(r[0],r[1],r[2]),l=Vn(r[3],r[4],r[5],r[6]);jr(this[_].vec3,a,o,i),en(this[_].quat,s,l,i),pn(t[ne].offsetMatrix,this[_].quat,this[_].vec3)}processRawInputData(t){const n=t[0],r=this[_].inputSchemas.get(n),a={targetRayTransform:t.slice(1,8)};let s=8;if(r.hasGrip&&(a.gripTransform=t[s++]),r.hasHand&&(a.handTransforms=t[s++]),r.hasGamepad){const o=t[s];a.buttons=o.slice(0,r.numButtons),a.axes=o.slice(r.numButtons)}return{index:n,inputData:a}}}const P0="1.0.3";class Ji extends Event{constructor(t,n){if(super(t,n),!n.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=n.referenceSpace,this.transform=n.transform}}const Xt=Symbol("@immersive-web-emulation-runtime/xr-viewport");class kn{constructor(t,n,r,i){this[Xt]={x:t,y:n,width:r,height:i}}get x(){return this[Xt].x}get y(){return this[Xt].y}get width(){return this[Xt].width}get height(){return this[Xt].height}}var L;(function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"})(L||(L={}));const S=Symbol("@immersive-web-emulation-runtime/xr-device"),Bt={ipd:.063,fovy:Math.PI/2,headsetPosition:new He(0,1.6,0),headsetQuaternion:new ht,stereoEnabled:!1};class A0{constructor(t,n={}){var r,i,a,s,o,l;const c=new h0,u=new wt(se.Viewer,c),h={[H.Left]:new ue(u),[H.Right]:new ue(u),[H.None]:new ue(u)},p=t.controllerConfig,g={};p&&Object.values(be).forEach(d=>{p.layout[d]&&(g[d]=new g0(p,d,c))});const x={[be.Left]:new Xi(_i,be.Left,c),[be.Right]:new Xi(_i,be.Right,c)},v=(r=n.canvasContainer)!==null&&r!==void 0?r:document.createElement("div");v.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${P0}`,v.style.position="fixed",v.style.width="100%",v.style.height="100%",v.style.top="0",v.style.left="0",v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.overflow="hidden",v.style.zIndex="999",this[S]={name:t.name,supportedSessionModes:t.supportedSessionModes,supportedFeatures:t.supportedFeatures,supportedFrameRates:t.supportedFrameRates,isSystemKeyboardSupported:t.isSystemKeyboardSupported,internalNominalFrameRate:t.internalNominalFrameRate,userAgent:t.userAgent,position:(i=n.headsetPosition)!==null&&i!==void 0?i:Bt.headsetPosition.clone(),quaternion:(a=n.headsetQuaternion)!==null&&a!==void 0?a:Bt.headsetQuaternion.clone(),stereoEnabled:(s=n.stereoEnabled)!==null&&s!==void 0?s:Bt.stereoEnabled,ipd:(o=n.ipd)!==null&&o!==void 0?o:Bt.ipd,fovy:(l=n.fovy)!==null&&l!==void 0?l:Bt.fovy,controllers:g,hands:x,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Et.Visible,pendingVisibilityState:null,xrSystem:null,matrix:ge(),globalSpace:c,viewerSpace:u,viewSpaces:h,canvasContainer:v,getViewport:(d,y)=>{const b=d.context.canvas,{width:w,height:M}=b;switch(y.eye){case H.None:return new kn(0,0,w,M);case H.Left:return new kn(0,0,this[S].stereoEnabled?w/2:w,M);case H.Right:return new kn(w/2,0,this[S].stereoEnabled?w/2:0,M)}},updateViews:()=>{const d=this[S].viewerSpace;pn(d[ne].offsetMatrix,this[S].quaternion.quat,this[S].position.vec3),sn(this[S].viewSpaces[H.Left][ne].offsetMatrix,Re(-this[S].ipd/2,0,0)),sn(this[S].viewSpaces[H.Right][ne].offsetMatrix,Re(this[S].ipd/2,0,0))},onBaseLayerSet:d=>{if(!d)return;const y=d.context.canvas;y.parentElement!==this[S].canvasContainer&&(this[S].canvasData={canvas:y,parent:y.parentElement,width:y.width,height:y.height},this[S].canvasContainer.appendChild(y),document.body.appendChild(this[S].canvasContainer)),y.width=window.innerWidth,y.height=window.innerHeight},onSessionEnd:()=>{if(this[S].canvasData){const{canvas:d,parent:y,width:b,height:w}=this[S].canvasData;d.width=b,d.height=w,y?y.appendChild(d):this[S].canvasContainer.removeChild(d),document.body.removeChild(this[S].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:d=>{var y;if(!((y=this[S].actionPlayer)===null||y===void 0)&&y.playing)this[S].actionPlayer.playFrame();else{const b=d.session;this[S].updateViews(),this[S].pendingVisibilityState&&(this[S].visibilityState=this[S].pendingVisibilityState,this[S].pendingVisibilityState=null,b.dispatchEvent(new Xn("visibilitychange",{session:b}))),this[S].visibilityState===Et.Visible&&this.activeInputs.forEach(w=>{w.onFrameStart(d)}),this[S].pendingReferenceSpaceReset&&(b[m].referenceSpaces.forEach(w=>{switch(w[tt].type){case se.Local:case se.LocalFloor:case se.BoundedFloor:case se.Unbounded:w.dispatchEvent(new Ji("reset",{referenceSpace:w}));break}}),this[S].pendingReferenceSpaceReset=!1)}this[S].updateViews()}},this[S].updateViews()}installRuntime(t=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise((n,r)=>{n(!0)})},configurable:!0}),this[S].xrSystem=new Ki(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[S].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[S].userAgent,writable:!1,configurable:!1,enumerable:!0}),t.XRSystem=Ki,t.XRSession=ci,t.XRRenderState=_r,t.XRFrame=ya,t.XRSpace=ue,t.XRReferenceSpace=wt,t.XRJointSpace=li,t.XRView=pa,t.XRViewport=kn,t.XRRigidTransform=nr,t.XRPose=tr,t.XRViewerPose=ga,t.XRJointPose=ma,t.XRInputSource=er,t.XRInputSourceArray=m0,t.XRHand=oi,t.XRLayer=wa,t.XRWebGLLayer=k0,t.XRSessionEvent=Xn,t.XRInputSourceEvent=Ln,t.XRInputSourcesChangeEvent=va,t.XRReferenceSpaceEvent=Ji}get supportedSessionModes(){return this[S].supportedSessionModes}get supportedFeatures(){return this[S].supportedFeatures}get supportedFrameRates(){return this[S].supportedFrameRates}get isSystemKeyboardSupported(){return this[S].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[S].internalNominalFrameRate}get stereoEnabled(){return this[S].stereoEnabled}set stereoEnabled(t){this[S].stereoEnabled=t}get ipd(){return this[S].ipd}set ipd(t){this[S].ipd=t}get fovy(){return this[S].fovy}set fovy(t){this[S].fovy=t}get position(){return this[S].position}get quaternion(){return this[S].quaternion}get viewerSpace(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewerSpace:this[S].viewerSpace}get viewSpaces(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.viewSpaces:this[S].viewSpaces}get controllers(){return this[S].controllers}get hands(){return this[S].hands}get primaryInputMode(){return this[S].primaryInputMode}set primaryInputMode(t){if(t!=="controller"&&t!=="hand"){console.warn('primary input mode can only be "controller" or "hand"');return}this[S].primaryInputMode=t}get activeInputs(){return this[S].visibilityState!==Et.Visible?[]:(this[S].primaryInputMode==="controller"?Object.values(this[S].controllers):Object.values(this[S].hands)).filter(n=>n.connected)}get inputSources(){var t;return!((t=this[S].actionPlayer)===null||t===void 0)&&t.playing?this[S].actionPlayer.inputSources:this.activeInputs.map(n=>n.inputSource)}get canvasContainer(){return this[S].canvasContainer}get activeSession(){var t;return(t=this[S].xrSystem)===null||t===void 0?void 0:t[Je].activeSession}recenter(){const t=new He(-this.position.x,0,-this.position.z),n=new He(0,0,-1).applyQuaternion(this.quaternion);n.y=0,n.normalize();const r=Math.atan2(n.x,-n.z),i=new ht().setFromAxisAngle(new He(0,1,0),r);this.position.add(t),this.quaternion.multiply(i),[...Object.values(this[S].controllers),...Object.values(this[S].hands)].forEach(a=>{a.position.add(t),a.quaternion.multiply(i),a.position.applyQuaternion(i)}),this[S].pendingReferenceSpaceReset=!0}get visibilityState(){return this[S].visibilityState}updateVisibilityState(t){if(!Object.values(Et).includes(t))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");t!==this[S].visibilityState&&(this[S].pendingVisibilityState=t)}createActionPlayer(t,n){return this[S].actionPlayer=new E0(t,n,this[S].ipd),this[S].actionPlayer}}const rr={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ir={mapping:on.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},I0={profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,4673031295254759e-24,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,3688163374704345e-23,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},R0={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,20823669899527886e-24,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-8329467959811154e-23,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},O0={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,-15779937356796836e-24,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},L0={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rr,gripOffsetMatrix:[.9925461411476135,10736208366779465e-24,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ir,gripOffsetMatrix:[.9925461411476135,-26238110351073374e-24,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},T0={name:"Oculus Quest 1",controllerConfig:I0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},j0={name:"Meta Quest 2",controllerConfig:R0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},_0={name:"Meta Quest Pro",controllerConfig:O0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},C0={name:"Meta Quest 3",controllerConfig:L0,supportedSessionModes:[J.Inline,J.ImmersiveVR,J.ImmersiveAR],supportedFeatures:[L.Viewer,L.Local,L.LocalFloor,L.BoundedFloor,L.Unbounded,L.Anchors,L.PlaneDetection,L.MeshDetection,L.HitTest,L.HandTracking,L.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},es=()=>{};let fi={},ba={},Sa=null,Ma={mark:es,measure:es};try{typeof window<"u"&&(fi=window),typeof document<"u"&&(ba=document),typeof MutationObserver<"u"&&(Sa=MutationObserver),typeof performance<"u"&&(Ma=performance)}catch{}const{userAgent:ts=""}=fi.navigator||{},rt=fi,Z=ba,ns=Sa,En=Ma;rt.document;const Be=!!Z.documentElement&&!!Z.head&&typeof Z.addEventListener=="function"&&typeof Z.createElement=="function",ka=~ts.indexOf("MSIE")||~ts.indexOf("Trident/");var W="classic",Ea="duotone",Se="sharp",Me="sharp-duotone",F0=[W,Ea,Se,Me],z0={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},rs={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},N0=["kit"],D0=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,$0=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,V0={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},q0={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},H0={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},Z0={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},X0={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},B0={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Pa={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},Y0=["solid","regular","light","thin","duotone","brands"],Aa=[1,2,3,4,5,6,7,8,9,10],W0=Aa.concat([11,12,13,14,15,16,17,18,19,20]),Qt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Q0=[...Object.keys(Z0),...Y0,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Qt.GROUP,Qt.SWAP_OPACITY,Qt.PRIMARY,Qt.SECONDARY].concat(Aa.map(e=>"".concat(e,"x"))).concat(W0.map(e=>"w-".concat(e))),G0={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},U0={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},K0={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},is={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const Ze="___FONT_AWESOME___",Cr=16,Ia="fa",Ra="svg-inline--fa",bt="data-fa-i2svg",Fr="data-fa-pseudo-element",J0="data-fa-pseudo-element-pending",ui="data-prefix",di="data-icon",ss="fontawesome-i2svg",e1="async",t1=["HTML","HEAD","STYLE","SCRIPT"],Oa=(()=>{try{return!0}catch{return!1}})(),La=[W,Se,Me];function mn(e){return new Proxy(e,{get(t,n){return n in t?t[n]:t[W]}})}const Ta={...Pa};Ta[W]={...Pa[W],...rs.kit,...rs["kit-duotone"]};const mt=mn(Ta),zr={...B0};zr[W]={...zr[W],...is.kit,...is["kit-duotone"]};const cn=mn(zr),Nr={...X0};Nr[W]={...Nr[W],...K0.kit};const gt=mn(Nr),Dr={...H0};Dr[W]={...Dr[W],...U0.kit};const n1=mn(Dr),r1=D0,ja="fa-layers-text",i1=$0,s1={...z0};mn(s1);const a1=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],xr=Qt,Ot=new Set;Object.keys(cn[W]).map(Ot.add.bind(Ot));Object.keys(cn[Se]).map(Ot.add.bind(Ot));Object.keys(cn[Me]).map(Ot.add.bind(Ot));const o1=[...N0,...Q0],tn=rt.FontAwesomeConfig||{};function l1(e){var t=Z.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function c1(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}Z&&typeof Z.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(t=>{let[n,r]=t;const i=c1(l1(n));i!=null&&(tn[r]=i)});const _a={styleDefault:"solid",familyDefault:"classic",cssPrefix:Ia,replacementClass:Ra,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};tn.familyPrefix&&(tn.cssPrefix=tn.familyPrefix);const Lt={..._a,...tn};Lt.autoReplaceSvg||(Lt.observeMutations=!1);const P={};Object.keys(_a).forEach(e=>{Object.defineProperty(P,e,{enumerable:!0,set:function(t){Lt[e]=t,nn.forEach(n=>n(P))},get:function(){return Lt[e]}})});Object.defineProperty(P,"familyPrefix",{enumerable:!0,set:function(e){Lt.cssPrefix=e,nn.forEach(t=>t(P))},get:function(){return Lt.cssPrefix}});rt.FontAwesomeConfig=P;const nn=[];function f1(e){return nn.push(e),()=>{nn.splice(nn.indexOf(e),1)}}const Ge=Cr,ze={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function u1(e){if(!e||!Be)return;const t=Z.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Z.head.childNodes;let r=null;for(let i=n.length-1;i>-1;i--){const a=n[i],s=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=a)}return Z.head.insertBefore(t,r),e}const d1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fn(){let e=12,t="";for(;e-- >0;)t+=d1[Math.random()*62|0];return t}function Nt(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function hi(e){return e.classList?Nt(e.classList):(e.getAttribute("class")||"").split(" ").filter(t=>t)}function Ca(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function h1(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,'="').concat(Ca(e[n]),'" '),"").trim()}function sr(e){return Object.keys(e||{}).reduce((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";"),"")}function pi(e){return e.size!==ze.size||e.x!==ze.x||e.y!==ze.y||e.rotate!==ze.rotate||e.flipX||e.flipY}function p1(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)"),l={transform:"".concat(a," ").concat(s," ").concat(o)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:l,path:c}}function m1(e){let{transform:t,width:n=Cr,height:r=Cr,startCentered:i=!1}=e,a="";return i&&ka?a+="translate(".concat(t.x/Ge-n/2,"em, ").concat(t.y/Ge-r/2,"em) "):i?a+="translate(calc(-50% + ".concat(t.x/Ge,"em), calc(-50% + ").concat(t.y/Ge,"em)) "):a+="translate(".concat(t.x/Ge,"em, ").concat(t.y/Ge,"em) "),a+="scale(".concat(t.size/Ge*(t.flipX?-1:1),", ").concat(t.size/Ge*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}var g1=`:root, :host { - --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; - --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; - --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; - --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; - --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; - --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; - --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; -} - -svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { - overflow: visible; - box-sizing: content-box; -} - -.svg-inline--fa { - display: var(--fa-display, inline-block); - height: 1em; - overflow: visible; - vertical-align: -0.125em; -} -.svg-inline--fa.fa-2xs { - vertical-align: 0.1em; -} -.svg-inline--fa.fa-xs { - vertical-align: 0em; -} -.svg-inline--fa.fa-sm { - vertical-align: -0.0714285705em; -} -.svg-inline--fa.fa-lg { - vertical-align: -0.2em; -} -.svg-inline--fa.fa-xl { - vertical-align: -0.25em; -} -.svg-inline--fa.fa-2xl { - vertical-align: -0.3125em; -} -.svg-inline--fa.fa-pull-left { - margin-right: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-pull-right { - margin-left: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-li { - width: var(--fa-li-width, 2em); - top: 0.25em; -} -.svg-inline--fa.fa-fw { - width: var(--fa-fw-width, 1.25em); -} - -.fa-layers svg.svg-inline--fa { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; -} - -.fa-layers-counter, .fa-layers-text { - display: inline-block; - position: absolute; - text-align: center; -} - -.fa-layers { - display: inline-block; - height: 1em; - position: relative; - text-align: center; - vertical-align: -0.125em; - width: 1em; -} -.fa-layers svg.svg-inline--fa { - transform-origin: center center; -} - -.fa-layers-text { - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - transform-origin: center center; -} - -.fa-layers-counter { - background-color: var(--fa-counter-background-color, #ff253a); - border-radius: var(--fa-counter-border-radius, 1em); - box-sizing: border-box; - color: var(--fa-inverse, #fff); - line-height: var(--fa-counter-line-height, 1); - max-width: var(--fa-counter-max-width, 5em); - min-width: var(--fa-counter-min-width, 1.5em); - overflow: hidden; - padding: var(--fa-counter-padding, 0.25em 0.5em); - right: var(--fa-right, 0); - text-overflow: ellipsis; - top: var(--fa-top, 0); - transform: scale(var(--fa-counter-scale, 0.25)); - transform-origin: top right; -} - -.fa-layers-bottom-right { - bottom: var(--fa-bottom, 0); - right: var(--fa-right, 0); - top: auto; - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: bottom right; -} - -.fa-layers-bottom-left { - bottom: var(--fa-bottom, 0); - left: var(--fa-left, 0); - right: auto; - top: auto; - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: bottom left; -} - -.fa-layers-top-right { - top: var(--fa-top, 0); - right: var(--fa-right, 0); - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: top right; -} - -.fa-layers-top-left { - left: var(--fa-left, 0); - right: auto; - top: var(--fa-top, 0); - transform: scale(var(--fa-layers-scale, 0.25)); - transform-origin: top left; -} - -.fa-1x { - font-size: 1em; -} - -.fa-2x { - font-size: 2em; -} - -.fa-3x { - font-size: 3em; -} - -.fa-4x { - font-size: 4em; -} - -.fa-5x { - font-size: 5em; -} - -.fa-6x { - font-size: 6em; -} - -.fa-7x { - font-size: 7em; -} - -.fa-8x { - font-size: 8em; -} - -.fa-9x { - font-size: 9em; -} - -.fa-10x { - font-size: 10em; -} - -.fa-2xs { - font-size: 0.625em; - line-height: 0.1em; - vertical-align: 0.225em; -} - -.fa-xs { - font-size: 0.75em; - line-height: 0.0833333337em; - vertical-align: 0.125em; -} - -.fa-sm { - font-size: 0.875em; - line-height: 0.0714285718em; - vertical-align: 0.0535714295em; -} - -.fa-lg { - font-size: 1.25em; - line-height: 0.05em; - vertical-align: -0.075em; -} - -.fa-xl { - font-size: 1.5em; - line-height: 0.0416666682em; - vertical-align: -0.125em; -} - -.fa-2xl { - font-size: 2em; - line-height: 0.03125em; - vertical-align: -0.1875em; -} - -.fa-fw { - text-align: center; - width: 1.25em; -} - -.fa-ul { - list-style-type: none; - margin-left: var(--fa-li-margin, 2.5em); - padding-left: 0; -} -.fa-ul > li { - position: relative; -} - -.fa-li { - left: calc(-1 * var(--fa-li-width, 2em)); - position: absolute; - text-align: center; - width: var(--fa-li-width, 2em); - line-height: inherit; -} - -.fa-border { - border-color: var(--fa-border-color, #eee); - border-radius: var(--fa-border-radius, 0.1em); - border-style: var(--fa-border-style, solid); - border-width: var(--fa-border-width, 0.08em); - padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); -} - -.fa-pull-left { - float: left; - margin-right: var(--fa-pull-margin, 0.3em); -} - -.fa-pull-right { - float: right; - margin-left: var(--fa-pull-margin, 0.3em); -} - -.fa-beat { - animation-name: fa-beat; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-bounce { - animation-name: fa-bounce; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); -} - -.fa-fade { - animation-name: fa-fade; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-beat-fade { - animation-name: fa-beat-fade; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-flip { - animation-name: fa-flip; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-shake { - animation-name: fa-shake; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin { - animation-name: fa-spin; - animation-delay: var(--fa-animation-delay, 0s); - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 2s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin-reverse { - --fa-animation-direction: reverse; -} - -.fa-pulse, -.fa-spin-pulse { - animation-name: fa-spin; - animation-direction: var(--fa-animation-direction, normal); - animation-duration: var(--fa-animation-duration, 1s); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-timing-function: var(--fa-animation-timing, steps(8)); -} - -@media (prefers-reduced-motion: reduce) { - .fa-beat, -.fa-bounce, -.fa-fade, -.fa-beat-fade, -.fa-flip, -.fa-pulse, -.fa-shake, -.fa-spin, -.fa-spin-pulse { - animation-delay: -1ms; - animation-duration: 1ms; - animation-iteration-count: 1; - transition-delay: 0s; - transition-duration: 0s; - } -} -@keyframes fa-beat { - 0%, 90% { - transform: scale(1); - } - 45% { - transform: scale(var(--fa-beat-scale, 1.25)); - } -} -@keyframes fa-bounce { - 0% { - transform: scale(1, 1) translateY(0); - } - 10% { - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - } - 30% { - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - } - 50% { - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - } - 57% { - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - } - 64% { - transform: scale(1, 1) translateY(0); - } - 100% { - transform: scale(1, 1) translateY(0); - } -} -@keyframes fa-fade { - 50% { - opacity: var(--fa-fade-opacity, 0.4); - } -} -@keyframes fa-beat-fade { - 0%, 100% { - opacity: var(--fa-beat-fade-opacity, 0.4); - transform: scale(1); - } - 50% { - opacity: 1; - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} -@keyframes fa-flip { - 50% { - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - } -} -@keyframes fa-shake { - 0% { - transform: rotate(-15deg); - } - 4% { - transform: rotate(15deg); - } - 8%, 24% { - transform: rotate(-18deg); - } - 12%, 28% { - transform: rotate(18deg); - } - 16% { - transform: rotate(-22deg); - } - 20% { - transform: rotate(22deg); - } - 32% { - transform: rotate(-12deg); - } - 36% { - transform: rotate(12deg); - } - 40%, 100% { - transform: rotate(0deg); - } -} -@keyframes fa-spin { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} -.fa-rotate-90 { - transform: rotate(90deg); -} - -.fa-rotate-180 { - transform: rotate(180deg); -} - -.fa-rotate-270 { - transform: rotate(270deg); -} - -.fa-flip-horizontal { - transform: scale(-1, 1); -} - -.fa-flip-vertical { - transform: scale(1, -1); -} - -.fa-flip-both, -.fa-flip-horizontal.fa-flip-vertical { - transform: scale(-1, -1); -} - -.fa-rotate-by { - transform: rotate(var(--fa-rotate-angle, 0)); -} - -.fa-stack { - display: inline-block; - vertical-align: middle; - height: 2em; - position: relative; - width: 2.5em; -} - -.fa-stack-1x, -.fa-stack-2x { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; - z-index: var(--fa-stack-z-index, auto); -} - -.svg-inline--fa.fa-stack-1x { - height: 1em; - width: 1.25em; -} -.svg-inline--fa.fa-stack-2x { - height: 2em; - width: 2.5em; -} - -.fa-inverse { - color: var(--fa-inverse, #fff); -} - -.sr-only, -.fa-sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.sr-only-focusable:not(:focus), -.fa-sr-only-focusable:not(:focus) { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.svg-inline--fa .fa-primary { - fill: var(--fa-primary-color, currentColor); - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa .fa-secondary { - fill: var(--fa-secondary-color, currentColor); - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-primary { - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-secondary { - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa mask .fa-primary, -.svg-inline--fa mask .fa-secondary { - fill: black; -} - -.fad.fa-inverse, -.fa-duotone.fa-inverse { - color: var(--fa-inverse, #fff); -}`;function Fa(){const e=Ia,t=Ra,n=P.cssPrefix,r=P.replacementClass;let i=g1;if(n!==e||r!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(o,".".concat(r))}return i}let as=!1;function wr(){P.autoAddCss&&!as&&(u1(Fa()),as=!0)}var y1={mixout(){return{dom:{css:Fa,insertCss:wr}}},hooks(){return{beforeDOMElementCreation(){wr()},beforeI2svg(){wr()}}}};const Xe=rt||{};Xe[Ze]||(Xe[Ze]={});Xe[Ze].styles||(Xe[Ze].styles={});Xe[Ze].hooks||(Xe[Ze].hooks={});Xe[Ze].shims||(Xe[Ze].shims=[]);var Ne=Xe[Ze];const za=[],Na=function(){Z.removeEventListener("DOMContentLoaded",Na),Bn=1,za.map(e=>e())};let Bn=!1;Be&&(Bn=(Z.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Z.readyState),Bn||Z.addEventListener("DOMContentLoaded",Na));function v1(e){Be&&(Bn?setTimeout(e,0):za.push(e))}function gn(e){const{tag:t,attributes:n={},children:r=[]}=e;return typeof e=="string"?Ca(e):"<".concat(t," ").concat(h1(n),">").concat(r.map(gn).join(""),"")}function os(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var br=function(t,n,r,i){var a=Object.keys(t),s=a.length,o=n,l,c,u;for(r===void 0?(l=1,u=t[a[0]]):(l=0,u=r);l=55296&&i<=56319&&n=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function ls(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return!!r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function Vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:r=!1}=n,i=ls(t);typeof Ne.hooks.addPack=="function"&&!r?Ne.hooks.addPack(e,ls(t)):Ne.styles[e]={...Ne.styles[e]||{},...i},e==="fas"&&Vr("fa",t)}const{styles:ut,shims:b1}=Ne,S1={[W]:Object.values(gt[W]),[Se]:Object.values(gt[Se]),[Me]:Object.values(gt[Me])};let mi=null,Da={},$a={},Va={},qa={},Ha={};const M1={[W]:Object.keys(mt[W]),[Se]:Object.keys(mt[Se]),[Me]:Object.keys(mt[Me])};function k1(e){return~o1.indexOf(e)}function E1(e,t){const n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!k1(i)?i:null}const Za=()=>{const e=r=>br(ut,(i,a,s)=>(i[s]=br(a,r,{}),i),{});Da=e((r,i,a)=>(i[3]&&(r[i[3]]=a),i[2]&&i[2].filter(o=>typeof o=="number").forEach(o=>{r[o.toString(16)]=a}),r)),$a=e((r,i,a)=>(r[a]=a,i[2]&&i[2].filter(o=>typeof o=="string").forEach(o=>{r[o]=a}),r)),Ha=e((r,i,a)=>{const s=i[2];return r[a]=a,s.forEach(o=>{r[o]=a}),r});const t="far"in ut||P.autoFetchSvg,n=br(b1,(r,i)=>{const a=i[0];let s=i[1];const o=i[2];return s==="far"&&!t&&(s="fas"),typeof a=="string"&&(r.names[a]={prefix:s,iconName:o}),typeof a=="number"&&(r.unicodes[a.toString(16)]={prefix:s,iconName:o}),r},{names:{},unicodes:{}});Va=n.names,qa=n.unicodes,mi=ar(P.styleDefault,{family:P.familyDefault})};f1(e=>{mi=ar(e.styleDefault,{family:P.familyDefault})});Za();function gi(e,t){return(Da[e]||{})[t]}function P1(e,t){return($a[e]||{})[t]}function nt(e,t){return(Ha[e]||{})[t]}function Xa(e){return Va[e]||{prefix:null,iconName:null}}function A1(e){const t=qa[e],n=gi("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function it(){return mi}const yi=()=>({prefix:null,iconName:null,rest:[]});function ar(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=W}=t,r=mt[n][e],i=cn[n][e]||cn[n][r],a=e in Ne.styles?e:null;return i||a||null}const I1={[W]:Object.keys(gt[W]),[Se]:Object.keys(gt[Se]),[Me]:Object.keys(gt[Me])};function or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=t,r={[W]:"".concat(P.cssPrefix,"-").concat(W),[Se]:"".concat(P.cssPrefix,"-").concat(Se),[Me]:"".concat(P.cssPrefix,"-").concat(Me)};let i=null,a=W;const s=F0.filter(l=>l!==Ea);s.forEach(l=>{(e.includes(r[l])||e.some(c=>I1[l].includes(c)))&&(a=l)});const o=e.reduce((l,c)=>{const u=E1(P.cssPrefix,c);if(ut[c]?(c=S1[a].includes(c)?n1[a][c]:c,i=c,l.prefix=c):M1[a].indexOf(c)>-1?(i=c,l.prefix=ar(c,{family:a})):u?l.iconName=u:c!==P.replacementClass&&!s.some(h=>c===r[h])&&l.rest.push(c),!n&&l.prefix&&l.iconName){const h=i==="fa"?Xa(l.iconName):{},p=nt(l.prefix,l.iconName);h.prefix&&(i=null),l.iconName=h.iconName||p||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!ut.far&&ut.fas&&!P.autoFetchSvg&&(l.prefix="fas")}return l},yi());return(e.includes("fa-brands")||e.includes("fab"))&&(o.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(o.prefix="fad"),!o.prefix&&a===Se&&(ut.fass||P.autoFetchSvg)&&(o.prefix="fass",o.iconName=nt(o.prefix,o.iconName)||o.iconName),!o.prefix&&a===Me&&(ut.fasds||P.autoFetchSvg)&&(o.prefix="fasds",o.iconName=nt(o.prefix,o.iconName)||o.iconName),(o.prefix==="fa"||i==="fa")&&(o.prefix=it()||"fas"),o}class R1{constructor(){this.definitions={}}add(){for(var t=arguments.length,n=new Array(t),r=0;r{this.definitions[a]={...this.definitions[a]||{},...i[a]},Vr(a,i[a]);const s=gt[W][a];s&&Vr(s,i[a]),Za()})}reset(){this.definitions={}}_pullDefinitions(t,n){const r=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(r).map(i=>{const{prefix:a,iconName:s,icon:o}=r[i],l=o[2];t[a]||(t[a]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(t[a][c]=o)}),t[a][s]=o}),t}}let cs=[],Pt={};const Rt={},O1=Object.keys(Rt);function L1(e,t){let{mixoutsTo:n}=t;return cs=e,Pt={},Object.keys(Rt).forEach(r=>{O1.indexOf(r)===-1&&delete Rt[r]}),cs.forEach(r=>{const i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(a=>{typeof i[a]=="function"&&(n[a]=i[a]),typeof i[a]=="object"&&Object.keys(i[a]).forEach(s=>{n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){const a=r.hooks();Object.keys(a).forEach(s=>{Pt[s]||(Pt[s]=[]),Pt[s].push(a[s])})}r.provides&&r.provides(Rt)}),n}function qr(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i{t=s.apply(null,[t,...r])}),t}function St(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{a.apply(null,n)})}function st(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Rt[e]?Rt[e].apply(null,t):void 0}function Hr(e){e.prefix==="fa"&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||it();if(t)return t=nt(n,t)||t,os(Ba.definitions,n,t)||os(Ne.styles,n,t)}const Ba=new R1,T1=()=>{P.autoReplaceSvg=!1,P.observeMutations=!1,St("noAuto")},j1={i2svg:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Be?(St("beforeI2svg",e),st("pseudoElements2svg",e),st("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;P.autoReplaceSvg===!1&&(P.autoReplaceSvg=!0),P.observeMutations=!0,v1(()=>{C1({autoReplaceSvgRoot:t}),St("watch",e)})}},_1={icon:e=>{if(e===null)return null;if(typeof e=="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:nt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){const t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],n=ar(e[0]);return{prefix:n,iconName:nt(n,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(P.cssPrefix,"-"))>-1||e.match(r1))){const t=or(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||it(),iconName:nt(t.prefix,t.iconName)||t.iconName}}if(typeof e=="string"){const t=it();return{prefix:t,iconName:nt(t,e)||e}}}},Ee={noAuto:T1,config:P,dom:j1,parse:_1,library:Ba,findIconDefinition:Hr,toHtml:gn},C1=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:t=Z}=e;(Object.keys(Ne.styles).length>0||P.autoFetchSvg)&&Be&&P.autoReplaceSvg&&Ee.dom.i2svg({node:t})};function lr(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(n=>gn(n))}}),Object.defineProperty(e,"node",{get:function(){if(!Be)return;const n=Z.createElement("div");return n.innerHTML=e.html,n.children}}),e}function F1(e){let{children:t,main:n,mask:r,attributes:i,styles:a,transform:s}=e;if(pi(s)&&n.found&&!r.found){const{width:o,height:l}=n,c={x:o/l/2,y:.5};i.style=sr({...a,"transform-origin":"".concat(c.x+s.x/16,"em ").concat(c.y+s.y/16,"em")})}return[{tag:"svg",attributes:i,children:t}]}function z1(e){let{prefix:t,iconName:n,children:r,attributes:i,symbol:a}=e;const s=a===!0?"".concat(t,"-").concat(P.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:s},children:r}]}]}function vi(e){const{icons:{main:t,mask:n},prefix:r,iconName:i,transform:a,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:p,height:g}=n.found?n:t,x=r==="fak",v=[P.replacementClass,i?"".concat(P.cssPrefix,"-").concat(i):""].filter(k=>u.classes.indexOf(k)===-1).filter(k=>k!==""||!!k).concat(u.classes).join(" ");let d={children:[],attributes:{...u.attributes,"data-prefix":r,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(g)}};const y=x&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/g*16*.0625,"em")}:{};h&&(d.attributes[bt]=""),o&&(d.children.push({tag:"title",attributes:{id:d.attributes["aria-labelledby"]||"title-".concat(c||fn())},children:[o]}),delete d.attributes.title);const b={...d,prefix:r,iconName:i,main:t,mask:n,maskId:l,transform:a,symbol:s,styles:{...y,...u.styles}},{children:w,attributes:M}=n.found&&t.found?st("generateAbstractMask",b)||{children:[],attributes:{}}:st("generateAbstractIcon",b)||{children:[],attributes:{}};return b.children=w,b.attributes=M,s?z1(b):F1(b)}function fs(e){const{content:t,width:n,height:r,transform:i,title:a,extra:s,watchable:o=!1}=e,l={...s.attributes,...a?{title:a}:{},class:s.classes.join(" ")};o&&(l[bt]="");const c={...s.styles};pi(i)&&(c.transform=m1({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);const u=sr(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function N1(e){const{content:t,title:n,extra:r}=e,i={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},a=sr(r.styles);a.length>0&&(i.style=a);const s=[];return s.push({tag:"span",attributes:i,children:[t]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}const{styles:Sr}=Ne;function Zr(e){const t=e[0],n=e[1],[r]=e.slice(4);let i=null;return Array.isArray(r)?i={tag:"g",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.GROUP)},children:[{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(P.cssPrefix,"-").concat(xr.PRIMARY),fill:"currentColor",d:r[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:t,height:n,icon:i}}const D1={found:!1,width:512,height:512};function $1(e,t){!Oa&&!P.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Xr(e,t){let n=t;return t==="fa"&&P.styleDefault!==null&&(t=it()),new Promise((r,i)=>{if(n==="fa"){const a=Xa(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&Sr[t]&&Sr[t][e]){const a=Sr[t][e];return r(Zr(a))}$1(e,t),r({...D1,icon:P.showMissingIcons&&e?st("missingIconAbstract")||{}:{}})})}const us=()=>{},Br=P.measurePerformance&&En&&En.mark&&En.measure?En:{mark:us,measure:us},Gt='FA "6.6.0"',V1=e=>(Br.mark("".concat(Gt," ").concat(e," begins")),()=>Ya(e)),Ya=e=>{Br.mark("".concat(Gt," ").concat(e," ends")),Br.measure("".concat(Gt," ").concat(e),"".concat(Gt," ").concat(e," begins"),"".concat(Gt," ").concat(e," ends"))};var xi={begin:V1,end:Ya};const Tn=()=>{};function ds(e){return typeof(e.getAttribute?e.getAttribute(bt):null)=="string"}function q1(e){const t=e.getAttribute?e.getAttribute(ui):null,n=e.getAttribute?e.getAttribute(di):null;return t&&n}function H1(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(P.replacementClass)}function Z1(){return P.autoReplaceSvg===!0?jn.replace:jn[P.autoReplaceSvg]||jn.replace}function X1(e){return Z.createElementNS("http://www.w3.org/2000/svg",e)}function B1(e){return Z.createElement(e)}function Wa(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=e.tag==="svg"?X1:B1}=t;if(typeof e=="string")return Z.createTextNode(e);const r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(a){r.setAttribute(a,e.attributes[a])}),(e.children||[]).forEach(function(a){r.appendChild(Wa(a,{ceFn:n}))}),r}function Y1(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}const jn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(n=>{t.parentNode.insertBefore(Wa(n),t)}),t.getAttribute(bt)===null&&P.keepOriginalSource){let n=Z.createComment(Y1(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~hi(t).indexOf(P.replacementClass))return jn.replace(e);const r=new RegExp("".concat(P.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const a=n[0].attributes.class.split(" ").reduce((s,o)=>(o===P.replacementClass||o.match(r)?s.toSvg.push(o):s.toNode.push(o),s),{toNode:[],toSvg:[]});n[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",a.toNode.join(" "))}const i=n.map(a=>gn(a)).join(` -`);t.setAttribute(bt,""),t.innerHTML=i}};function hs(e){e()}function Qa(e,t){const n=typeof t=="function"?t:Tn;if(e.length===0)n();else{let r=hs;P.mutateApproach===e1&&(r=rt.requestAnimationFrame||hs),r(()=>{const i=Z1(),a=xi.begin("mutate");e.map(i),a(),n()})}}let wi=!1;function Ga(){wi=!0}function Yr(){wi=!1}let Yn=null;function ps(e){if(!ns||!P.observeMutations)return;const{treeCallback:t=Tn,nodeCallback:n=Tn,pseudoElementsCallback:r=Tn,observeMutationsRoot:i=Z}=e;Yn=new ns(a=>{if(wi)return;const s=it();Nt(a).forEach(o=>{if(o.type==="childList"&&o.addedNodes.length>0&&!ds(o.addedNodes[0])&&(P.searchPseudoElements&&r(o.target),t(o.target)),o.type==="attributes"&&o.target.parentNode&&P.searchPseudoElements&&r(o.target.parentNode),o.type==="attributes"&&ds(o.target)&&~a1.indexOf(o.attributeName))if(o.attributeName==="class"&&q1(o.target)){const{prefix:l,iconName:c}=or(hi(o.target));o.target.setAttribute(ui,l||s),c&&o.target.setAttribute(di,c)}else H1(o.target)&&n(o.target)})}),Be&&Yn.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function W1(){Yn&&Yn.disconnect()}function Q1(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce((r,i)=>{const a=i.split(":"),s=a[0],o=a.slice(1);return s&&o.length>0&&(r[s]=o.join(":").trim()),r},{})),n}function G1(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"";let i=or(hi(e));return i.prefix||(i.prefix=it()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=P1(i.prefix,e.innerText)||gi(i.prefix,$r(e.innerText))),!i.iconName&&P.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function U1(e){const t=Nt(e.attributes).reduce((i,a)=>(i.name!=="class"&&i.name!=="style"&&(i[a.name]=a.value),i),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return P.autoA11y&&(n?t["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(r||fn()):(t["aria-hidden"]="true",t.focusable="false")),t}function K1(){return{iconName:null,title:null,titleId:null,prefix:null,transform:ze,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:i}=G1(e),a=U1(e),s=qr("parseNodeAttributes",{},e);let o=t.styleParser?Q1(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:r,transform:ze,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:o,attributes:a},...s}}const{styles:J1}=Ne;function Ua(e){const t=P.autoReplaceSvg==="nest"?ms(e,{styleParser:!1}):ms(e);return~t.extra.classes.indexOf(ja)?st("generateLayersText",e,t):st("generateSvgReplacementMutation",e,t)}let De=new Set;La.map(e=>{De.add("fa-".concat(e))});Object.keys(mt[W]).map(De.add.bind(De));Object.keys(mt[Se]).map(De.add.bind(De));Object.keys(mt[Me]).map(De.add.bind(De));De=[...De];function gs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Be)return Promise.resolve();const n=Z.documentElement.classList,r=u=>n.add("".concat(ss,"-").concat(u)),i=u=>n.remove("".concat(ss,"-").concat(u)),a=P.autoFetchSvg?De:La.map(u=>"fa-".concat(u)).concat(Object.keys(J1));a.includes("fa")||a.push("fa");const s=[".".concat(ja,":not([").concat(bt,"])")].concat(a.map(u=>".".concat(u,":not([").concat(bt,"])"))).join(", ");if(s.length===0)return Promise.resolve();let o=[];try{o=Nt(e.querySelectorAll(s))}catch{}if(o.length>0)r("pending"),i("complete");else return Promise.resolve();const l=xi.begin("onTree"),c=o.reduce((u,h)=>{try{const p=Ua(h);p&&u.push(p)}catch(p){Oa||p.name==="MissingIcon"&&console.error(p)}return u},[]);return new Promise((u,h)=>{Promise.all(c).then(p=>{Qa(p,()=>{r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),l(),u()})}).catch(p=>{l(),h(p)})})}function el(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ua(e).then(n=>{n&&Qa([n],t)})}function tl(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(t||{}).icon?t:Hr(t||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:Hr(i||{})),e(r,{...n,mask:i})}}const nl=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,symbol:r=!1,mask:i=null,maskId:a=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:p,icon:g}=e;return lr({type:"icon",...e},()=>(St("beforeDOMElementCreation",{iconDefinition:e,params:t}),P.autoA11y&&(s?c["aria-labelledby"]="".concat(P.replacementClass,"-title-").concat(o||fn()):(c["aria-hidden"]="true",c.focusable="false")),vi({icons:{main:Zr(g),mask:i?Zr(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:p,transform:{...ze,...n},symbol:r,title:s,maskId:a,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var rl={mixout(){return{icon:tl(nl)}},hooks(){return{mutationObserverCallbacks(e){return e.treeCallback=gs,e.nodeCallback=el,e}}},provides(e){e.i2svg=function(t){const{node:n=Z,callback:r=()=>{}}=t;return gs(n,r)},e.generateSvgReplacementMutation=function(t,n){const{iconName:r,title:i,titleId:a,prefix:s,transform:o,symbol:l,mask:c,maskId:u,extra:h}=n;return new Promise((p,g)=>{Promise.all([Xr(r,s),c.iconName?Xr(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(x=>{let[v,d]=x;p([t,vi({icons:{main:v,mask:d},prefix:s,iconName:r,transform:o,symbol:l,maskId:u,title:i,titleId:a,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){let{children:n,attributes:r,main:i,transform:a,styles:s}=t;const o=sr(s);o.length>0&&(r.style=o);let l;return pi(a)&&(l=st("generateAbstractTransformGrouping",{main:i,transform:a,containerWidth:i.width,iconWidth:i.width})),n.push(l||i.icon),{children:n,attributes:r}}}},il={mixout(){return{layer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=t;return lr({type:"layer"},()=>{St("beforeDOMElementCreation",{assembler:e,params:t});let r=[];return e(i=>{Array.isArray(i)?i.map(a=>{r=r.concat(a.abstract)}):r=r.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(P.cssPrefix,"-layers"),...n].join(" ")},children:r}]})}}}},sl={mixout(){return{counter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:r=[],attributes:i={},styles:a={}}=t;return lr({type:"counter",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),N1({content:e.toString(),title:n,extra:{attributes:i,styles:a,classes:["".concat(P.cssPrefix,"-layers-counter"),...r]}})))}}}},al={mixout(){return{text(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=ze,title:r=null,classes:i=[],attributes:a={},styles:s={}}=t;return lr({type:"text",content:e},()=>(St("beforeDOMElementCreation",{content:e,params:t}),fs({content:e,transform:{...ze,...n},title:r,extra:{attributes:a,styles:s,classes:["".concat(P.cssPrefix,"-layers-text"),...i]}})))}}},provides(e){e.generateLayersText=function(t,n){const{title:r,transform:i,extra:a}=n;let s=null,o=null;if(ka){const l=parseInt(getComputedStyle(t).fontSize,10),c=t.getBoundingClientRect();s=c.width/l,o=c.height/l}return P.autoA11y&&!r&&(a.attributes["aria-hidden"]="true"),Promise.resolve([t,fs({content:t.innerHTML,width:s,height:o,transform:i,title:r,extra:a,watchable:!0})])}}};const ol=new RegExp('"',"ug"),ys=[1105920,1112319],vs={FontAwesome:{normal:"fas",400:"fas"},...q0,...V0,...G0},Wr=Object.keys(vs).reduce((e,t)=>(e[t.toLowerCase()]=vs[t],e),{}),ll=Object.keys(Wr).reduce((e,t)=>{const n=Wr[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e},{});function cl(e){const t=e.replace(ol,""),n=w1(t,0),r=n>=ys[0]&&n<=ys[1],i=t.length===2?t[0]===t[1]:!1;return{value:$r(i?t[0]:t),isSecondary:r||i}}function fl(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),i=isNaN(r)?"normal":r;return(Wr[n]||{})[i]||ll[n]}function xs(e,t){const n="".concat(J0).concat(t.replace(":","-"));return new Promise((r,i)=>{if(e.getAttribute(n)!==null)return r();const s=Nt(e.children).filter(p=>p.getAttribute(Fr)===t)[0],o=rt.getComputedStyle(e,t),l=o.getPropertyValue("font-family"),c=l.match(i1),u=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!c)return e.removeChild(s),r();if(c&&h!=="none"&&h!==""){const p=o.getPropertyValue("content");let g=fl(l,u);const{value:x,isSecondary:v}=cl(p),d=c[0].startsWith("FontAwesome");let y=gi(g,x),b=y;if(d){const w=A1(x);w.iconName&&w.prefix&&(y=w.iconName,g=w.prefix)}if(y&&!v&&(!s||s.getAttribute(ui)!==g||s.getAttribute(di)!==b)){e.setAttribute(n,b),s&&e.removeChild(s);const w=K1(),{extra:M}=w;M.attributes[Fr]=t,Xr(y,g).then(k=>{const E=vi({...w,icons:{main:k,mask:yi()},prefix:g,iconName:b,extra:M,watchable:!0}),R=Z.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(R,e.firstChild):e.appendChild(R),R.outerHTML=E.map(re=>gn(re)).join(` -`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function ul(e){return Promise.all([xs(e,"::before"),xs(e,"::after")])}function dl(e){return e.parentNode!==document.head&&!~t1.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Fr)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function ws(e){if(Be)return new Promise((t,n)=>{const r=Nt(e.querySelectorAll("*")).filter(dl).map(ul),i=xi.begin("searchPseudoElements");Ga(),Promise.all(r).then(()=>{i(),Yr(),t()}).catch(()=>{i(),Yr(),n()})})}var hl={hooks(){return{mutationObserverCallbacks(e){return e.pseudoElementsCallback=ws,e}}},provides(e){e.pseudoElements2svg=function(t){const{node:n=Z}=t;P.searchPseudoElements&&ws(n)}}};let bs=!1;var pl={mixout(){return{dom:{unwatch(){Ga(),bs=!0}}}},hooks(){return{bootstrap(){ps(qr("mutationObserverCallbacks",{}))},noAuto(){W1()},watch(e){const{observeMutationsRoot:t}=e;bs?Yr():ps(qr("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}};const Ss=e=>{let t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce((n,r)=>{const i=r.toLowerCase().split("-"),a=i[0];let s=i.slice(1).join("-");if(a&&s==="h")return n.flipX=!0,n;if(a&&s==="v")return n.flipY=!0,n;if(s=parseFloat(s),isNaN(s))return n;switch(a){case"grow":n.size=n.size+s;break;case"shrink":n.size=n.size-s;break;case"left":n.x=n.x-s;break;case"right":n.x=n.x+s;break;case"up":n.y=n.y-s;break;case"down":n.y=n.y+s;break;case"rotate":n.rotate=n.rotate+s;break}return n},t)};var ml={mixout(){return{parse:{transform:e=>Ss(e)}}},hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=Ss(n)),e}}},provides(e){e.generateAbstractTransformGrouping=function(t){let{main:n,transform:r,containerWidth:i,iconWidth:a}=t;const s={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(r.x*32,", ").concat(r.y*32,") "),l="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),c="rotate(".concat(r.rotate," 0 0)"),u={transform:"".concat(o," ").concat(l," ").concat(c)},h={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:u,path:h};return{tag:"g",attributes:{...p.outer},children:[{tag:"g",attributes:{...p.inner},children:[{tag:n.icon.tag,children:n.icon.children,attributes:{...n.icon.attributes,...p.path}}]}]}}}};const Mr={x:0,y:0,width:"100%",height:"100%"};function Ms(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function gl(e){return e.tag==="g"?e.children:[e]}var yl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),r=n?or(n.split(" ").map(i=>i.trim())):yi();return r.prefix||(r.prefix=it()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides(e){e.generateAbstractMask=function(t){let{children:n,attributes:r,main:i,mask:a,maskId:s,transform:o}=t;const{width:l,icon:c}=i,{width:u,icon:h}=a,p=p1({transform:o,containerWidth:u,iconWidth:l}),g={tag:"rect",attributes:{...Mr,fill:"white"}},x=c.children?{children:c.children.map(Ms)}:{},v={tag:"g",attributes:{...p.inner},children:[Ms({tag:c.tag,attributes:{...c.attributes,...p.path},...x})]},d={tag:"g",attributes:{...p.outer},children:[v]},y="mask-".concat(s||fn()),b="clip-".concat(s||fn()),w={tag:"mask",attributes:{...Mr,id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[g,d]},M={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:gl(h)},w]};return n.push(M,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")"),...Mr}}),{children:n,attributes:r}}}},vl={provides(e){let t=!1;rt.matchMedia&&(t=rt.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const n=[],r={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:{...r,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const a={...i,attributeName:"opacity"},s={tag:"circle",attributes:{...r,cx:"256",cy:"364",r:"28"},children:[]};return t||s.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...a,values:"1;0;1;1;0;1;"}}),n.push(s),n.push({tag:"path",attributes:{...r,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...a,values:"1;0;0;0;0;1;"}}]}),t||n.push({tag:"path",attributes:{...r,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...a,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},xl={hooks(){return{parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),r=n===null?!1:n===""?!0:n;return e.symbol=r,e}}}},wl=[y1,rl,il,sl,al,hl,pl,ml,yl,vl,xl];L1(wl,{mixoutsTo:Ee});Ee.noAuto;Ee.config;Ee.library;Ee.dom;const Qr=Ee.parse;Ee.findIconDefinition;Ee.toHtml;const bl=Ee.icon;Ee.layer;Ee.text;Ee.counter;function ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Ml(e,t){if(e==null)return{};var n=Sl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gr(e){return kl(e)||El(e)||Pl(e)||Al()}function kl(e){if(Array.isArray(e))return Ur(e)}function El(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pl(e,t){if(e){if(typeof e=="string")return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(l){return Ja(e,l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.attrs.className=u,delete t.attributes.class;break;case"style":l.attrs.style=Tl(u);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?l.attrs[c.toLowerCase()]=u:l.attrs[Ka(c)]=u}return l},{attrs:{}}),a=n.style,s=a===void 0?{}:a,o=Ml(n,Ol);return i.attrs.style=Ce(Ce({},i.attrs.style),s),e.apply(void 0,[t.tag,Ce(Ce({},i.attrs),o)].concat(Gr(r)))}var eo=!1;try{eo=!0}catch{}function jl(){if(!eo&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Es(e){if(e&&Wn(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Qr.icon)return Qr.icon(e);if(e===null)return null;if(e&&Wn(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function kr(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?At({},e,t):{}}var Ps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},un=xt.forwardRef(function(e,t){var n=Ce(Ce({},Ps),e),r=n.icon,i=n.mask,a=n.symbol,s=n.className,o=n.title,l=n.titleId,c=n.maskId,u=Es(r),h=kr("classes",[].concat(Gr(Il(n)),Gr((s||"").split(" ")))),p=kr("transform",typeof n.transform=="string"?Qr.transform(n.transform):n.transform),g=kr("mask",Es(i)),x=bl(u,Ce(Ce(Ce(Ce({},h),p),g),{},{symbol:a,title:o,titleId:l,maskId:c}));if(!x)return jl("Could not find icon",u),null;var v=x.abstract,d={ref:t};return Object.keys(n).forEach(function(y){Ps.hasOwnProperty(y)||(d[y]=n[y])}),_l(v[0],d)});un.displayName="FontAwesomeIcon";un.propTypes={beat:C.bool,border:C.bool,beatFade:C.bool,bounce:C.bool,className:C.string,fade:C.bool,flash:C.bool,mask:C.oneOfType([C.object,C.array,C.string]),maskId:C.string,fixedWidth:C.bool,inverse:C.bool,flip:C.oneOf([!0,!1,"horizontal","vertical","both"]),icon:C.oneOfType([C.object,C.array,C.string]),listItem:C.bool,pull:C.oneOf(["right","left"]),pulse:C.bool,rotation:C.oneOf([0,90,180,270]),shake:C.bool,size:C.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:C.bool,spinPulse:C.bool,spinReverse:C.bool,symbol:C.oneOfType([C.bool,C.string]),title:C.string,titleId:C.string,transform:C.oneOfType([C.string,C.object]),swapOpacity:C.bool};var _l=Ja.bind(null,xt.createElement),me=function(){return me=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?ae(Dt,--Ie):0,jt--,ee===10&&(jt=1,fr--),ee}function Le(){return ee=Ie2||Jr(ee)>3?"":" "}function Zl(e,t){for(;--t&&Le()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return dr(e,Cn()+(t<6&&yt()==32&&Le()==32))}function ei(e){for(;Le();)switch(ee){case e:return Ie;case 34:case 39:e!==34&&e!==39&&ei(ee);break;case 40:e===41&&ei(e);break;case 92:Le();break}return Ie}function Xl(e,t){for(;Le()&&e+ee!==57;)if(e+ee===84&&yt()===47)break;return"/*"+dr(t,Ie-1)+"*"+Si(e===47?e:Le())}function Bl(e){for(;!Jr(yt());)Le();return dr(e,Ie)}function Yl(e){return ql(Fn("",null,null,null,[""],e=Vl(e),0,[0],e))}function Fn(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,h=s,p=0,g=0,x=0,v=1,d=1,y=1,b=0,w="",M=i,k=a,E=r,R=w;d;)switch(x=b,b=Le()){case 40:if(x!=108&&ae(R,h-1)==58){_n(R+=j(Er(b),"&","&\f"),"&\f",ro(c?o[c-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:R+=Er(b);break;case 9:case 10:case 13:case 32:R+=Hl(x);break;case 92:R+=Zl(Cn()-1,7);continue;case 47:switch(yt()){case 42:case 47:Ut(Wl(Xl(Le(),Cn()),t,n,l),l);break;default:R+="/"}break;case 123*v:o[c++]=Fe(R)*y;case 125*v:case 59:case 0:switch(b){case 0:case 125:d=0;case 59+u:y==-1&&(R=j(R,/\f/g,"")),g>0&&Fe(R)-h&&Ut(g>32?Rs(R+";",r,n,h-1,l):Rs(j(R," ","")+";",r,n,h-2,l),l);break;case 59:R+=";";default:if(Ut(E=Is(R,t,n,c,u,i,o,w,M=[],k=[],h,a),a),b===123)if(u===0)Fn(R,t,E,E,M,a,h,o,k);else switch(p===99&&ae(R,3)===110?100:p){case 100:case 108:case 109:case 115:Fn(e,E,E,r&&Ut(Is(e,E,E,0,0,i,o,w,i,M=[],h,k),k),i,k,h,o,r?M:k);break;default:Fn(R,E,E,E,[""],k,0,o,k)}}c=u=g=0,v=y=1,w=R="",h=s;break;case 58:h=1+Fe(R),g=x;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&$l()==125)continue}switch(R+=Si(b),b*v){case 38:y=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Fe(R)-1)*y,y=1;break;case 64:yt()===45&&(R+=Er(Le())),p=yt(),u=h=Fe(w=R+=Bl(Cn())),b++;break;case 45:x===45&&Fe(R)==2&&(v=0)}}return a}function Is(e,t,n,r,i,a,s,o,l,c,u,h){for(var p=i-1,g=i===0?a:[""],x=so(g),v=0,d=0,y=0;v0?g[b]+" "+w:j(w,/&\f/g,g[b])))&&(l[y++]=M);return ur(e,t,n,i===0?cr:o,l,c,u,h)}function Wl(e,t,n,r){return ur(e,t,n,to,Si(Dl()),Tt(e,2,-2),0,r)}function Rs(e,t,n,r,i){return ur(e,t,n,bi,Tt(e,0,r),Tt(e,r+1,-1),r,i)}function oo(e,t,n){switch(zl(e,t)){case 5103:return N+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return N+e+e;case 4789:return rn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return N+e+rn+e+q+e+e;case 5936:switch(ae(e,t+11)){case 114:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return N+e+q+j(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return N+e+q+e+e;case 6165:return N+e+q+"flex-"+e+e;case 5187:return N+e+j(e,/(\w+).+(:[^]+)/,N+"box-$1$2"+q+"flex-$1$2")+e;case 5443:return N+e+q+"flex-item-"+j(e,/flex-|-self/g,"")+(Ve(e,/flex-|baseline/)?"":q+"grid-row-"+j(e,/flex-|-self/g,""))+e;case 4675:return N+e+q+"flex-line-pack"+j(e,/align-content|flex-|-self/g,"")+e;case 5548:return N+e+q+j(e,"shrink","negative")+e;case 5292:return N+e+q+j(e,"basis","preferred-size")+e;case 6060:return N+"box-"+j(e,"-grow","")+N+e+q+j(e,"grow","positive")+e;case 4554:return N+j(e,/([^-])(transform)/g,"$1"+N+"$2")+e;case 6187:return j(j(j(e,/(zoom-|grab)/,N+"$1"),/(image-set)/,N+"$1"),e,"")+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,N+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,N+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+N+e+e;case 4200:if(!Ve(e,/flex-|baseline/))return q+"grid-column-align"+Tt(e,t)+e;break;case 2592:case 3360:return q+j(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Ve(r.props,/grid-\w+-end/)})?~_n(e+(n=n[t].value),"span",0)?e:q+j(e,"-start","")+e+q+"grid-row-span:"+(~_n(n,"span",0)?Ve(n,/\d+/):+Ve(n,/\d+/)-+Ve(e,/\d+/))+";":q+j(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Ve(r.props,/grid-\w+-start/)})?e:q+j(j(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,N+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Fe(e)-1-t>6)switch(ae(e,t+1)){case 109:if(ae(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,"$1"+N+"$2-$3$1"+rn+(ae(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_n(e,"stretch",0)?oo(j(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return j(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,s,o,l,c){return q+i+":"+a+c+(s?q+i+"-span:"+(o?l:+l-+a)+c:"")+e});case 4949:if(ae(e,t+6)===121)return j(e,":",":"+N)+e;break;case 6444:switch(ae(e,ae(e,14)===45?18:11)){case 120:return j(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+N+(ae(e,14)===45?"inline-":"")+"box$3$1"+N+"$2$3$1"+q+"$2box$3")+e;case 100:return j(e,":",":"+q)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return j(e,"scroll-","scroll-snap-")+e}return e}function Gn(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case bi:e.return=oo(e.value,e.length,n);return;case no:return Gn([et(e,{value:j(e.value,"@","@"+N)})],r);case cr:if(e.length)return Nl(n=e.props,function(i){switch(Ve(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":kt(et(e,{props:[j(i,/:(read-\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break;case"::placeholder":kt(et(e,{props:[j(i,/:(plac\w+)/,":"+N+"input-$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,":"+rn+"$1")]})),kt(et(e,{props:[j(i,/:(plac\w+)/,q+"input-$1")]})),kt(et(e,{props:[i]})),Kr(e,{props:As(n,r)});break}return""})}}var Jl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},we={},_t=typeof process<"u"&&we!==void 0&&(we.REACT_APP_SC_ATTR||we.SC_ATTR)||"data-styled",lo="active",co="data-styled-version",hr="6.1.12",Mi=`/*!sc*/ -`,Un=typeof window<"u"&&"HTMLElement"in window,ec=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&we.REACT_APP_SC_DISABLE_SPEEDY!==""?we.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&we.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&we!==void 0&&we.SC_DISABLE_SPEEDY!==void 0&&we.SC_DISABLE_SPEEDY!==""&&we.SC_DISABLE_SPEEDY!=="false"&&we.SC_DISABLE_SPEEDY),pr=Object.freeze([]),Ct=Object.freeze({});function tc(e,t,n){return n===void 0&&(n=Ct),e.theme!==n.theme&&e.theme||t||n.theme}var fo=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),nc=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,rc=/(^-|-$)/g;function Os(e){return e.replace(nc,"-").replace(rc,"")}var ic=/(a)(d)/gi,Pn=52,Ls=function(e){return String.fromCharCode(e+(e>25?39:97))};function ti(e){var t,n="";for(t=Math.abs(e);t>Pn;t=t/Pn|0)n=Ls(t%Pn)+n;return(Ls(t%Pn)+n).replace(ic,"$1-$2")}var Pr,uo=5381,It=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ho=function(e){return It(uo,e)};function sc(e){return ti(ho(e)>>>0)}function ac(e){return e.displayName||e.name||"Component"}function Ar(e){return typeof e=="string"&&!0}var po=typeof Symbol=="function"&&Symbol.for,mo=po?Symbol.for("react.memo"):60115,oc=po?Symbol.for("react.forward_ref"):60112,lc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},go={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},fc=((Pr={})[oc]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Pr[mo]=go,Pr);function Ts(e){return("type"in(t=e)&&t.type.$$typeof)===mo?go:"$$typeof"in e?fc[e.$$typeof]:lc;var t}var uc=Object.defineProperty,dc=Object.getOwnPropertyNames,js=Object.getOwnPropertySymbols,hc=Object.getOwnPropertyDescriptor,pc=Object.getPrototypeOf,_s=Object.prototype;function yo(e,t,n){if(typeof t!="string"){if(_s){var r=pc(t);r&&r!==_s&&yo(e,r,n)}var i=dc(t);js&&(i=i.concat(js(t)));for(var a=Ts(e),s=Ts(t),o=0;o0?" Args: ".concat(t.join(", ")):""))}var mc=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;t>=a;)if((a<<=1)<0)throw yn(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=i;s=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),a=i+r,s=i;s=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(d+="".concat(y,","))}),l+="".concat(x).concat(v,'{content:"').concat(d,'"}').concat(Mi)},u=0;u0?".".concat(t):p},u=l.slice();u.push(function(p){p.type===cr&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(Pc,n).replace(r,c))}),s.prefix&&u.push(Kl),u.push(Ql);var h=function(p,g,x,v){g===void 0&&(g=""),x===void 0&&(x=""),v===void 0&&(v="&"),t=v,n=g,r=new RegExp("\\".concat(n,"\\b"),"g");var d=p.replace(Ac,""),y=Yl(x||g?"".concat(x," ").concat(g," { ").concat(d," }"):d);s.namespace&&(y=wo(y,s.namespace));var b=[];return Gn(y,Gl(u.concat(Ul(function(w){return b.push(w)})))),b};return h.hash=l.length?l.reduce(function(p,g){return g.name||yn(15),It(p,g.name)},uo).toString():"",h}var Rc=new xo,ri=Ic(),bo=xt.createContext({shouldForwardProp:void 0,styleSheet:Rc,stylis:ri});bo.Consumer;xt.createContext(void 0);function Ns(){return D.useContext(bo)}var Oc=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=ri);var s=r.name+a.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,a(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Ei(this,function(){throw yn(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ri),this.name+t.hash},e}(),Lc=function(e){return e>="A"&&e<="Z"};function Ds(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,s)){var o=r(a,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,o)}i=dt(i,s),this.staticRulesId=s}else{for(var l=It(this.baseHash,r.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,g)||n.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=dt(i,g)}}return i},e}(),ko=xt.createContext(void 0);ko.Consumer;var Ir={};function Cc(e,t,n){var r=ki(e),i=e,a=!Ar(e),s=t.attrs,o=s===void 0?pr:s,l=t.componentId,c=l===void 0?function(M,k){var E=typeof M!="string"?"sc":Os(M);Ir[E]=(Ir[E]||0)+1;var R="".concat(E,"-").concat(sc(hr+E+Ir[E]));return k?"".concat(k,"-").concat(R):R}(t.displayName,t.parentComponentId):l,u=t.displayName,h=u===void 0?function(M){return Ar(M)?"styled.".concat(M):"Styled(".concat(ac(M),")")}(e):u,p=t.displayName&&t.componentId?"".concat(Os(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,x=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var d=t.shouldForwardProp;x=function(M,k){return v(M,k)&&d(M,k)}}else x=v}var y=new _c(n,p,r?i.componentStyle:void 0);function b(M,k){return function(E,R,re){var X=E.attrs,ie=E.componentStyle,le=E.defaultProps,$=E.foldedComponentIds,F=E.styledComponentId,T=E.target,Q=xt.useContext(ko),Te=Ns(),te=E.shouldForwardProp||Te.shouldForwardProp,Pe=tc(R,Q,le)||Ct,B=function(xn,$t,wn){for(var Vt,at=me(me({},$t),{className:void 0,theme:wn}),mr=0;mre?"2px 8px 8px 2px":"8px 2px 2px 8px"}; - } - - &:last-child { - border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; - } -`,de=U.div` - background-color: ${({$pressed:e})=>e?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"}; - border: none; - display: flex; - align-items: center; - justify-content: center; - color: white; - border-radius: 5px; - font-size: 14px; - font-family: Arial, sans-serif; - height: 20px; - width: 20px; - transition: all 0.2s ease-in-out; -`,Po=U.div` - display: flex; - align-items: center; - height: 24px; - margin-bottom: 2px; - justify-content: flex-start; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; -`,zt=U.div` - display: flex; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; - height: 100%; - justify-content: space-between; - align-items: center; -`;U.button` - background-color: rgba(255, 255, 255, 0.3); - border: none; - display: flex; - justify-content: center; - align-items: center; - padding: 0; - pointer-events: none; - width: 50px; - height: 50px; - border-radius: 50%; - position: relative; - margin: 0 5px; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); -`;U.div` - position: absolute; - background-color: white; - border-radius: 50%; - width: 36px; - height: 36px; - cursor: pointer; - pointer-events: auto; -`;const Ao=U.input.attrs({type:"range"})` - -webkit-appearance: none; - appearance: none; - background-color: rgba(255, 255, 255, 0.3); - border: none; - height: 100%; - width: 49px; - cursor: pointer; - margin: 0 1px; - transition: all 0.2s ease-in-out; - border-radius: ${({$reverse:e})=>e?"8px 2px 2px 8px":"2px 8px 8px 2px"}; - - &::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } - - &::-moz-range-thumb { - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } - - &::-ms-thumb { - width: 8px; - height: 24px; - background-color: white; - border-radius: 3px; - } -`,zc=U.div` - display: flex; - flex-direction: column; - align-items: ${({$reverse:e})=>e?"flex-start":"flex-end"}; - justify-content: center; - margin: ${({$reverse:e})=>e?"2px -26px 0 0":"2px 0 0 -26px"}; -`,qs=U.div` - display: flex; - flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"}; - align-items: center; - justify-content: center; -`;U.div` - display: flex; - flex-direction: column; - height: 50px; - justify-content: space-between; -`;const K=U(un)` - height: 14px; - min-height: 14px; - max-height: 14px; - width: 14px; - min-width: 14px; - max-width: 14px; -`,Nc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),Dc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),$c=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),Vc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Hc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),Zc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Xc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Bc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Yc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Wc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),Qc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),Gc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),Uc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),Kc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),Jc=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),e2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),t2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),n2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),r2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:[f.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),i2={"x-button-left":Nc,"y-button-left":Dc,"a-button-right":$c,"b-button-right":Vc,"thumbstick-left":qc,"thumbstick-up-left":Zc,"thumbstick-down-left":Xc,"thumbstick-right-left":Yc,"thumbstick-left-left":Bc,"thumbstick-right":Hc,"thumbstick-up-right":Wc,"thumbstick-down-right":Qc,"thumbstick-right-right":Uc,"thumbstick-left-right":Gc,"trigger-left":e2,"trigger-right":t2,"squeeze-left":Kc,"squeeze-right":Jc,"thumbrest-left":n2,"thumbrest-right":r2},hn=({buttonName:e,handedness:t})=>{const n=`${e}-${t}`,r=i2[n];return r?f.jsx(r,{}):f.jsx("div",{style:{width:"28px",height:"28px"}})},s2=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none",children:f.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M1 11.2A5.2 5.2 0 0 1 6.2 6h15.6a5.2 5.2 0 0 1 5.2 5.2v5.2a5.2 5.2 0 0 1-5.2 5.2h-3.109c-1.149 0-2.199-.65-2.713-1.677l-.199-.398a1.733 1.733 0 0 0-1.55-.958h-.458c-.656 0-1.257.37-1.55.958l-.2.398A3.033 3.033 0 0 1 9.31 21.6H6.2A5.2 5.2 0 0 1 1 16.4v-5.2Zm9.1 2.167a2.6 2.6 0 1 1-5.2 0 2.6 2.6 0 0 1 5.2 0Zm15.538-1.426a.498.498 0 0 0 .141-.542l.002-.002a5.456 5.456 0 0 0-.347-.755l-.104-.178a5.586 5.586 0 0 0-.486-.686.502.502 0 0 0-.54-.15l-1.225.39a4.234 4.234 0 0 0-.968-.56l-.275-1.256a.497.497 0 0 0-.4-.392 5.686 5.686 0 0 0-1.871.003.497.497 0 0 0-.4.391l-.276 1.257a4.234 4.234 0 0 0-.968.559l-1.226-.39a.498.498 0 0 0-.539.15 5.586 5.586 0 0 0-.486.686l-.104.179c-.134.242-.25.492-.347.754a.498.498 0 0 0 .14.542l.953.867a4.26 4.26 0 0 0 0 1.12l-.952.867a.498.498 0 0 0-.141.541c.097.262.213.513.347.755l.104.178c.145.242.308.471.486.687.13.156.346.211.54.15l1.223-.392c.295.226.62.416.968.559l.275 1.256c.044.2.198.359.4.392a5.686 5.686 0 0 0 1.871 0 .497.497 0 0 0 .4-.392l.276-1.256c.347-.143.673-.333.968-.56l1.225.39c.194.062.41.009.54-.15a5.59 5.59 0 0 0 .486-.686l.103-.178a5.45 5.45 0 0 0 .348-.755.498.498 0 0 0-.14-.541l-.954-.867a4.258 4.258 0 0 0 0-1.118l.953-.867ZM20.5 15.967a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})}),a2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),o2=()=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),f.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]}),l2={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Pi={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},c2={prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]},f2={prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]},Hs={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},u2={prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]},Io={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]},d2={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},h2={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},p2={prefix:"fas",iconName:"square-arrow-up-right",icon:[448,512,["external-link-square"],"f14c","M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l94.1 0L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135L288 328c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24l-152 0z"]},m2={prefix:"fas",iconName:"keyboard",icon:[576,512,[9e3],"f11c","M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 336c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32zM272 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM256 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM368 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM352 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM464 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM448 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]},Ro={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]},g2={prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Zs={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},y2={prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]},v2={prefix:"fas",iconName:"arrows-up-down",icon:[320,512,["arrows-v"],"f07d","M182.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 109.3l0 293.5L86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 402.7l0-293.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z"]},x2={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},qe={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:f.jsx(K,{icon:u2}),Backspace:f.jsx(K,{icon:g2}),Enter:f.jsx(K,{style:{transform:"rotate(90deg)"},icon:y2}),ShiftLeft:f.jsx(K,{icon:Zs}),ShiftRight:f.jsx(K,{icon:Zs}),Space:" ",ArrowUp:f.jsx(K,{icon:Io}),ArrowDown:f.jsx(K,{icon:Ro}),ArrowLeft:f.jsx(K,{icon:f2}),ArrowRight:f.jsx(K,{icon:c2}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:f.jsx(a2,{}),MouseRight:f.jsx(o2,{})},w2={left:{"thumbstick-up":"KeyW","thumbstick-down":"KeyS","thumbstick-left":"KeyA","thumbstick-right":"KeyD",thumbstick:"KeyR","x-button":"KeyX","y-button":"KeyZ",trigger:"KeyQ",squeeze:"KeyE"},right:{"thumbstick-up":"ArrowUp","thumbstick-down":"ArrowDown","thumbstick-left":"ArrowLeft","thumbstick-right":"ArrowRight",thumbstick:"Slash","a-button":"Enter","b-button":"ShiftRight",trigger:"MouseLeft",squeeze:"MouseRight"}},b2=U.div` - display: flex; - justify-content: space-between; - pointer-events: all; - position: fixed; - display: flex; - top: 40px; - left: calc(50vw - 156px); - width: 312px; -`,Xs=U.div` - display: flex; - flex-direction: column; - width: 50%; -`,Bs=U.div` - display: flex; - height: 24px; - align-items: center; - margin-bottom: 2px; -`,S2=({keyMap:e,setKeyMap:t})=>{const[n,r]=D.useState(null),i=(s,o)=>{r({controller:s,action:o})},a=(s,o)=>{t(l=>({...l,[s]:{...l[s],[o]:"Unmapped"}}))};return D.useEffect(()=>{const s=c=>{n&&qe[c.code]&&(t(u=>({...u,[n.controller]:{...u[n.controller],[n.action]:c.code}})),r(null))},o=c=>{if(n){const u=c.button===0?"MouseLeft":c.button===2?"MouseRight":null;u&&qe[u]&&(t(h=>({...h,[n.controller]:{...h[n.controller],[n.action]:u}})),r(null))}},l=c=>{c.preventDefault()};return window.addEventListener("keydown",s),window.addEventListener("mousedown",o),window.addEventListener("contextmenu",l),()=>{window.removeEventListener("keydown",s),window.removeEventListener("mousedown",o),window.removeEventListener("contextmenu",l)}},[n,t]),f.jsxs(b2,{children:[f.jsx(Xs,{children:Object.keys(e.left).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"left"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="left"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("left",s),onContextMenu:o=>o.preventDefault(),children:e.left[s]}),f.jsx(oe,{style:{width:"24px"},$reverse:!1,onClick:()=>a("left",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))}),f.jsx(Xs,{children:Object.keys(e.right).map(s=>f.jsxs(Bs,{children:[f.jsx(hn,{buttonName:s==="up"?"thumbstick":s,handedness:"right"}),f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,style:{width:"100px",backgroundColor:n&&n.controller==="right"&&n.action===s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)"},onClick:()=>i("right",s),onContextMenu:o=>o.preventDefault(),children:e.right[s]}),f.jsx(oe,{$reverse:!1,style:{width:"24px"},onClick:()=>a("right",s),onContextMenu:o=>o.preventDefault(),children:f.jsx(un,{icon:Hs})})]})]},s))})]})},M2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(0),p=e.inputSource.handedness;return D.useEffect(()=>{const g=y=>{y.code===r&&(e.updateButtonValue(t,1),c(!0))},x=y=>{y.code===r&&(e.updateButtonValue(t,0),c(!1))},v=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,1),c(!0))},d=y=>{(r==="MouseLeft"&&y.button===0||r==="MouseRight"&&y.button===2)&&(e.updateButtonValue(t,0),c(!1))};return n?r==="MouseLeft"||r==="MouseRight"?(window.addEventListener("mousedown",v),window.addEventListener("mouseup",d)):(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{r==="MouseLeft"||r==="MouseRight"?(window.removeEventListener("mousedown",v),window.removeEventListener("mouseup",d)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x))}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:l,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{o(!0),e.updateButtonValue(t,1),setTimeout(()=>{o(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ao,{$reverse:p==="right",value:u,onChange:g=>{const x=Number(g.target.value);h(x),e.updateButtonValue(t,x/100)},min:"0",max:"100"})]})})]})},k2=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[i,a]=D.useState(!1),[s,o]=D.useState(!1),[l,c]=D.useState(!1),[u,h]=D.useState(!1),p=e.inputSource.handedness;return D.useEffect(()=>{const g=v=>{v.code===r&&(e.updateButtonValue(t,1),h(!0))},x=v=>{v.code===r&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",g),window.addEventListener("keyup",x)):(window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",x)}},[r,n,t,e]),f.jsxs(Po,{$reverse:p==="right",children:[f.jsx(hn,{buttonName:t,handedness:p}),f.jsx(zt,{$reverse:p==="right",children:n?f.jsx(de,{$pressed:u,children:qe[r]}):f.jsxs(f.Fragment,{children:[f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:l?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"50px"},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout(()=>{c(!1),e.updateButtonValue(t,0)},500)},children:"Press"}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:i?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{a(!i),e.updateButtonTouch(t,!i)},children:f.jsx(K,{icon:Pi})}),f.jsx(oe,{$reverse:p==="right",style:{backgroundColor:s?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{o(!s),e.updateButtonValue(t,s?0:1)},children:"Hold"})]})})]})},E2=U.div` - display: flex; - align-items: center; - margin-bottom: 2px; -`,P2=U.button` - background-color: rgba(255, 255, 255, 0.3); - border: none; - display: flex; - justify-content: center; - align-items: center; - padding: 0; - pointer-events: none; - width: 50px; - height: 50px; - border-radius: 50%; - position: relative; - margin: 0 5px; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); -`,A2=U.div` - position: absolute; - background-color: white; - border-radius: 50%; - width: 36px; - height: 36px; - cursor: pointer; - pointer-events: auto; -`,Ys=U(oe)` - width: 49px; - font-size: 14px; - - ${({$reverse:e})=>e?` - &:first-child { - margin-left: 1px; - border-radius: 2px 8px 8px 2px; - } - - &:last-child { - margin-right: 1px; - border-radius: 8px 2px 2px 8px; - } - `:` - &:first-child { - margin-right: 1px; - border-radius: 8px 2px 2px 8px; - } - - &:last-child { - margin-left: 1px; - border-radius: 2px 8px 8px 2px; - } - `} -`,I2=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:r,mappedKeyDown:i,mappedKeyLeft:a,mappedKeyRight:s,mappedKeyPressed:o})=>{const l=D.useRef(null),[c,u]=D.useState(!1),[h,p]=D.useState(!1),[g,x]=D.useState(!1),[v,d]=D.useState(!1),[y,b]=D.useState({x:0,y:0}),[w,M]=D.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),k=e.inputSource.handedness,E=()=>{if(l.current){const X=l.current.getBoundingClientRect();b({x:X.left+X.width/2,y:X.top+X.height/2}),u(!0)}},R=X=>{if(c&&l.current){const ie=X.clientX-y.x,le=X.clientY-y.y,$=Math.sqrt(ie*ie+le*le),F=12;let T,Q;if(${u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return D.useEffect(()=>{const X=$=>{const F={...w};$.code===r&&(F.up=!0),$.code===i&&(F.down=!0),$.code===a&&(F.left=!0),$.code===s&&(F.right=!0),$.code===o&&(F.pressed=!0,e.updateButtonValue(n,1)),M(F),le(F)},ie=$=>{const F={...w};$.code===r&&(F.up=!1),$.code===i&&(F.down=!1),$.code===a&&(F.left=!1),$.code===s&&(F.right=!1),$.code===o&&(F.pressed=!1,e.updateButtonValue(n,0)),M(F),le(F)},le=$=>{const F=($.right?1:0)-($.left?1:0),T=($.down?1:0)-($.up?1:0),Q=Math.sqrt(F*F+T*T);if(Q===0){e.updateAxes(n,0,0);return}const Te=F/Q,te=T/Q;e.updateAxes(n,Te,te)};return t?(window.addEventListener("keydown",X),window.addEventListener("keyup",ie)):(window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)),()=>{window.removeEventListener("keydown",X),window.removeEventListener("keyup",ie)}},[r,i,a,s,t,w]),D.useEffect(()=>(document.addEventListener("mousemove",R),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",re)}),[c,y]),f.jsxs(E2,{style:{flexDirection:e.inputSource.handedness==="left"?"row":"row-reverse",alignItems:"flex-start"},children:[f.jsx(hn,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),t?f.jsxs(zc,{$reverse:k==="right",children:[f.jsxs(qs,{$reverse:k==="right",children:[f.jsx(de,{$pressed:w.up,style:{margin:"2px"},children:qe[r]}),f.jsx(de,{$pressed:w.pressed,style:{margin:"2px"},children:qe[o]})]}),f.jsxs(qs,{$reverse:!1,children:[f.jsx(de,{$pressed:w.left,style:{margin:"2px"},children:qe[a]}),f.jsx(de,{$pressed:w.down,style:{margin:"2px"},children:qe[i]}),f.jsx(de,{$pressed:w.right,style:{margin:"2px"},children:qe[s]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(P2,{style:{margin:e.inputSource.handedness==="left"?"0 5px 0 -3px":"0 -3px 0 5px"},children:f.jsx(A2,{ref:l,onMouseDown:E})}),f.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[f.jsx(oe,{$reverse:k==="right",style:{backgroundColor:v?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"80px",marginBottom:"2px",borderRadius:"8px"},onClick:()=>{d(!0),e.updateButtonValue(n,1),setTimeout(()=>{d(!1),e.updateButtonValue(n,0)},500)},children:"Press"}),f.jsxs(zt,{$reverse:k==="right",children:[f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:h?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"29px"},onClick:()=>{p(!h),e.updateButtonTouch(n,!h)},children:f.jsx(K,{icon:Pi})}),f.jsx(Ys,{$reverse:e.inputSource.handedness!=="left",style:{backgroundColor:g?"rgba(255, 255, 255, 0.6)":"rgba(255, 255, 255, 0.3)",width:"49px"},onClick:()=>{x(!g),e.updateButtonValue(n,g?0:1)},children:"Hold"})]})]})]})]})},R2=U.div` - padding: ${({$reverse:e})=>e?"6px 2px 3px 5px":"6px 5px 3px 2px"}; - pointer-events: all; - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border-radius: ${({$reverse:e})=>e?"12px 0 0 0":"0 12px 0 0"}; -`;function O2(e){const t=new Set;for(const r of e.axes)r&&r.id&&t.add(r.id);const n=e.buttons.filter(r=>r!==null).map(r=>({id:r.id,type:r.type,hasAxes:t.has(r.id)}));return n.sort((r,i)=>r.hasAxes&&!i.hasAxes?-1:!r.hasAxes&&i.hasAxes?1:0),n}const L2=({xrDevice:e,keyMap:t,pointerLocked:n})=>f.jsx("div",{style:{display:"flex",justifyContent:"space-between",flexDirection:"row"},children:Object.entries(e.controllers).map(([r,i])=>f.jsx(R2,{$reverse:r!=="left",children:O2(i.gamepadConfig).map(a=>{const s=t[r];return a.hasAxes?f.jsx(I2,{xrController:i,pointerLocked:n,buttonId:a.id,mappedKeyUp:t[r][`${a.id}-up`],mappedKeyDown:s[`${a.id}-down`],mappedKeyLeft:s[`${a.id}-left`],mappedKeyRight:s[`${a.id}-right`],mappedKeyPressed:s[a.id]},a.id):a.type==="analog"?f.jsx(M2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id):f.jsx(k2,{xrController:i,buttonId:a.id,mappedKey:s[a.id],pointerLocked:n},a.id)})},r))}),T2=U.div` - display: flex; - justify-content: center; - pointer-events: all; - position: fixed; - display: flex; - top: 40px; - left: calc(50vw - 156px); - width: 312px; -`,j2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(e.fovy);return f.jsx(T2,{children:f.jsxs(zt,{$reverse:!1,children:[f.jsx(oe,{$reverse:!1,disabled:!0,children:"FOV-Y"}),f.jsx(Ao,{$reverse:!1,value:n,style:{width:"100px",borderRadius:"2px"},onChange:i=>{const a=Number(i.target.value);r(a),e.fovy=a,t.syncFovy(),t.renderScene()},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48}),f.jsxs(oe,{$reverse:!1,disabled:!0,children:[(n/Math.PI*180).toFixed(2),"°"]})]})})},_2=U.div` - padding: 6px 5px; - display: flex; - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - justify-content: center; - pointer-events: all; - border-radius: 0 0 12px 12px; - align-items: center; - height: 24px; -`,Ws=U.div` - background-color: rgba(43, 43, 43, 0.5); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border: none; - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: center; - cursor: pointer; - color: white; - white-space: nowrap; - font-size: 14px; - text-transform: none; - box-shadow: none; - font-family: Arial, sans-serif; - border-radius: ${({$reverse:e})=>e?"0 0 0 12px":"0 0 12px 0"}; - padding: 5px; - - > div { - display: flex; - flex-direction: row; - align-items: center; - gap: 2px; - margin: 2px; - } -`,C2=({xrDevice:e,inputLayer:t,keyMapOpen:n,setKeyMapOpen:r,fovSettingOpen:i,setFovSettingOpen:a})=>f.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[f.jsxs(_2,{children:[f.jsx(s2,{}),f.jsxs("div",{style:{display:"flex",flexDirection:"row",marginLeft:"4px"},children:[f.jsx(oe,{$reverse:!1,onClick:()=>{t.resetDeviceTransforms()},children:f.jsx(K,{icon:d2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{t.lockPointer(),r(!1),a(!1)},children:f.jsx(K,{icon:h2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{r(!n),a(!1)},children:f.jsx(K,{icon:m2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{a(!i),r(!1)},children:f.jsx(K,{icon:x2})}),f.jsx(oe,{$reverse:!1,onClick:()=>{const s=e.activeSession;s==null||s.end()},children:f.jsx(K,{icon:l2})})]})]}),f.jsxs(Ws,{$reverse:!1,style:{position:"fixed",left:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:p2,style:{marginRight:"4px"}})," ","Roomscale Movement"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:"W"}),f.jsx(de,{$pressed:!1,children:"A"}),f.jsx(de,{$pressed:!1,children:"S"}),f.jsx(de,{$pressed:!1,children:"D"})]})]}),f.jsxs(Ws,{$reverse:!0,style:{position:"fixed",right:"0",top:"0"},children:[f.jsxs("div",{children:[f.jsx(K,{icon:v2,style:{marginRight:"4px"}})," Camera Height"]}),f.jsxs("div",{children:[f.jsx(de,{$pressed:!1,style:{width:"50px"},children:"L Shift"}),f.jsx("span",{style:{margin:"0 4px"},children:"+"}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Io})}),f.jsx(de,{$pressed:!1,children:f.jsx(K,{icon:Ro})})]})]})]}),lt=new Lo,fe=new z,Ue=new z,Y=new Ae,Qs={X:new z(1,0,0),Y:new z(0,1,0),Z:new z(0,0,1)},Rr={type:"change"},Gs={type:"mouseDown"},Us={type:"mouseUp",mode:null},Ks={type:"objectChange"};class Js extends Lr{constructor(t,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const r=new V2;this._gizmo=r,this.add(r);const i=new q2;this._plane=i,this.add(i);const a=this;function s(b,w){let M=w;Object.defineProperty(a,b,{get:function(){return M!==void 0?M:w},set:function(k){M!==k&&(M=k,i[b]=k,r[b]=k,a.dispatchEvent({type:b+"-changed",value:k}),a.dispatchEvent(Rr))}}),a[b]=w,i[b]=w,r[b]=w}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new z,l=new z,c=new Ae,u=new Ae,h=new z,p=new Ae,g=new z,x=new z,v=new z,d=0,y=new z;s("worldPosition",o),s("worldPositionStart",l),s("worldQuaternion",c),s("worldQuaternionStart",u),s("cameraPosition",h),s("cameraQuaternion",p),s("pointStart",g),s("pointEnd",x),s("rotationAxis",v),s("rotationAngle",d),s("eye",y),this._offset=new z,this._startNorm=new z,this._endNorm=new z,this._cameraScale=new z,this._parentPosition=new z,this._parentQuaternion=new Ae,this._parentQuaternionInv=new Ae,this._parentScale=new z,this._worldScaleStart=new z,this._worldQuaternionInv=new Ae,this._worldScale=new z,this._positionStart=new z,this._quaternionStart=new Ae,this._scaleStart=new z,this._getPointer=F2.bind(this),this._onPointerDown=N2.bind(this),this._onPointerHover=z2.bind(this),this._onPointerMove=D2.bind(this),this._onPointerUp=$2.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(t){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(t)}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&<.setFromCamera(t,this.camera);const n=Or(this._gizmo.picker[this.mode],lt);n?this.axis=n.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&<.setFromCamera(t,this.camera);const n=Or(this._plane,lt,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Gs.mode=this.mode,this.dispatchEvent(Gs)}}pointerMove(t){const n=this.axis,r=this.mode,i=this.object;let a=this.space;if(r==="scale"?a="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(a="world"),i===void 0||n===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&<.setFromCamera(t,this.camera);const s=Or(this._plane,lt,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),a==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(i.position.applyQuaternion(Y.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),a==="world"&&(i.parent&&i.position.add(fe.setFromMatrixPosition(i.parent.matrixWorld)),n.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(fe.setFromMatrixPosition(i.parent.matrixWorld))));else if(r==="scale"){if(n.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ue.set(o,o,o)}else fe.copy(this.pointStart),Ue.copy(this.pointEnd),fe.applyQuaternion(this._worldQuaternionInv),Ue.applyQuaternion(this._worldQuaternionInv),Ue.divide(fe),n.search("X")===-1&&(Ue.x=1),n.search("Y")===-1&&(Ue.y=1),n.search("Z")===-1&&(Ue.z=1);i.scale.copy(this._scaleStart).multiply(Ue),this.scaleSnap&&(n.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(fe.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(fe.copy(this.rotationAxis).cross(this.eye))*o):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Qs[n]),fe.copy(Qs[n]),a==="local"&&fe.applyQuaternion(this.worldQuaternion),fe.cross(this.eye),fe.length()===0?l=!0:this.rotationAngle=this._offset.dot(fe.normalize())*o),(n==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),a==="local"&&n!=="E"&&n!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Y.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Rr),this.dispatchEvent(Ks)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Us.mode=this.mode,this.dispatchEvent(Us)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Rr),this.dispatchEvent(Ks),this.pointStart.copy(this.pointEnd))}getRaycaster(){return lt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function F2(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function z2(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e));break}}function N2(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function D2(e){this.enabled&&this.pointerMove(this._getPointer(e))}function $2(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Or(e,t,n){const r=t.intersectObject(e,!0);for(let i=0;i.9&&(s.visible=!1)),this.axis==="Y"&&(Y.setFromEuler(In.set(0,0,Math.PI/2)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),s.quaternion.copy(r).multiply(Y),Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Y.setFromEuler(In.set(0,Math.PI/2,0)),V.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(ta.lookAt(ea,V,ft)),s.quaternion.multiply(Y),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(fe),s.visible=this.dragging):(s.quaternion.copy(r),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(V.copy(Jt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(V.copy(Kt).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(V.copy(ft).applyQuaternion(r).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&(Rn.copy(r),V.copy(this.eye).applyQuaternion(Y.copy(r).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(ta.lookAt(this.eye,ea,ft)),s.name==="X"&&(Y.setFromAxisAngle(Kt,Math.atan2(-V.y,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Y"&&(Y.setFromAxisAngle(ft,Math.atan2(V.x,V.z)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y)),s.name==="Z"&&(Y.setFromAxisAngle(Jt,Math.atan2(V.y,V.x)),Y.multiplyQuaternions(Rn,Y),s.quaternion.copy(Y))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(l){return s.name===l}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(t)}}class q2 extends A{constructor(){super(new Co(1e5,1e5,2,2),new si({visible:!1,wireframe:!0,side:Fo,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),On.copy(Kt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Yt.copy(ft).applyQuaternion(n==="local"?this.worldQuaternion:Dn),Wt.copy(Jt).applyQuaternion(n==="local"?this.worldQuaternion:Dn),V.copy(Yt),this.mode){case"translate":case"scale":switch(this.axis){case"X":V.copy(this.eye).cross(On),_e.copy(On).cross(V);break;case"Y":V.copy(this.eye).cross(Yt),_e.copy(Yt).cross(V);break;case"Z":V.copy(this.eye).cross(Wt),_e.copy(Wt).cross(V);break;case"XY":_e.copy(Wt);break;case"YZ":_e.copy(On);break;case"XZ":V.copy(Wt),_e.copy(Yt);break;case"XYZ":case"E":_e.set(0,0,0);break}break;case"rotate":default:_e.set(0,0,0)}_e.length()===0?this.quaternion.copy(this.cameraQuaternion):(na.lookAt(fe.set(0,0,0),_e,V),this.quaternion.setFromRotationMatrix(na)),super.updateMatrixWorld(t)}}const O=Symbol("@@iwer/devui/input-scene"),H2=.016;class Z2{constructor(t){const n=t.canvasContainer,r=new zo,i=new No(t.fovy/Math.PI*180,n.offsetWidth/n.offsetHeight,.1,1e3),a=new Ri,s=new Ri;r.add(a),a.add(s),s.position.fromArray(t.position.vec3),s.quaternion.fromArray(t.quaternion.quat),s.add(i),i.position.x-=t.ipd/2;const o=new A(new ce(.1,.1,.1)),l=o.clone();o.position.fromArray(t.controllers.left.position.vec3),o.quaternion.fromArray(t.controllers.left.quaternion.quat),l.position.fromArray(t.controllers.right.position.vec3),l.quaternion.fromArray(t.controllers.right.quaternion.quat),s.attach(o),s.attach(l),o.visible=!1,l.visible=!1;const c=new A(new Do(.25,.27,32),new si({color:16777215,side:$o}));c.rotateX(-Math.PI/2),r.add(c);const u=new Vo({alpha:!0});u.setSize(n.offsetWidth,n.offsetHeight),u.setClearColor(0,0),n.appendChild(u.domElement);const h=new Js(i,u.domElement);h.attach(o),r.add(h);const p=new Js(i,u.domElement);p.attach(l),r.add(p);const g=new ResizeObserver(()=>{this.resize()});g.observe(n);const x=d=>{d.addEventListener("mouseDown",()=>{d.userData.pressStart=performance.now()}),d.addEventListener("mouseUp",()=>{const y=performance.now()-d.userData.pressStart;d.userData.pressStart=null,y<200&&(d.mode==="rotate"?d.setMode("translate"):d.setMode("rotate"))}),d.addEventListener("change",()=>{this.renderScene()})};x(h),x(p);const v=d=>{if(!this[O].isPointerLocked)return;const y=d.movementX||d.mozMovementX||d.webkitMovementX||0,b=d.movementY||d.mozMovementY||d.webkitMovementY||0;a.rotation.y-=y*.002,s.rotation.x-=b*.002,t.quaternion.copy(s.getWorldQuaternion(new Ae)),this.renderScene()};this[O]={canvasContainer:n,renderer:u,scene:r,camera:i,playerRig:a,cameraRig:s,xrDevice:t,controllerIndicators:{left:o,right:l},transformControls:{left:h,right:p},headsetDefaultPosition:s.position.clone(),headsetDefaultQuaternion:s.quaternion.clone(),controllerDefaultPositions:{left:o.position.clone(),right:l.position.clone()},controllerDefaultQuaternions:{left:o.quaternion.clone(),right:l.quaternion.clone()},resizeObserver:g,isPointerLocked:!1,vec3:new z,quat:new Ae,mouseMoveHandler:v,keyState:{ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},movePlayerRig:()=>this.movePlayerRig(),moveInterval:null},document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){this[O].renderer.domElement.requestPointerLock=this[O].renderer.domElement.requestPointerLock||this[O].renderer.domElement.mozRequestPointerLock||this[O].renderer.domElement.webkitRequestPointerLock,this[O].renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this[O].isPointerLocked=document.pointerLockElement===this[O].renderer.domElement||document.mozPointerLockElement===this[O].renderer.domElement||document.webkitPointerLockElement===this[O].renderer.domElement,this[O].isPointerLocked?(document.addEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!1,t.visible=!1})):(document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),Object.values(this[O].transformControls).forEach(t=>{t.enabled=!0,t.visible=!0}))}keyDownHandler(t){const{keyState:n,movePlayerRig:r,moveInterval:i}=this[O];t.code in n&&(n[t.code]=!0),n.ShiftLeft&&(n.KeyW||n.KeyA||n.KeyS||n.KeyD)&&(i||(this[O].moveInterval=window.setInterval(r,16))),n.ShiftLeft&&n.ArrowUp&&(this[O].cameraRig.position.y+=.05,this.renderScene()),n.ShiftLeft&&n.ArrowDown&&(this[O].cameraRig.position.y-=.05,this.renderScene())}keyUpHandler(t){const{keyState:n,moveInterval:r}=this[O];t.code in n&&(n[t.code]=!1),(!n.ShiftLeft||!(n.KeyW||n.KeyA||n.KeyS||n.KeyD))&&r&&(window.clearInterval(r),this[O].moveInterval=null)}movePlayerRig(){const{playerRig:t,keyState:n,vec3:r}=this[O];r.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),r.lengthSq()>0&&(r.normalize().multiplyScalar(H2).applyQuaternion(t.quaternion),t.position.add(r),this.renderScene())}syncFovy(){this[O].camera.fov=this[O].xrDevice.fovy/Math.PI*180,this[O].camera.updateProjectionMatrix()}resetDeviceTransforms(){const{playerRig:t,cameraRig:n,controllerIndicators:r}=this[O];n.position.copy(this[O].headsetDefaultPosition),n.quaternion.set(0,0,0,1),t.position.set(0,0,0),t.quaternion.set(0,0,0,1),Object.entries(r).forEach(([i,a])=>{a.position.copy(this[O].controllerDefaultPositions[i]),a.quaternion.copy(this[O].controllerDefaultQuaternions[i])}),this.syncDeviceTransforms(),this.renderScene()}syncDeviceTransforms(){const{xrDevice:t,cameraRig:n,controllerIndicators:r}=this[O];t.position.copy(n.getWorldPosition(this[O].vec3)),t.quaternion.copy(n.getWorldQuaternion(this[O].quat)),Object.entries(r).forEach(([i,a])=>{t.controllers[i].position.copy(a.getWorldPosition(this[O].vec3)),t.controllers[i].quaternion.copy(a.getWorldQuaternion(this[O].quat))})}renderScene(){this.syncDeviceTransforms(),this[O].renderer.render(this[O].scene,this[O].camera)}get domElement(){return this[O].renderer.domElement}resize(){const t=this[O].canvasContainer.offsetWidth,n=this[O].canvasContainer.offsetHeight;this[O].renderer.setSize(t,n),this[O].camera.aspect=t/n,this[O].camera.updateProjectionMatrix(),this.renderScene()}dispose(){this[O].resizeObserver.disconnect(),this[O].renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this[O].mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const X2=Symbol("@@iwer/devui/devui");class B2{constructor(t){t.ipd=0;const n=t.canvasContainer,r=document.createElement("div");r.style.position="fixed",r.style.width="100%",r.style.height="100%",r.style.top="0",r.style.left="0",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="3",n.appendChild(r);const i=new Z2(t),a=i.domElement;a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.zIndex="2",n.appendChild(a),qo(r).render(f.jsx(Y2,{xrDevice:t,inputLayer:i})),this[X2]={xrDevice:t,inputLayer:i}}}const Y2=({xrDevice:e,inputLayer:t})=>{const[n,r]=D.useState(!1),[i,a]=D.useState(w2),[s,o]=D.useState(!1),[l,c]=D.useState(!1);return D.useEffect(()=>{const u=()=>{const h=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!h)};return document.addEventListener("pointerlockchange",u,!1),document.addEventListener("mozpointerlockchange",u,!1),document.addEventListener("webkitpointerlockchange",u,!1),()=>{document.removeEventListener("pointerlockchange",u,!1),document.removeEventListener("mozpointerlockchange",u,!1),document.removeEventListener("webkitpointerlockchange",u,!1)}},[]),f.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsx(C2,{xrDevice:e,inputLayer:t,keyMapOpen:s,setKeyMapOpen:o,fovSettingOpen:l,setFovSettingOpen:c}),s&&f.jsx(S2,{keyMap:i,setKeyMap:a}),l&&f.jsx(j2,{xrDevice:e,inputLayer:t}),f.jsx(L2,{xrDevice:e,keyMap:i,pointerLocked:n})]})},W2={metaQuest3:C0,metaQuest2:j0,metaQuestPro:_0,oculusQuest1:T0};function G2(e){const t=new A0(W2[e]);t.ipd=0,t.installRuntime(),new B2(t)}export{G2 as emulate}; diff --git a/examples/watch/assets/index-Cajzeqhw.js b/examples/watch/assets/index-KwohaMom.js similarity index 99% rename from examples/watch/assets/index-Cajzeqhw.js rename to examples/watch/assets/index-KwohaMom.js index aeb9616..5c315f8 100644 --- a/examples/watch/assets/index-Cajzeqhw.js +++ b/examples/watch/assets/index-KwohaMom.js @@ -3904,7 +3904,7 @@ No matching component was found for: `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ",`#include vFade = position.z + 0.5;`),e.fragmentShader=`varying float vFade; `+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ",`#include - diffuseColor.a *= vFade;`)}}function c4(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function f4(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,c=`${i}end`,h=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(c,a)}}function h4(n){var e;return n.getButtonsDown().size>0?.6:CI(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Im(n){return n.getButtonsDown().size>0?.6:.4}function d4(n){var e;return CI(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function CI(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function p4(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function RI(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function m4(n,e,t,i){i==null||i.copy(n.matrix);const r=bI(n,i);return r!=null||e==null||t==null?r:(i!=null&&RI(n,e,i),t)}function bI({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??bI(n,e)}const g4="modulepreload",v4=function(n){return"/xr/examples/watch/"+n},Zw={},y4=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(t.map(a=>{if(a=v4(a),a in Zw)return;Zw[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":g4,l||(h.as="script",h.crossOrigin=""),h.href=a,o&&h.setAttribute("nonce",o),document.head.appendChild(h),l)return new Promise((d,p)=>{h.addEventListener("load",d),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}return r.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var _4={BASE_URL:"/xr/examples/watch/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const $w=n=>{let e;const t=new Set,i=(h,d)=>{const p=typeof h=="function"?h(e):h;if(!Object.is(p,e)){const m=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(y=>y(e,m))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(_4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},c=e=n(i,r,l);return l},PI=n=>n?$w(n):$w;function x4(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:c=!1,hitTest:h=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Ts(t,"anchors",m,y),Ts(i,"hand-tracking",m,y),Ts(r,"layers",m,y),Ts(s,"mesh-detection",m,y),Ts(o,"plane-detection",m,y),Ts(c,"depth-sensing",m,y),Ts(p,"dom-overlay",m,y),Ts(h,"hit-test",m,y),n!="immersive-vr"&&Ts(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Ts(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function wo(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&A4(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function A4(n,e){return e in n}function II(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const BI={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function eT(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?y4(()=>import("./emulate-BFmWTp6L.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n===!0?"metaQuest3":n)})}function S4(n){const e=(n==null?void 0:n.emulate)??"metaQuest3";let t;if(e!=!1){window.location.hostname==="localhost"&&eT(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&eT(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=PI(()=>({...BI,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=r4({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=T4(r,o),l=w4(n==null?void 0:n.enterGrantedSession,p=>Mp(i,p,n,d));let c;const h=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>h.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}=n??{};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),c==null||c(),c=E4(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&LI(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({hand:A})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({controller:A})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({transientPointer:A})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({detectedPlane:A})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({detectedMesh:A})},destroy(){t==null||t(),s==null||s(),c==null||c(),l==null||l(),a(void 0,void 0)},enterXR:p=>Mp(i,p,n,d),enterAR:()=>Mp(i,"immersive-ar",n,d),enterVR:()=>Mp(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:A}=r.getState(),_=m.parent??p,v=(d==null?void 0:d.getReferenceSpace())??void 0;A!=_&&(_.xrSpace=v,r.setState({origin:_}));const{originReferenceSpace:S}=r.getState();if(v!=S&&(_.xrSpace=v,r.setState({originReferenceSpace:v})),y==null)return;d!=null&&C4(r,y,d);const M=h.length;for(let w=0;w component?"));const r=await navigator.xr.requestSession(e,x4(e,n,t));return LI(r,(t==null?void 0:t.frameRate)??"high"),M4(i,r,t),r}function M4(n,e,t){if(n==null)return;const i=XRWebGLLayer.getNativeFramebufferScaleFactor(e);let r=t==null?void 0:t.frameBufferScaling;typeof r=="function"&&(r=r(i)),typeof r=="string"&&(r=r==="high"?i:r==="mid"?1:.5),r!=null&&(n==null||n.setFramebufferScaleFactor(r)),n==null||n.setSession(e)}const tT=["immersive-ar","immersive-vr","inline"];function E4(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function w4(n=tT,e){var i;if(n===!1)return;n===!0&&(n=tT);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function T4(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(BI)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function C4(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const c=nT(s,e.detectedPlanes),h=nT(r,e.detectedMeshes);(s!=c||r!=h)&&n.setState({detectedPlanes:c,detectedMeshes:h});const d=a.length;for(let m=0;m{t instanceof jt&&t.material instanceof qt&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function B4(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>L4(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=D4(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function D4(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?iT(n).x:.5;case"yAxis":return i?iT(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const kc=new ce;function iT({xAxis:n=0,yAxis:e=0}){if(kc.lengthSq()>1){const i=Math.atan2(e,n);kc.set(Math.cos(i),Math.sin(i))}else kc.set(n,e);return kc.multiplyScalar(.5).addScalar(.5),kc}function F4({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function N4({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[U4[t]];if(i!=null)return[i]}const U4={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class _i{constructor(e,t,i,r,s,o=s.object,a=o){_t(this,"type");_t(this,"bubbles");_t(this,"nativeEvent");_t(this,"pointer");_t(this,"intersection");_t(this,"currentObject");_t(this,"object");_t(this,"stopPropagation");_t(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new _i(t,i,r,s,o,e,a)}}class QA extends _i{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new QA(r,s,o,e,a)}}function hr(n){DI(n,n.currentObject)}function DI(n,e){if(e==null)return;const t=N4(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];hr(new _i("pointerenter",!1,e,this,i,l))}if(i!=null&&hr(new _i("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}hr(new _i("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&hr(new _i("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&hr(new QA(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function NI(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),NI(n.parent,e,t,i)}function O4(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function $A(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function k4(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function bg(n,e,t,i,r,s=!1,o,a,l){const c=s||F4(n),h=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;k4(c,h??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let A=0;A0)&&(n=c,o=l)}return o}function H4(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Rs=new ch,G4=new Ne,Ql=[];function z4(n,e,t,i,r,s,o,a){if(o!=null)return V4(n,e,o);let l,c;if(bg(t,i,r,s,(h,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(dy.origin.copy(r).applyMatrix4(n),dy.direction.copy(s).applyMatrix4(n).sub(Rs.ray.origin).normalize(),dy.intersectPlane(t,sT)!=null)return sT.clone()}}const py=new ch,my=new L,oT=new kr,X4=new Ne,Ep=[];function J4(n,e,t,i,r,s,o,a,l){if(a!=null)return j4(n,e,t,a);let c,h;if(py.ray.origin.copy(n),py.ray.direction.copy(t).applyQuaternion(e),bg(i,r,s,o,(d,p)=>{d.raycast(py,Ep);const m=eS(c,h,Ep,p,l);m!=null&&(c=Ep[m],h=p),Ep.length=0}),c!=null)return Object.assign(c,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:c.point,localPoint:c.point.clone().applyMatrix4(X4.copy(c.object.matrixWorld).invert())})}const aT=new jo;function j4(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;my.copy(t).applyQuaternion(e),aT.set(n,my),$A(oT,i,r);const s=aT.intersectPlane(oT,new L)??i.point;return{...i,object:r,pointOnFace:s,point:my.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const gy=new bn,wp=[];function UI(n,e,t,i,r,s,o,a,l){if(a!=null)return Q4(n,e,a);let c,h;if(gy.center.copy(n),gy.radius=t,bg(i,r,s,o,(d,p)=>{Y4(gy,d,wp);const m=eS(c,h,wp,p,l);m!=null&&(c=wp[m],h=p),wp.length=0}),c!=null)return Object.assign(c,{details:{type:"sphere"},pointOnFace:c.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:c.point.clone().applyMatrix4(Bm.copy(c.object.matrixWorld).invert())})}const Tp=new Ne;function K4(n){return"spherecast"in n}function Y4(n,e,t){if(e.updateWorldMatrix(!0,!1),K4(e)){e.spherecast(n,t);return}if(e instanceof rh){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;vy.max(q4);const o=Mu.center.clone().sub(hT);o.divide(vy),Z4(o);const a=Cp.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function Z4(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const ux={radius:.07};function $4(n,e,t=ux,i="grab"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),UI(r,s,t.radius??ux.radius,a,o,i,e,c,t)},void 0,void 0,void 0,t)}const eV=new L(0,0,-1),tV=new L,Qc={direction:eV,minDistance:0,linePoints:null};function nV(n,e,t=Qc,i="ray"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h==null)return;h.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Qc.linePoints;if(p==null?(r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),d=J4(r,s,t.direction??Qc.direction,a,o,i,e,c,t)):d=z4(h.matrixWorld,p,a,o,i,e,c,t),!(d==null||d.distance*h.getWorldScale(tV).x<(t.minDistance??Qc.minDistance)))return d},void 0,void 0,void 0,t)}const Eu={button:0,downRadius:.03,hoverRadius:.1};function iV(n,e,t=Eu,i="touch"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),UI(r,s,t.hoverRadius??Eu.hoverRadius,a,o,i,e,c,t)},rV(t),void 0,void 0,t)}function rV(n=Eu){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=sV(i,n.downRadius??Eu.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??Eu.button};r?t.down(s):t.up(s),e=r}}function sV(n,e){return n==null?!1:n.distance<=e}let oV=23412;function tS(){return oV++}new L;new ce;let aV=class{constructor(){_t(this,"pointers",[]);_t(this,"isDefaults",[]);_t(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new rt;return t.setIndex(new it(n.indices,1)),t.setAttribute("position",new it(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function mT(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(lV(n.polygon),{createdAt:n.lastChangedTime})}const Gc=new qP,Rp=new ce;function lV(n){const e=new Oo,t=n.map(({x:r,z:s})=>new ce(r,s));Gc.setFromPoints(t),Gc.getSize(Rp);for(const r of t)r.sub(Gc.min),r.divide(Rp);e.setFromPoints(t);const i=new lh(e);return i.scale(Rp.x,Rp.y,1),i.translate(Gc.min.x,Gc.min.y,0),i.rotateX(Math.PI/2),i}new L;new L;new L;var uV=Object.defineProperty,cV=(n,e,t)=>e in n?uV(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Nt=(n,e,t)=>(cV(n,typeof e!="symbol"?e+"":e,t),t);function yy(n,e,t,i,r){let s;if(n=n.subarray||n.slice?n:n.buffer,t=t.subarray||t.slice?t:t.buffer,n=e?n.subarray?n.subarray(e,r&&e+r):n.slice(e,r&&e+r):n,t.set)t.set(n,i);else for(s=0;s{const t=Array.isArray(e);return e instanceof L?[e.x,e.y,e.z]:e instanceof ce?[e.x,e.y,0]:t&&e.length===3?[e[0],e[1],e[2]]:t&&e.length===2?[e[0],e[1],0]:e}).flat()}class hV extends rt{constructor(){super(),Nt(this,"type","MeshLine"),Nt(this,"isMeshLine",!0),Nt(this,"positions",[]),Nt(this,"previous",[]),Nt(this,"next",[]),Nt(this,"side",[]),Nt(this,"width",[]),Nt(this,"indices_array",[]),Nt(this,"uvs",[]),Nt(this,"counters",[]),Nt(this,"widthCallback",null),Nt(this,"_attributes"),Nt(this,"_points",[]),Nt(this,"points"),Nt(this,"matrixWorld",new Ne),Object.defineProperties(this,{points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setPoints(e,t){if(e=fV(e),this._points=e,this.widthCallback=t??null,this.positions=[],this.counters=[],e.length&&e[0]instanceof L)for(let i=0;i0&&(i=this.copyV3(r),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]))}this.compareV3(e-1,0)?i=this.copyV3(1):i=this.copyV3(e-1),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]),!this._attributes||this._attributes.position.count!==this.counters.length?this._attributes={position:new it(new Float32Array(this.positions),3),previous:new it(new Float32Array(this.previous),3),next:new it(new Float32Array(this.next),3),side:new it(new Float32Array(this.side),1),width:new it(new Float32Array(this.width),1),uv:new it(new Float32Array(this.uvs),2),index:new it(new Uint16Array(this.indices_array),1),counters:new it(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:i}){const r=this._attributes.position.array,s=this._attributes.previous.array,o=this._attributes.next.array,a=r.length;yy(r,0,s,0,a),yy(r,6,r,0,a-6),r[a-6]=e,r[a-5]=t,r[a-4]=i,r[a-3]=e,r[a-2]=t,r[a-1]=i,yy(r,6,o,0,a-6),o[a-6]=e,o[a-5]=t,o[a-4]=i,o[a-3]=e,o[a-2]=t,o[a-1]=i,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}}const dV=` + diffuseColor.a *= vFade;`)}}function c4(n,e,t,i){if(!t.getEnabled()){n.visible=!1;return}n.visible=!0;const r=t.getIntersection(),s=typeof i.color=="function"?i.color(t):i.color;Array.isArray(s)?e.color.set(...s):e.color.set(s??"white"),e.opacity=typeof i.opacity=="function"?i.opacity(t):i.opacity??.4;let o=i.maxLength??1;r!=null&&(o=Math.min(o,r.distance)),n.position.z=-o/2;const a=i.size??.005;n.scale.set(a,a,o),n.updateMatrix()}function f4(n,e,t,i,r,s={}){const o=d=>{d.inputSource===t&&n.down(Object.assign(d,{button:s.button??0}))},a=d=>{d.inputSource===t&&n.up(Object.assign(d,{button:s.button??0}))},l=`${i}start`,c=`${i}end`,h=r.length;for(let d=0;d{e.removeEventListener(l,o),e.removeEventListener(c,a)}}function h4(n){var e;return n.getButtonsDown().size>0?.6:CI(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.07,0,.2,.4)}function Im(n){return n.getButtonsDown().size>0?.6:.4}function d4(n){var e;return CI(((e=n.getIntersection())==null?void 0:e.distance)??1/0,.1,.03,.2,.6)}function CI(n,e,t,i,r){return i+Math.max(0,Math.min(1,(n-e)/(t-e)))*(r-i)}function p4(n,e){return(t,i)=>{if(n===e)return t.identity(),!0;const r=typeof e=="function"?e():e;if(r==null)return!1;const s=i==null?void 0:i.getPose(n,r);return s==null?!1:(t.fromArray(s.transform.matrix),!0)}}function RI(n,e,t){if(e==null){t.copy(n.matrixWorld);return}t.copy(e.matrixWorld).invert().multiply(n.matrixWorld)}function m4(n,e,t,i){i==null||i.copy(n.matrix);const r=bI(n,i);return r!=null||e==null||t==null?r:(i!=null&&RI(n,e,i),t)}function bI({parent:n},e){if(n!=null)return e!=null&&e.premultiply(n.matrix),n.xrSpace??bI(n,e)}const g4="modulepreload",v4=function(n){return"/xr/examples/watch/"+n},Zw={},y4=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(t.map(a=>{if(a=v4(a),a in Zw)return;Zw[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":g4,l||(h.as="script",h.crossOrigin=""),h.href=a,o&&h.setAttribute("nonce",o),document.head.appendChild(h),l)return new Promise((d,p)=>{h.addEventListener("load",d),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}return r.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var _4={BASE_URL:"/xr/examples/watch/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const $w=n=>{let e;const t=new Set,i=(h,d)=>{const p=typeof h=="function"?h(e):h;if(!Object.is(p,e)){const m=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(y=>y(e,m))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(_4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},c=e=n(i,r,l);return l},PI=n=>n?$w(n):$w;function x4(n,e,{anchors:t=!0,handTracking:i=!0,layers:r=!0,meshDetection:s=!0,planeDetection:o=!0,originReferenceSpace:a="local-floor",customSessionInit:l,depthSensing:c=!1,hitTest:h=!0,unbounded:d=!0,domOverlay:p=!0}={}){if(l!=null)return l;const m=[a],y=[];return p instanceof Element&&(p=!0),Ts(t,"anchors",m,y),Ts(i,"hand-tracking",m,y),Ts(r,"layers",m,y),Ts(s,"mesh-detection",m,y),Ts(o,"plane-detection",m,y),Ts(c,"depth-sensing",m,y),Ts(p,"dom-overlay",m,y),Ts(h,"hit-test",m,y),n!="immersive-vr"&&Ts(d,"unbounded",m,y),{requiredFeatures:m,optionalFeatures:y,domOverlay:{root:e}}}function Ts(n,e,t,i){if(n!==!1){if(n===!0){i.push(e);return}t.push(e)}}function wo(n,e,t){return typeof n=="function"?n:(typeof n=="object"&&(e!=null&&A4(n,e)?n=n[e]:"default"in n&&(n=n.default)),n===!1?!1:n===!0?t:n??t)}function A4(n,e){return e in n}function II(n,e,t){return n??(n=t),n===!1?!1:typeof n=="function"?n:e!=null&&e in n?n[e]??t:"default"in n?n.default??t:n}const BI={session:void 0,originReferenceSpace:void 0,visibilityState:void 0,mode:null,frameRate:void 0,handStates:[],controllerStates:[],transientPointerStates:[],gazeStates:[],screenInputStates:[],detectedMeshes:[],detectedPlanes:[]};function eT(n,e){var t,i;Promise.all([(t=navigator.xr)==null?void 0:t.isSessionSupported("immersive-vr"),(i=navigator.xr)==null?void 0:i.isSessionSupported("immersive-ar")]).then(([r,s])=>!s&&!r?y4(()=>import("./emulate-B7RWhoU8.js"),[]):void 0).then(r=>{e&&window.alert("emulator started"),r==null||r.emulate(n===!0?"metaQuest3":n)})}function S4(n){const e=(n==null?void 0:n.emulate)??"metaQuest3";let t;if(e!=!1){window.location.hostname==="localhost"&&eT(e,!1);const p=m=>{m.altKey&&m.metaKey&&m.code==="KeyE"&&eT(e,!0)};window.addEventListener("keydown",p),t=()=>window.removeEventListener("keydown",p)}const i=(n==null?void 0:n.domOverlay)instanceof HTMLElement?n.domOverlay:document.createElement("div"),r=PI(()=>({...BI,controller:n==null?void 0:n.controller,hand:n==null?void 0:n.hand,gaze:n==null?void 0:n.gaze,screenInput:n==null?void 0:n.screenInput,transientPointer:n==null?void 0:n.transientPointer,detectedMesh:n==null?void 0:n.detectedMesh,detectedPlane:n==null?void 0:n.detectedPlane,domOverlayRoot:i}));let s;if(i.parentNode==null){const p=y=>{i.style.display=y.session!=null?"block":"none"},m=r.subscribe(p);p(r.getState()),document.body.appendChild(i),s=()=>{i.remove(),m()}}document.body.append(i);const o=r4({controller:p=>r.setState({controllerStates:[...r.getState().controllerStates,p]})},n),a=T4(r,o),l=w4(n==null?void 0:n.enterGrantedSession,p=>Mp(i,p,n,d));let c;const h=[];let d;return Object.assign(r,{requestFrame(){return new Promise(p=>h.push(p))},setWebXRManager(p){if(d===p)return;d=p;const{foveation:m,originReferenceSpace:y="local-floor"}=n??{};p.setReferenceSpaceType(y),m!=null&&p.setFoveation(m),c==null||c(),c=E4(p,a)},setFrameRate(p){const{session:m}=r.getState();m!=null&&LI(m,p)},setHand(p,m){if(m==null){r.setState({hand:p});return}const y=r.getState().hand,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({hand:A})},setController(p,m){if(m==null){r.setState({controller:p});return}const y=r.getState().controller,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({controller:A})},setTransientPointer(p,m){if(m==null){r.setState({transientPointer:p});return}const y=r.getState().transientPointer,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({transientPointer:A})},setGaze(p){r.setState({gaze:p})},setScreenInput(p){r.setState({screenInput:p})},setDetectedPlane(p,m){if(m==null){r.setState({detectedPlane:p});return}const y=r.getState().detectedPlane,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({detectedPlane:A})},setDetectedMesh(p,m){if(m==null){r.setState({detectedMesh:p});return}const y=r.getState().detectedMesh,A={};typeof y=="object"&&Object.assign(A,y),Object.assign(A,{default:wo(y,void 0,{}),[m]:p}),r.setState({detectedMesh:A})},destroy(){t==null||t(),s==null||s(),c==null||c(),l==null||l(),a(void 0,void 0)},enterXR:p=>Mp(i,p,n,d),enterAR:()=>Mp(i,"immersive-ar",n,d),enterVR:()=>Mp(i,"immersive-vr",n,d),onBeforeFrame(p,m,y){const{origin:A}=r.getState(),_=m.parent??p,v=(d==null?void 0:d.getReferenceSpace())??void 0;A!=_&&(_.xrSpace=v,r.setState({origin:_}));const{originReferenceSpace:S}=r.getState();if(v!=S&&(_.xrSpace=v,r.setState({originReferenceSpace:v})),y==null)return;d!=null&&C4(r,y,d);const M=h.length;for(let w=0;w component?"));const r=await navigator.xr.requestSession(e,x4(e,n,t));return LI(r,(t==null?void 0:t.frameRate)??"high"),M4(i,r,t),r}function M4(n,e,t){if(n==null)return;const i=XRWebGLLayer.getNativeFramebufferScaleFactor(e);let r=t==null?void 0:t.frameBufferScaling;typeof r=="function"&&(r=r(i)),typeof r=="string"&&(r=r==="high"?i:r==="mid"?1:.5),r!=null&&(n==null||n.setFramebufferScaleFactor(r)),n==null||n.setSession(e)}const tT=["immersive-ar","immersive-vr","inline"];function E4(n,e){const t=()=>{const i=n.getSession();e(i,i.environmentBlendMode==="opaque"?"immersive-vr":"immersive-ar")};return n.addEventListener("sessionstart",t),()=>n.removeEventListener("sessionstart",t)}function w4(n=tT,e){var i;if(n===!1)return;n===!0&&(n=tT);const t=async()=>{var r;for(const s of n)await((r=navigator.xr)==null?void 0:r.isSessionSupported(s))&&e(s)};return(i=navigator.xr)==null||i.addEventListener("sessiongranted",t),()=>{var r;return(r=navigator.xr)==null?void 0:r.removeEventListener("sessiongranted",t)}}function T4(n,e){let t;return(i,r)=>{if(t==null||t(),i==null||r==null)return;const s=l=>n.setState(e(l.session,n.getState(),l.added,l.removed));i.addEventListener("inputsourceschange",s);const o=()=>n.setState({frameRate:i.frameRate,visibilityState:i.visibilityState}),a=()=>{t==null||t(),t=void 0,n.setState(BI)};i.addEventListener("end",a),i.addEventListener("frameratechange",o),i.addEventListener("visibilitychange",o),n.setState({...e(i,void 0,i.inputSources,void 0),frameRate:i.frameRate,visibilityState:i.visibilityState,detectedMeshes:[],detectedPlanes:[],mode:r,session:i}),t=()=>{e(i,n.getState(),void 0,"all"),i.removeEventListener("end",a),i.removeEventListener("frameratechange",o),i.removeEventListener("visibilitychange",o),i.removeEventListener("inputsourceschange",s)}}}function C4(n,e,t){const i=t.getReferenceSpace(),{detectedMeshes:r,detectedPlanes:s,session:o,controllerStates:a,handStates:l}=n.getState();if(i==null||o==null)return;const c=nT(s,e.detectedPlanes),h=nT(r,e.detectedMeshes);(s!=c||r!=h)&&n.setState({detectedPlanes:c,detectedMeshes:h});const d=a.length;for(let m=0;m{t instanceof jt&&t.material instanceof qt&&(t.material.colorWrite=(e==null?void 0:e.colorWrite)??!0)})}function B4(n,e,t){const i=[];for(const r in e.components){const s=e.components[r];let o=t[r];o==null&&(t[r]=o={state:"default"}),i.push(...Object.values(s.visualResponses).map(a=>L4(n,o,a)))}return()=>{const r=i.length;for(let s=0;s{};if(t.valueNodeProperty==="visibility")return()=>i.visible=t.states.includes(e.state);const r=n.getObjectByName(t.minNodeName),s=n.getObjectByName(t.maxNodeName);return r==null||s==null?()=>{}:()=>{const o=D4(e,t);i.quaternion.slerpQuaternions(r.quaternion,s.quaternion,o),i.position.lerpVectors(r.position,s.position,o),i.updateMatrix()}}function D4(n,{componentProperty:e,states:t}){const i=t.includes(n.state);switch(e){case"xAxis":return i?iT(n).x:.5;case"yAxis":return i?iT(n).y:.5;case"button":return i?n.button??0:0;case"state":return i?1:0}}const kc=new ce;function iT({xAxis:n=0,yAxis:e=0}){if(kc.lengthSq()>1){const i=Math.atan2(e,n);kc.set(Math.cos(i),Math.sin(i))}else kc.set(n,e);return kc.multiplyScalar(.5).addScalar(.5),kc}function F4({_listeners:n,__r3f:e}){return n!=null&&Object.keys(n).length>0||e!=null&&(e==null?void 0:e.eventCount)>0}function N4({_listeners:n,__r3f:e},t){if(n!=null&&t in n)return n[t];if(e==null)return;const i=e.handlers[U4[t]];if(i!=null)return[i]}const U4={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"};class _i{constructor(e,t,i,r,s,o=s.object,a=o){_t(this,"type");_t(this,"bubbles");_t(this,"nativeEvent");_t(this,"pointer");_t(this,"intersection");_t(this,"currentObject");_t(this,"object");_t(this,"stopPropagation");_t(this,"stopImmediatePropagation");this.type=e,this.bubbles=t,this.nativeEvent=i,this.pointer=r,this.intersection=s,this.currentObject=o,this.object=a}get pointerId(){return this.pointer.id}get pointerType(){return this.pointer.type}get pointerState(){return this.pointer.state}get timeStamp(){return this.nativeEvent.timeStamp}get button(){return this.nativeEvent.button}get shiftKey(){return this.nativeEvent.shiftKey??!1}get metaKey(){return this.nativeEvent.metaKey??!1}get ctrlKey(){return this.nativeEvent.ctrlKey??!1}get altKey(){return this.nativeEvent.altKey??!1}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new _i(t,i,r,s,o,e,a)}}class QA extends _i{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,i,r,s){super("wheel",!0,e,t,i,r,s)}retarget(e){const{type:t,bubbles:i,nativeEvent:r,pointer:s,intersection:o,target:a}=this;return new QA(r,s,o,e,a)}}function hr(n){DI(n,n.currentObject)}function DI(n,e){if(e==null)return;const t=N4(e,n.type);let i=!n.bubbles;if(t!=null&&t.length>0){const r=n.retarget(e),s=t.length;r.stopPropagation=()=>i=!0;let o=!1;r.stopImmediatePropagation=()=>{i=!0,o=!0};for(let a=0;a=0;a--){const l=this.pointerEnteredHelper[a];hr(new _i("pointerenter",!1,e,this,i,l))}if(i!=null&&hr(new _i("pointermove",!0,e,this,i)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved){this.wasMoved=!0;const a=this.onFirstMove.length;for(let l=0;li){a.set(e.button,e.timeStamp);return}hr(new _i("dblclick",!0,e,this,this.intersection)),a.delete(e.button)}cancel(e){if(this.enabled){if(!this.wasMoved){this.onFirstMove.push(this.cancel.bind(this,e));return}this.intersection!=null&&hr(new _i("pointercancel",!0,e,this,this.intersection))}}wheel(e,t,i){if(!this.enabled)return;let r=this.intersection;if(i||(r=this.computeIntersection(e,t,this.pointerCapture)),!this.wasMoved&&i){this.onFirstMove.push(this.cancel.bind(this,t));return}r!=null&&hr(new QA(t,this,r))}exit(e){var t;if(!this.wasMoved){this.onFirstMove.push(this.exit.bind(this,e));return}this.pointerCapture!=null&&((t=this.parentReleasePointerCapture)==null||t.call(this),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e)}}function NI(n,e,t,i){if(n==null)return;const r=t.indexOf(n);r!=-1?t.splice(r,1):i.push(n),e.push(n),NI(n.parent,e,t,i)}function O4(n,e,t,i,r){if(e==null)return!1;const s=e.get(t);return!(s==null||i-s>r||s!=n.get(t))}function $A(n,e,t){return e.face==null?!1:(n.setFromNormalAndCoplanarPoint(e.face.normal,e.localPoint),n.applyMatrix4(t.matrixWorld),!0)}function k4(n,e,t,i,r,s){if(e==="none"||e==="listener"&&!n)return!1;if(t==="all")return!0;if(typeof t=="function")return t(i,r,s);let o,a;"deny"in t?(a=!0,o=t.deny):(a=!1,o=t.allow);let l;return Array.isArray(o)?l=o.includes(r):l=o===r,a?!l:l}function bg(n,e,t,i,r,s=!1,o,a,l){const c=s||F4(n),h=n.pointerEvents??o,d=n.pointerEventsType??a,p=n.pointerEventsOrder??l;k4(c,h??"listener",d??"all",e,t,i)&&r(n,p);const y=n.children.length;for(let A=0;A0)&&(n=c,o=l)}return o}function H4(n,e=0,t,i=0){return e!=i?i-e:n.distance-t.distance}const Rs=new ch,G4=new Ne,Ql=[];function z4(n,e,t,i,r,s,o,a){if(o!=null)return V4(n,e,o);let l,c;if(bg(t,i,r,s,(h,d)=>{let p=0;const m=((l==null?void 0:l.details.lineIndex)??e.length-2)+2;for(let y=1;y0;i--){const r=e[i-1],s=e[i];if(dy.origin.copy(r).applyMatrix4(n),dy.direction.copy(s).applyMatrix4(n).sub(Rs.ray.origin).normalize(),dy.intersectPlane(t,sT)!=null)return sT.clone()}}const py=new ch,my=new L,oT=new kr,X4=new Ne,Ep=[];function J4(n,e,t,i,r,s,o,a,l){if(a!=null)return j4(n,e,t,a);let c,h;if(py.ray.origin.copy(n),py.ray.direction.copy(t).applyQuaternion(e),bg(i,r,s,o,(d,p)=>{d.raycast(py,Ep);const m=eS(c,h,Ep,p,l);m!=null&&(c=Ep[m],h=p),Ep.length=0}),c!=null)return Object.assign(c,{details:{type:"ray"},pointerPosition:n.clone(),pointerQuaternion:e.clone(),pointOnFace:c.point,localPoint:c.point.clone().applyMatrix4(X4.copy(c.object.matrixWorld).invert())})}const aT=new jo;function j4(n,e,t,{intersection:i,object:r}){if(i.details.type!="ray")return;my.copy(t).applyQuaternion(e),aT.set(n,my),$A(oT,i,r);const s=aT.intersectPlane(oT,new L)??i.point;return{...i,object:r,pointOnFace:s,point:my.clone().multiplyScalar(i.distance).add(n),pointerPosition:n.clone(),pointerQuaternion:e.clone()}}const gy=new bn,wp=[];function UI(n,e,t,i,r,s,o,a,l){if(a!=null)return Q4(n,e,a);let c,h;if(gy.center.copy(n),gy.radius=t,bg(i,r,s,o,(d,p)=>{Y4(gy,d,wp);const m=eS(c,h,wp,p,l);m!=null&&(c=wp[m],h=p),wp.length=0}),c!=null)return Object.assign(c,{details:{type:"sphere"},pointOnFace:c.point,pointerPosition:n.clone(),pointerQuaternion:e.clone(),localPoint:c.point.clone().applyMatrix4(Bm.copy(c.object.matrixWorld).invert())})}const Tp=new Ne;function K4(n){return"spherecast"in n}function Y4(n,e,t){if(e.updateWorldMatrix(!0,!1),K4(e)){e.spherecast(n,t);return}if(e instanceof rh){e.geometry.boundingSphere==null&&e.geometry.computeBoundingSphere(),e.geometry.boundingBox==null&&e.geometry.computeBoundingBox();for(let r=0;rn.radius*n.radius)return;vy.max(q4);const o=Mu.center.clone().sub(hT);o.divide(vy),Z4(o);const a=Cp.clone();return{distance:Math.sqrt(s),face:{a:0,b:0,c:0,materialIndex:0,normal:o},normal:o,point:a,instanceId:i,object:e}}function Z4(n){const e=Math.abs(n.x),t=Math.abs(n.y),i=Math.abs(n.z);if(e>=t&&e>=i){n.set(n.x<0?-1:1,0,0);return}if(t>=e&&t>=i){n.set(0,n.y<0?-1:1,0);return}n.set(0,0,n.z<0?-1:1)}const ux={radius:.07};function $4(n,e,t=ux,i="grab"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),UI(r,s,t.radius??ux.radius,a,o,i,e,c,t)},void 0,void 0,void 0,t)}const eV=new L(0,0,-1),tV=new L,Qc={direction:eV,minDistance:0,linePoints:null};function nV(n,e,t=Qc,i="ray"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h==null)return;h.updateWorldMatrix(!0,!1);let d;const p=t.linePoints??Qc.linePoints;if(p==null?(r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),d=J4(r,s,t.direction??Qc.direction,a,o,i,e,c,t)):d=z4(h.matrixWorld,p,a,o,i,e,c,t),!(d==null||d.distance*h.getWorldScale(tV).x<(t.minDistance??Qc.minDistance)))return d},void 0,void 0,void 0,t)}const Eu={button:0,downRadius:.03,hoverRadius:.1};function iV(n,e,t=Eu,i="touch"){const r=new L,s=new Vt,o=tS();return new ZA(o,i,e,(a,l,c)=>{const h=n.current;if(h!=null)return h.updateWorldMatrix(!0,!1),r.setFromMatrixPosition(h.matrixWorld),s.setFromRotationMatrix(h.matrixWorld),UI(r,s,t.hoverRadius??Eu.hoverRadius,a,o,i,e,c,t)},rV(t),void 0,void 0,t)}function rV(n=Eu){let e=!1;return t=>{if(!t.getEnabled())return;const i=t.getIntersection(),r=sV(i,n.downRadius??Eu.downRadius);if(r===e)return;const s={timeStamp:performance.now(),button:n.button??Eu.button};r?t.down(s):t.up(s),e=r}}function sV(n,e){return n==null?!1:n.distance<=e}let oV=23412;function tS(){return oV++}new L;new ce;let aV=class{constructor(){_t(this,"pointers",[]);_t(this,"isDefaults",[]);_t(this,"enabled",!0)}register(e,t){return this.pointers.push(e),this.isDefaults.push(t),this.unregister.bind(this,e)}unregister(e){const t=this.pointers.indexOf(e);t!==-1&&(this.isDefaults.splice(t,1),this.pointers.splice(t,1))}move(e,t){var o,a;if(!this.enabled)return;const i=this.pointers.length;if(i===0)return;for(let l=0;l=n.lastChangedTime)return e;const t=new rt;return t.setIndex(new it(n.indices,1)),t.setAttribute("position",new it(n.vertices,3)),Object.assign(t,{creationTime:n.lastChangedTime})}function mT(n,e){return e!=null&&e.createdAt!=null&&e.createdAt>=n.lastChangedTime?e:Object.assign(lV(n.polygon),{createdAt:n.lastChangedTime})}const Gc=new qP,Rp=new ce;function lV(n){const e=new Oo,t=n.map(({x:r,z:s})=>new ce(r,s));Gc.setFromPoints(t),Gc.getSize(Rp);for(const r of t)r.sub(Gc.min),r.divide(Rp);e.setFromPoints(t);const i=new lh(e);return i.scale(Rp.x,Rp.y,1),i.translate(Gc.min.x,Gc.min.y,0),i.rotateX(Math.PI/2),i}new L;new L;new L;var uV=Object.defineProperty,cV=(n,e,t)=>e in n?uV(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Nt=(n,e,t)=>(cV(n,typeof e!="symbol"?e+"":e,t),t);function yy(n,e,t,i,r){let s;if(n=n.subarray||n.slice?n:n.buffer,t=t.subarray||t.slice?t:t.buffer,n=e?n.subarray?n.subarray(e,r&&e+r):n.slice(e,r&&e+r):n,t.set)t.set(n,i);else for(s=0;s{const t=Array.isArray(e);return e instanceof L?[e.x,e.y,e.z]:e instanceof ce?[e.x,e.y,0]:t&&e.length===3?[e[0],e[1],e[2]]:t&&e.length===2?[e[0],e[1],0]:e}).flat()}class hV extends rt{constructor(){super(),Nt(this,"type","MeshLine"),Nt(this,"isMeshLine",!0),Nt(this,"positions",[]),Nt(this,"previous",[]),Nt(this,"next",[]),Nt(this,"side",[]),Nt(this,"width",[]),Nt(this,"indices_array",[]),Nt(this,"uvs",[]),Nt(this,"counters",[]),Nt(this,"widthCallback",null),Nt(this,"_attributes"),Nt(this,"_points",[]),Nt(this,"points"),Nt(this,"matrixWorld",new Ne),Object.defineProperties(this,{points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setPoints(e,t){if(e=fV(e),this._points=e,this.widthCallback=t??null,this.positions=[],this.counters=[],e.length&&e[0]instanceof L)for(let i=0;i0&&(i=this.copyV3(r),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]))}this.compareV3(e-1,0)?i=this.copyV3(1):i=this.copyV3(e-1),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]),!this._attributes||this._attributes.position.count!==this.counters.length?this._attributes={position:new it(new Float32Array(this.positions),3),previous:new it(new Float32Array(this.previous),3),next:new it(new Float32Array(this.next),3),side:new it(new Float32Array(this.side),1),width:new it(new Float32Array(this.width),1),uv:new it(new Float32Array(this.uvs),2),index:new it(new Uint16Array(this.indices_array),1),counters:new it(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:i}){const r=this._attributes.position.array,s=this._attributes.previous.array,o=this._attributes.next.array,a=r.length;yy(r,0,s,0,a),yy(r,6,r,0,a-6),r[a-6]=e,r[a-5]=t,r[a-4]=i,r[a-3]=e,r[a-2]=t,r[a-1]=i,yy(r,6,o,0,a-6),o[a-6]=e,o[a-5]=t,o[a-4]=i,o[a-3]=e,o[a-2]=t,o[a-1]=i,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}}const dV=` #include #include #include @@ -4017,7 +4017,7 @@ No matching component was found for: #include #include <${mV}> } -`;class vV extends Er{constructor(e){super({uniforms:{...be.fog,lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new we(16777215)},gradient:{value:[new we(16711680),new we(65280)]},opacity:{value:1},resolution:{value:new ce(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},useGradient:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new ce(1,1)}},vertexShader:dV,fragmentShader:gV}),Nt(this,"lineWidth"),Nt(this,"map"),Nt(this,"useMap"),Nt(this,"alphaMap"),Nt(this,"useAlphaMap"),Nt(this,"color"),Nt(this,"gradient"),Nt(this,"resolution"),Nt(this,"sizeAttenuation"),Nt(this,"dashArray"),Nt(this,"dashOffset"),Nt(this,"dashRatio"),Nt(this,"useDash"),Nt(this,"useGradient"),Nt(this,"visibility"),Nt(this,"repeat"),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(t){this.uniforms.color.value=t}},gradient:{enumerable:!0,get(){return this.uniforms.gradient.value},set(t){this.uniforms.gradient.value=t}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(t){this.uniforms.useDash.value=t}},useGradient:{enumerable:!0,get(){return this.uniforms.useGradient.value},set(t){this.uniforms.useGradient.value=t}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.gradient=e.gradient,this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray=e.dashArray,this.dashOffset=e.dashOffset,this.dashRatio=e.dashRatio,this.useDash=e.useDash,this.useGradient=e.useGradient,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}}const zc=new ki(0,0,0,"YXZ"),bp=new Vt;function yV(n,e,t){n.matrixWorld.decompose(e.position,bp,e.scale),zc.setFromQuaternion(bp),zc.z=0,zc.x=em(zc.x-10*Math.PI/180,-Math.PI/2,1.1*Math.PI/4),bp.setFromEuler(zc),e.quaternion.slerp(bp,t/100)}function _V(n){return n.userData.teleportTarget===!0}function xV(n={}){return e=>!(!_V(e.object)||n.customFilter!=null&&!n.customFilter(e))}function AV(){return new cg(new L(0,0,0),new L(0,0,-8),new L(0,-20,-15)).getPoints(20)}let SV=class extends jt{constructor(t){const i=new hV,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:c=.4,size:h=.01}=this.options;this.material.lineWidth=h,this.material.opacity=typeof c=="function"?c(t):c;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const Pp=new Ne,Ip=new L,gT=new Vt;async function MV(n,e,t=["point","plane","mesh"]){var l,c;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=m4(e,o.origin,o.originReferenceSpace,Pp)??o.originReferenceSpace,r===o.originReferenceSpace&&RI(e,o.origin,Pp),Ip.setFromMatrixPosition(Pp);const h={...Ip};gT.setFromRotationMatrix(Pp),Ip.set(0,0,-1).applyQuaternion(gT);const d={...Ip};i=new XRRay(h,d)}const a=await((c=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:c.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:EV.bind(null,r,s)}}function EV(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new L(1,1,1);new L(1,1,1);new Ne;new Ne;new L;new L;const OI=new uz,kI="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",wV="generic-trigger";class TV{constructor(e){_t(this,"baseAssetPath");_t(this,"defaultProfileId");_t(this,"profilesListPromise");_t(this,"profilePromisesMap",new Map);_t(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??kI,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??wV}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=vT(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;s!(!_V(e.object)||n.customFilter!=null&&!n.customFilter(e))}function AV(){return new cg(new L(0,0,0),new L(0,0,-8),new L(0,-20,-15)).getPoints(20)}let SV=class extends jt{constructor(t){const i=new hV,r=new Float32Array(t.length*3);for(let a=0;aa.distanceTo(t[l+1]))}update(t){if(!t.getEnabled()||t.getButtonsDown().size===0){this.visible=!1;return}this.visible=!0;const r=t.getIntersection();if((r==null?void 0:r.details.type)!="lines"){this.material.visibility=this.multiplier;return}const{distanceOnLine:s,lineIndex:o}=r.details,a=this.lineLengths[o];this.material.visibility=this.multiplier*(o+s/a)/this.lineLengths.length;const{color:l="white",opacity:c=.4,size:h=.01}=this.options;this.material.lineWidth=h,this.material.opacity=typeof c=="function"?c(t):c;const d=typeof l=="function"?l(t):l;Array.isArray(d)?this.material.color.set(...d):this.material.color.set(d)}};const Pp=new Ne,Ip=new L,gT=new Vt;async function MV(n,e,t=["point","plane","mesh"]){var l,c;let i,r,s;const o=n.getState();if(e instanceof XRSpace)r=e,s=o.origin;else{if(o.originReferenceSpace==null)return;s=e,r=m4(e,o.origin,o.originReferenceSpace,Pp)??o.originReferenceSpace,r===o.originReferenceSpace&&RI(e,o.origin,Pp),Ip.setFromMatrixPosition(Pp);const h={...Ip};gT.setFromRotationMatrix(Pp),Ip.set(0,0,-1).applyQuaternion(gT);const d={...Ip};i=new XRRay(h,d)}const a=await((c=(l=n.getState().session)==null?void 0:l.requestHitTestSource)==null?void 0:c.call(l,{space:r,entityTypes:Array.isArray(t)?t:[t],offsetRay:i}));if(a!=null)return{source:a,getWorldMatrix:EV.bind(null,r,s)}}function EV(n,e,t,i){const r=i.getPose(n);return r==null?!1:(t.fromArray(r.transform.matrix),e!=null&&t.premultiply(e.matrixWorld),!0)}new L(1,1,1);new L(0,0,0);new Ne;new Ne;new L;new L;const OI=new uz,kI="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/",wV="generic-trigger";class TV{constructor(e){_t(this,"baseAssetPath");_t(this,"defaultProfileId");_t(this,"profilesListPromise");_t(this,"profilePromisesMap",new Map);_t(this,"loadAsync",this.load);this.baseAssetPath=(e==null?void 0:e.baseAssetPath)??kI,this.defaultProfileId=(e==null?void 0:e.defaultControllerProfileId)??wV}async load(e,t){const i=await this.loadProfile(e);for(const r in i.layouts)if(r.includes(t))return i.layouts[r];throw new Error(`No matching layout for "${t}", in profile ${i.profileId} with layouts ${Object.keys(i.layouts).join(", ")}.`)}async loadProfile(e){this.profilesListPromise??(this.profilesListPromise=vT(new URL("profilesList.json",this.baseAssetPath).href));const t=await this.profilesListPromise,i=e.length;for(let s=0;s Document - +