PageSourceSearch

https://www.toiletseatfinder.com/assets/emulate-NIz8F2VP.js

js toiletseatfinder.com collected 2026-10-05 20:55:57 UTC 432,128 bytes, 583 lines download raw bytes

1var e=Object.defineProperty,t=(t,i,n)=>((t,i,n)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n)(t,"symbol"!=typeof i?i+"":i,n);import{j as i,c as n,_ as r}from"./index-CK4wdy7g.js";import{P as s}from"./index-Bp6IlKkv.js";import{R as React,y as o}from"./ui-CjgYO4YU.js";import{c as a}from"./react-D4oV46WE.js";import{by as l,am as c,aP as h,J as u,aI as d,aC as f,o as p,a7 as m,j as g,a5 as x,M as v,R as y,aE as w,ao as b,an as E,w as T,h as S,aD as M,bp as A,bi as _,bx as R,ba as P,aH as k,b8 as O,O as L,bE as I,aJ as C,i as N,aq as D,b4 as F,al as j,Q as z}from"./decode-D7yo0njM.js";import{c as B,g as U}from"./MathUtils-9TtT4B9a.js";import{f as V}from"./index-BT7gV4yS.js";import"./vendor-ByGsx0G0.js";import"./modelOrientation-CZVho1sW.js";import"./models-dPssJqBn.js";import"./fit-VAslqU7u.js";import"./QuickLookLink-ClfF3ood.js";const G=()=>{};let W={},$={},q=null,X={mark:G,measure:G};try{"undefined"!=typeof window&&(W=window),"undefined"!=typeof document&&($=document),"undefined"!=typeof MutationObserver&&(q=MutationObserver),"undefined"!=typeof performance&&(X=performance)}catch(ug){}const{userAgent:H=""}=W.navigator||{},Z=W,Y=$,Q=q,K=X;Z.document;const J=!!Y.documentElement&&!!Y.head&&"function"==typeof Y.addEventListener&&"function"==typeof Y.createElement,ee=~H.indexOf("MSIE")||~H.indexOf("Trident/");var te="classic",ie="duotone",ne="sharp",re="sharp-duotone",se=[te,ie,ne,re],oe={fak:"kit","fa-kit":"kit"},ae={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},le={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"}},ce=[1,2,3,4,5,6,7,8,9,10],he=ce.concat([11,12,13,14,15,16,17,18,19,20]),ue={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},de=[...Object.keys({classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]}),"solid","regular","light","thin","duotone","brands","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",ue.GROUP,ue.SWAP_OPACITY,ue.PRIMARY,ue.SECONDARY].concat(ce.map((e=>"".concat(e,"x")))).concat(he.map((e=>"w-".concat(e)))),fe={kit:"fak"},pe={"kit-duotone":"fakd"};const me="___FONT_AWESOME___",ge=16,xe="svg-inline--fa",ve="data-fa-i2svg",ye="data-fa-pseudo-element",we="data-prefix",be="data-icon",Ee="fontawesome-i2svg",Te=["HTML","HEAD","STYLE","SCRIPT"],Se=(()=>{try{return!0}catch(e){return!1}})(),Me=[te,ne,re];function Ae(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[te]})}const _e={...le};_e[te]={...le[te],...oe,...ae};const Re=Ae(_e),Pe={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"}};Pe[te]={...Pe[te],...fe,...pe};const ke=Ae(Pe),Oe={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"}};Oe[te]={...Oe[te],fak:"fa-kit"};const Le=Ae(Oe),Ie={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"}};Ie[te]={...Ie[te],"fa-kit":"fak"};const Ce=Ae(Ie),Ne=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,De="fa-layers-text",Fe=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;
1Ae({classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}});const je=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],ze=ue,Be=new Set;Object.keys(ke[te]).map(Be.add.bind(Be)),Object.keys(ke[ne]).map(Be.add.bind(Be)),Object.keys(ke[re]).map(Be.add.bind(Be));const Ue=["kit",...de],Ve=Z.FontAwesomeConfig||{};if(Y&&"function"==typeof Y.querySelector){[["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((e=>{let[t,i]=e;const n=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=Y.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=n&&(Ve[i]=n)}))}const Ge={styleDefault:"solid",familyDefault:"classic",cssPrefix:"fa",replacementClass:xe,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Ve.familyPrefix&&(Ve.cssPrefix=Ve.familyPrefix);const We={...Ge,...Ve};We.autoReplaceSvg||(We.observeMutations=!1);const $e={};Object.keys(Ge).forEach((e=>{Object.defineProperty($e,e,{enumerable:!0,set:function(t){We[e]=t,qe.forEach((e=>e($e)))},get:function(){return We[e]}})})),Object.defineProperty($e,"familyPrefix",{enumerable:!0,set:function(e){We.cssPrefix=e,qe.forEach((e=>e($e)))},get:function(){return We.cssPrefix}}),Z.FontAwesomeConfig=$e;const qe=[];const Xe=ge,He={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Ze(){let e=12,t="";for(;e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function Ye(e){const t=[];for(let i=(e||[]).length>>>0;i--;)t[i]=e[i];return t}function Qe(e){return e.classList?Ye(e.classList):(e.getAttribute("class")||"").split(" ").filter((e=>e))}function Ke(e){return"".concat(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Je(e){return Object.keys(e||{}).reduce(((t,i)=>t+"".concat(i,": ").concat(e[i].trim(),";")),"")}function et(e){return e.size!==He.size||e.x!==He.x||e.y!==He.y||e.rotate!==He.rotate||e.flipX||e.flipY}function tt(){const e="fa",t=xe,i=$e.cssPrefix,n=$e.replacementClass;let r=':root, :host {\n  --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n  --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n  --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n  --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n  --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n  --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n  --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n  overflow: visible;\n  box-sizing: content-box;\n}\n\n.svg-inline--fa {\n  display: var(--fa-display, inline-block);\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n  vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n  vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n  vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n  vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n  vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-li {\n  width: var(--fa-li-width, 2em);\n  top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n  width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  transform-origin: center center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: var(--fa-counter-background-color, #ff253a);\n  border-radius: var(--fa-counter-border-radius, 1em);\n  box-sizing: border-box;\n  color: var(--fa-inverse, #fff);\n  line-height: var(--fa-counter-line-height, 1);\n  max-width: var(--fa-counter-max-width, 5em);\n  min-width: var(--fa-counter-min-width, 1.5em);\n  overflow: hidden;\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\n  right: var(--fa-right, 0);\n  text-overflow: ellipsis;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-counter-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: var(--fa-bottom, 0);\n  right: var(--fa-right, 0);\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: var(--fa-bottom, 0);\n  left: var(--fa-left, 0);\n  right: auto;\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  top: var(--fa-top, 0);\n  right: var(--fa-right, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: var(--fa-left, 0);\n  right: auto;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top left;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;
1\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-2xs {\n  font-size: 0.625em;\n  line-height: 0.1em;\n  vertical-align: 0.225em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n  line-height: 0.0833333337em;\n  vertical-align: 0.125em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n  line-height: 0.0714285718em;\n  vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n  font-size: 1.25em;\n  line-height: 0.05em;\n  vertical-align: -0.075em;\n}\n\n.fa-xl {\n  font-size: 1.5em;\n  line-height: 0.0416666682em;\n  vertical-align: -0.125em;\n}\n\n.fa-2xl {\n  font-size: 2em;\n  line-height: 0.03125em;\n  vertical-align: -0.1875em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: var(--fa-li-margin, 2.5em);\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: calc(-1 * var(--fa-li-width, 2em));\n  position: absolute;\n  text-align: center;\n  width: var(--fa-li-width, 2em);\n  line-height: inherit;\n}\n\n.fa-border {\n  border-color: var(--fa-border-color, #eee);\n  border-radius: var(--fa-border-radius, 0.1em);\n  border-style: var(--fa-border-style, solid);\n  border-width: var(--fa-border-width, 0.08em);\n  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n  float: left;\n  margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n  float: right;\n  margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n  animation-name: fa-beat;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n  animation-name: fa-bounce;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n  animation-name: fa-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n  animation-name: fa-beat-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n  animation-name: fa-flip;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n  animation-name: fa-shake;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n  animation-name: fa-spin;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 2s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n  --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n  animation-name: fa-spin;\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n    animation-delay: -1ms;\n    animation-duration: 1ms;\n    animation-iteration-count: 1;\n    transition-delay: 0s;\n    transition-duration: 0s;\n  }\n}\n@keyframes fa-beat {\n  0%, 90% {\n    transform: scale(1);\n  }\n  45% {\n    transform: scale(var(--fa-beat-scale, 1.25));\n  }\n}\n@keyframes fa-bounce {\n  0% {\n    transform: scale(1, 1) translateY(0);\n  }\n  10% {\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n  }\n  30% {\n    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));\n  }\n  50% {\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n  }\n  57% {\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n  }\n  64% {\n    transform: scale(1, 1) translateY(0);\n  }\n  100% {\n    transform: scale(1, 1) translateY(0);\n  }\n}\n@keyframes fa-fade {\n  50% {\n    opacity: var(--fa-fade-opacity, 0.4);\n  }\n}\n@keyframes fa-beat-fade {\n  0%, 100% {\n    opacity: var(--fa-beat-fade-opacity, 0.4);\n    transform: scale(1);\n  }\n  50% {\n    opacity: 1;\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\n  }\n}\n@keyframes fa-flip {\n  50% {\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n  }\n}\n@keyframes fa-shake {\n  0% {\n    transform: rotate(-15deg);\n  }\n  4% {\n    transform: rotate(15deg);\n  }\n  8%, 24% {\n    transform: rotate(-18deg);\n  }\n  12%, 28% {\n    transform: rotate(18deg);\n  }\n  16% {\n    transform: rotate(-22deg);\n  }\n  20% {\n    transform: rotate(22deg);\n  }\n  32% {\n    transform: rotate(-12deg);\n  }\n  36% {\n    transform: rotate(12deg);\n  }\n  40%, 100% {\n    transform: rotate(0deg);\n  }\n}\n@keyframes fa-spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  transform: scale(-1, 1);\n}
1\n\n.fa-flip-vertical {\n  transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n  transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n  transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n  display: inline-block;\n  vertical-align: middle;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}';if(i!==e||n!==t){const s=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),a=new RegExp("\\.".concat(t),"g");r=r.replace(s,".".concat(i,"-")).replace(o,"--".concat(i,"-")).replace(a,".".concat(n))}return r}let it=!1;function nt(){$e.autoAddCss&&!it&&(!function(e){if(!e||!J)return;const t=Y.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const i=Y.head.childNodes;let n=null;for(let r=i.length-1;r>-1;r--){const e=i[r],t=(e.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(t)>-1&&(n=e)}Y.head.insertBefore(t,n)}(tt()),it=!0)}var rt={mixout:()=>({dom:{css:tt,insertCss:nt}}),hooks:()=>({beforeDOMElementCreation(){nt()},beforeI2svg(){nt()}})};const st=Z||{};st[me]||(st[me]={}),st[me].styles||(st[me].styles={}),st[me].hooks||(st[me].hooks={}),st[me].shims||(st[me].shims=[]);var ot=st[me];const at=[],lt=function(){Y.removeEventListener("DOMContentLoaded",lt),ct=1,at.map((e=>e()))};let ct=!1;function ht(e){const{tag:t,attributes:i={},children:n=[]}=e;return"string"==typeof e?Ke(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce(((t,i)=>t+"".concat(i,'="').concat(Ke(e[i]),'" ')),"").trim()}(i),">").concat(n.map(ht).join(""),"</").concat(t,">")}function ut(e,t,i){if(e&&e[t]&&e[t][i])return{prefix:t,iconName:i,icon:e[t][i]}}J&&(ct=(Y.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Y.readyState),ct||Y.addEventListener("DOMContentLoaded",lt));var dt=function(e,t,i,n){var r,s,o,a=Object.keys(e),l=a.length,c=t;for(void 0===i?(r=1,o=e[a[0]]):(r=0,o=i);r<l;r++)o=c(o,e[s=a[r]],s,e);return o};function ft(e){const t=function(e){const t=[];let i=0;const n=e.length;for(;i<n;){const r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}(e);return 1===t.length?t[0].toString(16):null}function pt(e){return Object.keys(e).reduce(((t,i)=>{const n=e[i];return!!n.icon?t[n.iconName]=n.icon:t[i]=n,t}),{})}function mt(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:n=!1}=i,r=pt(t);"function"!=typeof ot.hooks.addPack||n?ot.styles[e]={...ot.styles[e]||{},...r}:ot.hooks.addPack(e,pt(t)),"fas"===e&&mt("fa",t)}const{styles:gt,shims:xt}=ot,vt={[te]:Object.values(Le[te]),[ne]:Object.values(Le[ne]),[re]:Object.values(Le[re])};let yt=null,wt={},bt={},Et={},Tt={},St={};const Mt={[te]:Object.keys(Re[te]),[ne]:Object.keys(Re[ne]),[re]:Object.keys(Re[re])};function At(e,t){const i=t.split("-"),n=i[0],r=i.slice(1).join("-");return n!==e||""===r||(s=r,~Ue.indexOf(s))?null:r;var s}const _t=()=>{const e=e=>dt(gt,((t,i,n)=>(t[n]=dt(i,e,{}),t)),{});wt=e(((e,t,i)=>{if(t[3]&&(e[t[3]]=i),t[2]){t[2].filter((e=>
1"number"==typeof e)).forEach((t=>{e[t.toString(16)]=i}))}return e})),bt=e(((e,t,i)=>{if(e[i]=i,t[2]){t[2].filter((e=>"string"==typeof e)).forEach((t=>{e[t]=i}))}return e})),St=e(((e,t,i)=>{const n=t[2];return e[i]=i,n.forEach((t=>{e[t]=i})),e}));const t="far"in gt||$e.autoFetchSvg,i=dt(xt,((e,i)=>{const n=i[0];let r=i[1];const s=i[2];return"far"!==r||t||(r="fas"),"string"==typeof n&&(e.names[n]={prefix:r,iconName:s}),"number"==typeof n&&(e.unicodes[n.toString(16)]={prefix:r,iconName:s}),e}),{names:{},unicodes:{}});Et=i.names,Tt=i.unicodes,yt=It($e.styleDefault,{family:$e.familyDefault})};var Rt;function Pt(e,t){return(wt[e]||{})[t]}function kt(e,t){return(St[e]||{})[t]}function Ot(e){return Et[e]||{prefix:null,iconName:null}}function Lt(){return yt}Rt=e=>{yt=It(e.styleDefault,{family:$e.familyDefault})},qe.push(Rt),_t();function It(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:i=te}=t,n=Re[i][e],r=ke[i][e]||ke[i][n],s=e in ot.styles?e:null;return r||s||null}const Ct={[te]:Object.keys(Le[te]),[ne]:Object.keys(Le[ne]),[re]:Object.keys(Le[re])};function Nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:i=!1}=t,n={[te]:"".concat($e.cssPrefix,"-").concat(te),[ne]:"".concat($e.cssPrefix,"-").concat(ne),[re]:"".concat($e.cssPrefix,"-").concat(re)};let r=null,s=te;const o=se.filter((e=>e!==ie));o.forEach((t=>{(e.includes(n[t])||e.some((e=>Ct[t].includes(e))))&&(s=t)}));const a=e.reduce(((e,t)=>{const a=At($e.cssPrefix,t);if(gt[t]?(t=vt[s].includes(t)?Ce[s][t]:t,r=t,e.prefix=t):Mt[s].indexOf(t)>-1?(r=t,e.prefix=It(t,{family:s})):a?e.iconName=a:t===$e.replacementClass||o.some((e=>t===n[e]))||e.rest.push(t),!i&&e.prefix&&e.iconName){const t="fa"===r?Ot(e.iconName):{},i=kt(e.prefix,e.iconName);t.prefix&&(r=null),e.iconName=t.iconName||i||e.iconName,e.prefix=t.prefix||e.prefix,"far"!==e.prefix||gt.far||!gt.fas||$e.autoFetchSvg||(e.prefix="fas")}return e}),{prefix:null,iconName:null,rest:[]}
1);return(e.includes("fa-brands")||e.includes("fab"))&&(a.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(a.prefix="fad"),a.prefix||s!==ne||!gt.fass&&!$e.autoFetchSvg||(a.prefix="fass",a.iconName=kt(a.prefix,a.iconName)||a.iconName),a.prefix||s!==re||!gt.fasds&&!$e.autoFetchSvg||(a.prefix="fasds",a.iconName=kt(a.prefix,a.iconName)||a.iconName),"fa"!==a.prefix&&"fa"!==r||(a.prefix=Lt()||"fas"),a}let Dt=[],Ft={};const jt={},zt=Object.keys(jt);function Bt(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return(Ft[e]||[]).forEach((e=>{t=e.apply(null,[t,...n])})),t}function Ut(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];(Ft[e]||[]).forEach((e=>{e.apply(null,i)}))}function Vt(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return jt[e]?jt[e].apply(null,t):void 0}function Gt(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const i=e.prefix||Lt();if(t)return t=kt(i,t)||t,ut(Wt.definitions,i,t)||ut(ot.styles,i,t)}const Wt=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.reduce(this._pullDefinitions,{});Object.keys(n).forEach((e=>{this.definitions[e]={...this.definitions[e]||{},...n[e]},mt(e,n[e]);const t=Le[te][e];t&&mt(t,n[e]),_t()}))}reset(){this.definitions={}}_pullDefinitions(e,t){const i=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(i).map((t=>{const{prefix:n,iconName:r,icon:s}=i[t],o=s[2];e[n]||(e[n]={}),o.length>0&&o.forEach((t=>{"string"==typeof t&&(e[n][t]=s)})),e[n][r]=s})),e}},$t={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return J?(Ut("beforeI2svg",e),Vt("pseudoElements2svg",e),Vt("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;var i;!1===$e.autoReplaceSvg&&($e.autoReplaceSvg=!0),$e.observeMutations=!0,i=()=>{Xt({autoReplaceSvgRoot:t}),Ut("watch",e)},J&&(ct?setTimeout(i,0):at.push(i))}},qt={noAuto:()=>{$e.autoReplaceSvg=!1,$e.observeMutations=!1,Ut("noAuto")},config:$e,dom:$t,parse:{icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:kt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],i=It(e[0]);return{prefix:i,iconName:kt(i,t)||t}}if("string"==typeof e&&(e.indexOf("".concat($e.cssPrefix,"-"))>-1||e.match(Ne))){const t=Nt(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||Lt(),iconName:kt(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=Lt();return{prefix:t,iconName:kt(t,e)||e}}}},library:Wt,findIconDefinition:Gt,toHtml:ht},Xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=Y}=e;(Object.keys(ot.styles).length>0||$e.autoFetchSvg)&&J&&$e.autoReplaceSvg&&qt.dom.i2svg({node:t})};function Ht(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((e=>ht(e)))}}),Object.defineProperty(e,"node",{get:function(){if(!J)return;const t=Y.createElement("div");return t.innerHTML=e.html,t.children}}),e}function Zt(e){const{icons:{main:t,mask:i},prefix:n,iconName:r,transform:s,symbol:o,title:a,maskId:l,titleId:c,extra:h,watchable:u=!1}=e,{width:d,height:f}=i.found?i:t,p="fak"===n,m=[$e.replacementClass,r?"".concat($e.cssPrefix,"-").concat(r):""].filter((e=>-1===h.classes.indexOf(e))).filter((e=>""!==e||!!e)).concat(h.classes).join(" ");let g={children:[],attributes:{...h.attributes,"data-prefix":n,"data-icon":r,class:m,role:h.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(f)}};const x=p&&!~h.classes.indexOf("fa-fw")?{width:"".concat(d/f*16*.0625,"em")}:{};u&&(g.attributes[ve]=""),a&&(g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(c||Ze())},children:[a]}),delete g.attributes.title);const v={...g,prefix:n,iconName:r,main:t,mask:i,maskId:l,transform:s,symbol:o,styles:{...x,...h.styles}},{children:y,attributes:w}=i.found&&t.found?Vt("generateAbstractMask",v)||{children:[],attributes:{}}:Vt("generateAbstractIcon",v)||{children:[],attributes:{}};return v.children=y,v.attributes=w,o?function(e){let{prefix:t,iconName:i,children:n,attributes:r,symbol:s}=e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...r,id:!0===s?"".concat(t,"-").concat($e.cssPrefix,"-").concat(i):s},children:n}]}]}(v):function(e){let{children:t,main:i,mask:n,attributes:r,styles:s,transform:o}=e;if(et(o)&&i.found&&!n.found){const{width:e,height:t}=i,n={x:e/t/2,y:.5};r.style=Je({...s,"transform-origin":"".concat(n.x+o.x/16,"em ").concat(n.y+o.y/16,"em")})}return[{tag:"svg",attributes:r,children:t}]}(v)}function Yt(e){const{content:t,width:i,height:n,transform:r,title:s,extra:o,watchable:a=!1}=e,l={...o.attributes,...s?{title:s}:{},class:o.classes.join(" ")};a&&(l[ve]="");const c={...o.styles};et(r)&&(c.transform=function(e){let{transform:t,width:i=ge,height:n=ge,startCentered:r=!1}=e,s="";return s+=r&&ee?"translate(".concat(t.x/Xe-i/2,"em, ").concat(t.y/Xe-n/2,"em) "):r?"translate(calc(-50% + ".concat(t.x/Xe,"em), calc(-50% + ").concat(t.y/Xe,"em)) "):"translate(".concat(t.x/Xe,"em, ").concat(t.y/Xe,"em) "),s+="scale(".concat(t.size/Xe*(t.flipX?-1:1),", ").concat(t.size/Xe*(t.flipY?-1:1),") "),s+="rotate(".concat(t.rotate,"deg) "),s}({transform:r,startCentered:!0,width:i,height:n}),c["-webkit-transform"]=c.transform);const h=Je(c);h.length>0&&(l.style=h);const u=[];return u.push({tag:"span",attributes:l,children:[t]}),s&&u.push({tag:"span",attributes:{class:"sr-only"},children:[s]}),u}const{styles:Qt}=ot;function Kt(e){const t=e[0],i=e[1],[n]=e.slice(4);let r=null;return r=Array.isArray(n)?{tag:"g",attributes:{class:"".concat($e.cssPrefix,"-").concat(ze.GROUP)},children:[{tag:"path",attributes:{class:"".concat($e.cssPrefix,"-").concat(ze.SECONDARY),fill:"currentColor",d:n[0]}},{tag:"path",attributes:{class:"".concat($e.cssPrefix,"-").concat(ze.PRIMARY),fill:"currentColor",d:n[1]}}]}
1:{tag:"path",attributes:{fill:"currentColor",d:n}},{found:!0,width:t,height:i,icon:r}}const Jt={found:!1,width:512,height:512};function ei(e,t){let i=t;return"fa"===t&&null!==$e.styleDefault&&(t=Lt()),new Promise(((n,r)=>{if("fa"===i){const i=Ot(e)||{};e=i.iconName||e,t=i.prefix||t}if(e&&t&&Qt[t]&&Qt[t][e]){return n(Kt(Qt[t][e]))}!Se&&$e.showMissingIcons,n({...Jt,icon:$e.showMissingIcons&&e&&Vt("missingIconAbstract")||{}})}))}const ti=()=>{},ii=$e.measurePerformance&&K&&K.mark&&K.measure?K:{mark:ti,measure:ti},ni='FA "6.6.0"',ri=e=>{ii.mark("".concat(ni," ").concat(e," ends")),ii.measure("".concat(ni," ").concat(e),"".concat(ni," ").concat(e," begins"),"".concat(ni," ").concat(e," ends"))};var si=e=>(ii.mark("".concat(ni," ").concat(e," begins")),()=>ri(e));const oi=()=>{};function ai(e){return"string"==typeof(e.getAttribute?e.getAttribute(ve):null)}function li(e){return Y.createElementNS("http://www.w3.org/2000/svg",e)}function ci(e){return Y.createElement(e)}function hi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:i=("svg"===e.tag?li:ci)}=t;if("string"==typeof e)return Y.createTextNode(e);const n=i(e.tag);Object.keys(e.attributes||[]).forEach((function(t){n.setAttribute(t,e.attributes[t])}));return(e.children||[]).forEach((function(e){n.appendChild(hi(e,{ceFn:i}))})),n}const ui={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach((e=>{t.parentNode.insertBefore(hi(e),t)})),null===t.getAttribute(ve)&&$e.keepOriginalSource){let e=Y.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],i=e[1];if(~Qe(t).indexOf($e.replacementClass))return ui.replace(e);const n=new RegExp("".concat($e.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){const e=i[0].attributes.class.split(" ").reduce(((e,t)=>(t===$e.replacementClass||t.match(n)?e.toSvg.push(t):e.toNode.push(t),e)),{toNode:[],toSvg:[]});i[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const r=i.map((e=>ht(e))).join("\n");t.setAttribute(ve,""),t.innerHTML=r}};function di(e){e()}function fi(e,t){const i="function"==typeof t?t:oi;if(0===e.length)i();else{let t=di;"async"===$e.mutateApproach&&(t=Z.requestAnimationFrame||di),t((()=>{const t=!0===$e.autoReplaceSvg?ui.replace:ui[$e.autoReplaceSvg]||ui.replace,n=si("mutate");e.map(t),n(),i()}))}}let pi=!1;function mi(){pi=!0}function gi(){pi=!1}let xi=null;function vi(e){if(!Q)return;if(!$e.observeMutations)return;const{treeCallback:t=oi,nodeCallback:i=oi,pseudoElementsCallback:n=oi,observeMutationsRoot:r=Y}=e;xi=new Q((e=>{if(pi)return;const r=Lt();Ye(e).forEach((e=>{if("childList"===e.type&&e.addedNodes.length>0&&!ai(e.addedNodes[0])&&($e.searchPseudoElements&&n(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&$e.searchPseudoElements&&n(e.target.parentNode),"attributes"===e.type&&ai(e.target)&&~je.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(we):null,i=e.getAttribute?e.getAttribute(be):null;return t&&i}(e.target)){const{prefix:t,iconName:i}=Nt(Qe(e.target));e.target.setAttribute(we,t||r),i&&e.target.setAttribute(be,i)}else(s=e.target)&&s.classList&&s.classList.contains&&s.classList.contains($e.replacementClass)&&i(e.target);var s}))})),J&&xi.observe(r,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function yi(e){const t=e.getAttribute("data-prefix"),i=e.getAttribute("data-icon"),n=void 0!==e.innerText?e.innerText.trim():"";let r=Nt(Qe(e));return r.prefix||(r.prefix=Lt()),t&&i&&(r.prefix=t,r.iconName=i),r.iconName&&r.prefix||(r.prefix&&n.length>0&&(r.iconName=(s=r.prefix,o=e.innerText,(bt[s]||{})[o]||Pt(r.prefix,ft(e.innerText)))),!r.iconName&&$e.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(r.iconName=e.firstChild.data)),r;var s,o}function wi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:i,prefix:n,rest:r}=yi(e),s=function(e){const t=Ye(e.attributes).reduce(((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e)),{}),i=e.getAttribute("title"),n=e.getAttribute("data-fa-title-id");return $e.autoA11y&&(i?t["aria-labelledby"]="".concat($e.replacementClass,"-title-").concat(n||Ze()
1):(t["aria-hidden"]="true",t.focusable="false")),t}(e),o=Bt("parseNodeAttributes",{},e);let a=t.styleParser?function(e){const t=e.getAttribute("style");let i=[];return t&&(i=t.split(";").reduce(((e,t)=>{const i=t.split(":"),n=i[0],r=i.slice(1);return n&&r.length>0&&(e[n]=r.join(":").trim()),e}),{})),i}(e):[];return{iconName:i,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:n,transform:He,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:r,styles:a,attributes:s},...o}}const{styles:bi}=ot;function Ei(e){const t="nest"===$e.autoReplaceSvg?wi(e,{styleParser:!1}):wi(e);return~t.extra.classes.indexOf(De)?Vt("generateLayersText",e,t):Vt("generateSvgReplacementMutation",e,t)}let Ti=new Set;function Si(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!J)return Promise.resolve();const i=Y.documentElement.classList,n=e=>i.add("".concat(Ee,"-").concat(e)),r=e=>i.remove("".concat(Ee,"-").concat(e)),s=$e.autoFetchSvg?Ti:Me.map((e=>"fa-".concat(e))).concat(Object.keys(bi));s.includes("fa")||s.push("fa");const o=[".".concat(De,":not([").concat(ve,"])")].concat(s.map((e=>".".concat(e,":not([").concat(ve,"])")))).join(", ");if(0===o.length)return Promise.resolve();let a=[];try{a=Ye(e.querySelectorAll(o))}catch(h){}if(!(a.length>0))return Promise.resolve();n("pending"),r("complete");const l=si("onTree"),c=a.reduce(((e,t)=>{try{const i=Ei(t);i&&e.push(i)}catch(h){Se||h.name}return e}),[]);return new Promise(((e,i)=>{Promise.all(c).then((i=>{fi(i,(()=>{n("active"),n("complete"),r("pending"),"function"==typeof t&&t(),l(),e()}))})).catch((e=>{l(),i(e)}))}))}function Mi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Ei(e).then((e=>{e&&fi([e],t)}))}Me.map((e=>{Ti.add("fa-".concat(e))})),Object.keys(Re[te]).map(Ti.add.bind(Ti)),Object.keys(Re[ne]).map(Ti.add.bind(Ti)),Object.keys(Re[re]).map(Ti.add.bind(Ti)),Ti=[...Ti];const Ai=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=He,symbol:n=!1,mask:r=null,maskId:s=null,title:o=null,titleId:a=null,classes:l=[],attributes:c={},styles:h={}}=t;if(!e)return;const{prefix:u,iconName:d,icon:f}=e;return Ht({type:"icon",...e},(()=>(Ut("beforeDOMElementCreation",{iconDefinition:e,params:t}),$e.autoA11y&&(o?c["aria-labelledby"]="".concat($e.replacementClass,"-title-").concat(a||Ze()):(c["aria-hidden"]="true",c.focusable="false")),Zt({icons:{main:Kt(f),mask:r?Kt(r.icon):{found:!1,width:null,height:null,icon:{}}},prefix:u,iconName:d,transform:{...He,...i},symbol:n,title:o,maskId:s,titleId:a,extra:{attributes:c,styles:h,classes:l}}))))};var _i={mixout(){return{icon:(e=Ai,function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(t||{}).icon?t:Gt(t||{});let{mask:r}=i;return r&&(r=(r||{}).icon?r:Gt(r||{})),e(n,{...i,mask:r})})};var e},hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=Si,e.nodeCallback=Mi,e)}),provides(e){e.i2svg=function(e){const{node:t=Y,callback:i=()=>{}}=e;return Si(t,i)},e.generateSvgReplacementMutation=function(e,t){const{iconName:i,title:n,titleId:r,prefix:s,transform:o,symbol:a,mask:l,maskId:c,extra:h}=t;return new Promise(((t,u)=>{Promise.all([ei(i,s),l.iconName?ei(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((l=>{let[u,d]=l;t([e,Zt({icons:{main:u,mask:d},prefix:s,iconName:i,transform:o,symbol:a,maskId:c,title:n,titleId:r,extra:h,watchable:!0})])})).catch(u)}))},e.generateAbstractIcon=function(e){let{children:t,attributes:i,main:n,transform:r,styles:s}=e;const o=Je(s);let a;return o.length>0&&(i.style=o),et(r)&&(a=Vt("generateAbstractTransformGrouping",{main:n,transform:r,containerWidth:n.width,iconWidth:n.width})),t.push(a||n.icon),{children:t,attributes:i}}}},Ri={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:i=[]}=t;return Ht({type:"layer"},(()=>{Ut("beforeDOMElementCreation",{assembler:e,params:t});let n=[];return e((e=>{Array.isArray(e)?e.map((e=>{n=n.concat(e.abstract)})):n=n.concat(e.abstract)})),[{tag:"span",attributes:{class:["".concat($e.cssPrefix,"-layers"),...i].join(" ")},children:n}]}))}})},Pi={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:i=null,classes:n=[],attributes:r={},styles:s={}}=t;return Ht({type:"counter",content:e},(()=>(Ut("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:i,extra:n}=e,r={...n.attributes,...i?{title:i}:{},class:n.classes.join(" ")},s=Je(n.styles);s.length>0&&(r.style=s);const o=[];return o.push({tag:"span",attributes:r,children:[t]}),i&&o.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),o}({content:e.toString(),title:i,extra:{attributes:r,styles:s,classes:["".concat($e.cssPrefix,"-layers-counter"),...n]}}))))}})},ki={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=He,title:n=null,classes:r=[],attributes:s={},styles:o={}}
1=t;return Ht({type:"text",content:e},(()=>(Ut("beforeDOMElementCreation",{content:e,params:t}),Yt({content:e,transform:{...He,...i},title:n,extra:{attributes:s,styles:o,classes:["".concat($e.cssPrefix,"-layers-text"),...r]}}))))}}),provides(e){e.generateLayersText=function(e,t){const{title:i,transform:n,extra:r}=t;let s=null,o=null;if(ee){const t=parseInt(getComputedStyle(e).fontSize,10),i=e.getBoundingClientRect();s=i.width/t,o=i.height/t}return $e.autoA11y&&!i&&(r.attributes["aria-hidden"]="true"),Promise.resolve([e,Yt({content:e.innerHTML,width:s,height:o,transform:n,title:i,extra:r,watchable:!0})])}}};const Oi=new RegExp('"',"ug"),Li=[1105920,1112319],Ii={FontAwesome:{normal:"fas",400:"fas"},"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"},"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"},"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},Ci=Object.keys(Ii).reduce(((e,t)=>(e[t.toLowerCase()]=Ii[t],e)),{}),Ni=Object.keys(Ci).reduce(((e,t)=>{const i=Ci[t];return e[t]=i[900]||[...Object.entries(i)][0][1],e}),{});function Di(e,t){const i="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise(((n,r)=>{if(null!==e.getAttribute(i))return n();const s=Ye(e.children).filter((e=>e.getAttribute(ye)===t))[0],o=Z.getComputedStyle(e,t),a=o.getPropertyValue("font-family"),l=a.match(Fe),c=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!l)return e.removeChild(s),n();if(l&&"none"!==h&&""!==h){const h=o.getPropertyValue("content");let u=function(e,t){const i=e.replace(/^['"]|['"]$/g,"").toLowerCase(),n=parseInt(t),r=isNaN(n)?"normal":n;return(Ci[i]||{})[r]||Ni[i]}(a,c);const{value:d,isSecondary:f}=function(e){const t=e.replace(Oi,""),i=function(e,t){const i=e.length;let n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&i>t+1&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?1024*(r-55296)+n-56320+65536:r}(t,0),n=i>=Li[0]&&i<=Li[1],r=2===t.length&&t[0]===t[1];return{value:ft(r?t[0]:t),isSecondary:n||r}}(h),p=l[0].startsWith("FontAwesome");let m=Pt(u,d),g=m;if(p){const e=function(e){const t=Tt[e],i=Pt("fas",e);return t||(i?{prefix:"fas",iconName:i}:null)||{prefix:null,iconName:null}}(d);e.iconName&&e.prefix&&(m=e.iconName,u=e.prefix)}if(!m||f||s&&s.getAttribute(we)===u&&s.getAttribute(be)===g)n();else{e.setAttribute(i,g),s&&e.removeChild(s);const o={iconName:null,title:null,titleId:null,prefix:null,transform:He,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:a}=o;a.attributes[ye]=t,ei(m,u).then((r=>{const s=Zt({...o,icons:{main:r,mask:{prefix:null,iconName:null,rest:[]}},prefix:u,iconName:g,extra:a,watchable:!0}),l=Y.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=s.map((e=>ht(e))).join("\n"),e.removeAttribute(i),n()})).catch(r)}}else n()}))}function Fi(e){return Promise.all([Di(e,"::before"),Di(e,"::after")])}function ji(e){return!(e.parentNode===document.head||~Te.indexOf(e.tagName.toUpperCase())||e.getAttribute(ye)||e.parentNode&&"svg"===e.parentNode.tagName)}function zi(e){if(J)return new Promise(((t,i)=>{const n=Ye(e.querySelectorAll("*")).filter(ji).map(Fi),r=si("searchPseudoElements");mi(),Promise.all(n).then((()=>{r(),gi(),t()})).catch((()=>{r(),gi(),i()}))}))}let Bi=!1;const Ui=e=>e.toLowerCase().split(" ").reduce(((e,t)=>{const i=t.toLowerCase().split("-"),n=i[0];let r=i.slice(1).join("-");if(n&&"h"===r)return e.flipX=!0,e;if(n&&"v"===r)return e.flipY=!0,e;if(r=parseFloat(r),isNaN(r))return e;switch(n){case"grow":e.size=e.size+r;break;case"shrink":e.size=e.size-r;break;case"left":e.x=e.x-r;break;case"right":e.x=e.x+r;break;case"up":e.y=e.y-r;break;case"down":e.y=e.y+r;break;case"rotate":e.rotate=e.rotate+r}return e}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});const Vi={x:0,y:0,width:"100%",height:"100%"};function Gi(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}!function(e,t){let{mixoutsTo:i}=t;Dt=e,Ft={},Object.keys(jt).forEach((e=>{-1===zt.indexOf(e)&&delete jt[e]})),Dt.forEach((e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach((e=>{"function"==typeof t[e]&&(i[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEac
1h((n=>{i[e]||(i[e]={}),i[e][n]=t[e][n]}))})),e.hooks){const t=e.hooks();Object.keys(t).forEach((e=>{Ft[e]||(Ft[e]=[]),Ft[e].push(t[e])}))}e.provides&&e.provides(jt)}))}([rt,_i,Ri,Pi,ki,{hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=zi,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=Y}=e;$e.searchPseudoElements&&zi(t)}}},{mixout:()=>({dom:{unwatch(){mi(),Bi=!0}}}),hooks:()=>({bootstrap(){vi(Bt("mutationObserverCallbacks",{}))},noAuto(){xi&&xi.disconnect()},watch(e){const{observeMutationsRoot:t}=e;Bi?gi():vi(Bt("mutationObserverCallbacks",{observeMutationsRoot:t}))}})},{mixout:()=>({parse:{transform:e=>Ui(e)}}),hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-transform");return i&&(e.transform=Ui(i)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:i,containerWidth:n,iconWidth:r}=e;const s={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(32*i.x,", ").concat(32*i.y,") "),a="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),c={transform:"".concat(o," ").concat(a," ").concat(l)},h={transform:"translate(".concat(r/2*-1," -256)")};return{tag:"g",attributes:{...s},children:[{tag:"g",attributes:{...c},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...h}}]}]}}}},{hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-mask"),n=i?Nt(i.split(" ").map((e=>e.trim()))):{prefix:null,iconName:null,rest:[]};return n.prefix||(n.prefix=Lt()),e.mask=n,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:i,main:n,mask:r,maskId:s,transform:o}=e;const{width:a,icon:l}=n,{width:c,icon:h}=r,u=function(e){let{transform:t,containerWidth:i,iconWidth:n}=e;const r={transform:"translate(".concat(i/2," 256)")},s="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),a="rotate(".concat(t.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(s," ").concat(o," ").concat(a)},path:{transform:"translate(".concat(n/2*-1," -256)")}}}({transform:o,containerWidth:c,iconWidth:a}),d={tag:"rect",attributes:{...Vi,fill:"white"}},f=l.children?{children:l.children.map(Gi)}:{},p={tag:"g",attributes:{...u.inner},children:[Gi({tag:l.tag,attributes:{...l.attributes,...u.path},...f})]},m={tag:"g",attributes:{...u.outer},children:[p]},g="mask-".concat(s||Ze()),x="clip-".concat(s||Ze()),v={tag:"mask",attributes:{...Vi,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[d,m]},y={tag:"defs",children:[{tag:"clipPath",attributes:{id:x},children:(w=h,"g"===w.tag?w.children:[w])},v]};var w;return t.push(y,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(x,")"),mask:"url(#".concat(g,")"),...Vi}}),{children:t,attributes:i}}}},{provides(e){let t=!1;Z.matchMedia&&(t=Z.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],i={fill:"currentColor"},n={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:{...i,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
1-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 r={...n,attributeName:"opacity"},s={tag:"circle",attributes:{...i,cx:"256",cy:"364",r:"28"},children:[]};return t||s.children.push({tag:"animate",attributes:{...n,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...r,values:"1;0;1;1;0;1;"}}),e.push(s),e.push({tag:"path",attributes:{...i,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:{...r,values:"1;0;0;0;0;1;"}}]}),t||e.push({tag:"path",attributes:{...i,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:{...r,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:e}}}},{hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-symbol"),n=null!==i&&(""===i||i);return e.symbol=n,e}})}],{mixoutsTo:qt});const Wi=qt.parse,$i=qt.icon;function qi(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Xi(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qi(Object(i),!0).forEach((function(t){Zi(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):qi(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Hi(e){return(Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zi(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Yi(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function Qi(e){return function(e){if(Array.isArray(e))return Ki(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ki(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ki(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ki(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Ji(e){return t=e,(t-=0)==t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}var en=["style"];var tn=!1;try{tn=!0}catch(ug){}function nn(e){return e&&"object"===Hi(e)&&e.prefix&&e.iconName&&e.icon?e:Wi.icon?Wi.icon(e):null===e?null:e&&"object"===Hi(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function rn(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?Zi({},e,t):{}}var sn={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},on=React.forwardRef((function(e,t){var i=Xi(Xi({},sn),e),n=i.icon,r=i.mask,s=i.symbol,o=i.className,a=i.title,l=i.titleId,c=i.maskId,h=nn(n),u=rn("classes",[].concat(Qi(function(e){var t,i=e.beat,n=e.fade,r=e.beatFade,s=e.bounce,o=e.shake,a=e.flash,l=e.spin,c=e.spinPulse,h=e.spinReverse,u=e.pulse,d=e.fixedWidth,f=e.inverse,p=e.border,m=e.listItem,g
1=e.flip,x=e.size,v=e.rotation,y=e.pull,w=(Zi(t={"fa-beat":i,"fa-fade":n,"fa-beat-fade":r,"fa-bounce":s,"fa-shake":o,"fa-flash":a,"fa-spin":l,"fa-spin-reverse":h,"fa-spin-pulse":c,"fa-pulse":u,"fa-fw":d,"fa-inverse":f,"fa-border":p,"fa-li":m,"fa-flip":!0===g,"fa-flip-horizontal":"horizontal"===g||"both"===g,"fa-flip-vertical":"vertical"===g||"both"===g},"fa-".concat(x),null!=x),Zi(t,"fa-rotate-".concat(v),null!=v&&0!==v),Zi(t,"fa-pull-".concat(y),null!=y),Zi(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(w).map((function(e){return w[e]?e:null})).filter((function(e){return e}))}(i)),Qi((o||"").split(" ")))),d=rn("transform","string"==typeof i.transform?Wi.transform(i.transform):i.transform),f=rn("mask",nn(r)),p=$i(h,Xi(Xi(Xi(Xi({},u),d),f),{},{symbol:s,title:a,titleId:l,maskId:c}));if(!p)return function(){var e;!tn&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",h),null;var m=p.abstract,g={ref:t};return Object.keys(i).forEach((function(e){sn.hasOwnProperty(e)||(g[e]=i[e])})),an(m[0],g)}));on.displayName="FontAwesomeIcon",on.propTypes={beat:s.bool,border:s.bool,beatFade:s.bool,bounce:s.bool,className:s.string,fade:s.bool,flash:s.bool,mask:s.oneOfType([s.object,s.array,s.string]),maskId:s.string,fixedWidth:s.bool,inverse:s.bool,flip:s.oneOf([!0,!1,"horizontal","vertical","both"]),icon:s.oneOfType([s.object,s.array,s.string]),listItem:s.bool,pull:s.oneOf(["right","left"]),pulse:s.bool,rotation:s.oneOf([0,90,180,270]),shake:s.bool,size:s.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:s.bool,spinPulse:s.bool,spinReverse:s.bool,symbol:s.oneOfType([s.bool,s.string]),title:s.string,titleId:s.string,transform:s.oneOfType([s.string,s.object]),swapOpacity:s.bool};var an=function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof i)return i;var r=(i.children||[]).map((function(i){return e(t,i)})),s=Object.keys(i.attributes||{}).reduce((function(e,t){var n=i.attributes[t];switch(t){case"class":e.attrs.className=n,delete i.attributes.class;break;case"style":e.attrs.style=n.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var i,n=t.indexOf(":"),r=Ji(t.slice(0,n)),s=t.slice(n+1).trim();return r.startsWith("webkit")?e[(i=r,i.charAt(0).toUpperCase()+i.slice(1))]=s:e[r]=s,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=n:e.attrs[Ji(t)]=n}return e}),{attrs:{}}),o=n.style,a=void 0===o?{}:o,l=Yi(n,en);return s.attrs.style=Xi(Xi({},s.attrs.style),a),t.apply(void 0,[i.tag,Xi(Xi({},s.attrs),l)].concat(Qi(r)))}.bind(null,React.createElement),ln="-ms-",cn="-moz-",hn="-webkit-",un="comm",dn="rule",fn="decl",pn="@keyframes",mn=Math.abs,gn=String.fromCharCode,xn=Object.assign;function vn(e){return e.trim()}function yn(e,t){return(e=t.exec(e))?e[0]:e}function wn(e,t,i){return e.replace(t,i)}function bn(e,t,i){return e.indexOf(t,i)}function En(e,t){return 0|e.charCodeAt(t)}function Tn(e,t,i){return e.slice(t,i)}function Sn(e){return e.length}function Mn(e){return e.length}function An(e,t){return t.push(e),e}function _n(e,t){return e.filter((function(e){return!yn(e,t)}))}var Rn=1,Pn=1,kn=0,On=0,Ln=0,In="";function Cn(e,t,i,n,r,s,o,a){return{value:e,root:t,parent:i,type:n,props:r,children:s,line:Rn,column:Pn,length:o,return:"",siblings:a}}function Nn(e,t){return xn(Cn("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Dn(e){for(;e.root;)e=Nn(e.root,{children:[e]});An(e,e.siblings)}function Fn(){return Ln=On<kn?En(In,On++):0,Pn++,10===Ln&&(Pn=1,Rn++),Ln}function jn(){return En(In,On)}function zn(){return On}function Bn(e,t){return Tn(In,e,t)}function Un(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Vn(e){return vn(Bn(On-1,$n(91===e?e+2:40===e?e+1:e)))}function Gn(e){for(;(Ln=jn())&&Ln<33;)Fn();return Un(e)>2||Un(Ln)>3?"":" "}function Wn(e,t){for(;--t&&Fn()&&!(Ln<48||Ln>102||Ln>57&&Ln<65||Ln>70&&Ln<97););return Bn(e,zn()+(t<6&&32==jn()&&32==Fn()))}function $n(e){for(;Fn();)switch(Ln){case e:return On;case 34:case 39:34!==e&&39!==e&&$n(Ln);break;case 40:41===e&&$n(e);break;case 92:Fn()}return On}function qn(e,t){for(;Fn()&&e+Ln!==57&&(e+Ln!==84||47!==jn()););return"/*"+Bn(t,On-1)+"*"+gn(47===e?e:Fn())}function Xn(e){for(;!Un(jn());)Fn();return Bn(e,On)}function Hn(e){return function(e){return In="",e}(Zn("",null,null,null,[""],e=function(e){return Rn=Pn=1,kn=Sn(In=e),On=0,[]}(e),0,[0],e))}function Zn(e,t,i,n,r,s,o,a,l){for(var c=0,h=0,u=o,d=0,f=0,p=0,m=1,g=1,x=1,v=0,y="",w=r,b=s,E=n,T=y;g;)switch(p=v,v=Fn()){case 40:if(108!=p&&58==En(T,u-1)){-1!=bn(T+=wn(Vn(v),"&","&\f"),"&\f",mn(c?a[c-1]:0))&&(x=-1);break}case 34:case 39:case 91:T+=Vn(v);break;case 9:case 10:case 13:case 32:T+=Gn(p);break;case 92:T+=Wn(zn()-1,7);continue;case 47:switch(jn()){case 42:case 47:An(Qn(qn(Fn(),zn()),t,i,l),l),5!=Un(p||1)&&5!=Un(jn()||1)||!Sn(T)||" "===Tn(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*m:a[c++]=Sn(T)*x;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+h:-1==x&&(T=wn(T,/\f/g,"")),f>0&&(Sn(T)-u||0===m&&47===p)&&An(f>32?Kn(T+";",n,i,u-1,l):Kn(wn(T," ","")+";",n,i,u-2,l),l);break;case 59:T+=";";default:if(An(E=Yn(T,t,i,c,h,r,a,y,w=[],b=[],u,s),s),123===v)if(0===h)Zn(T,t,E,E,w,s,u,a,b);else{switch(d){case 99:if(110===En(T,3))break;case 108:if(97===En(T,2))break;default:h=0;case 100:case 109:case 115:}h?Zn(e,E,E,n&&An(Yn(e,E,E,0,0,r,a,y,r,w=[],u,b),b),r,b,u,a,n?w:b):Zn(T,E,E,E,[""],b,0,a,b)}}c=h=f=0,m=x=1,y=T="",u=o;break;case 58:u=1+Sn(T),f=p;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==(Ln=On>0?En(In,--On):0,Pn--,10===Ln&&(Pn=1,Rn--),Ln))continue;switch(T+=gn(v),v*m){case 38:x=h>0?1:(T+="\f",-1);break;case 44:a[c++]=(Sn(T)-1)*x,x=1;break;
vendor: 4,170 bytes, line 1
1case 64:45===jn()&&(T+=Vn(Fn())),d=jn(),h=u=Sn(y=T+=Xn(zn())),v++;break;case 45:45===p&&2==Sn(T)&&(m=0)}}return s}function Yn(e,t,i,n,r,s,o,a,l,c,h,u){for(var d=r-1,f=0===r?s:[""],p=Mn(f),m=0,g=0,x=0;m<n;++m)for(var v=0,y=Tn(e,d+1,d=mn(g=o[m])),w=e;v<p;++v)(w=vn(g>0?f[v]+" "+y:wn(y,/&\f/g,f[v])))&&(l[x++]=w);return Cn(e,t,i,0===r?dn:a,l,c,h,u)}function Qn(e,t,i,n){return Cn(e,t,i,un,gn(Ln),Tn(e,2,-2),0,n)}function Kn(e,t,i,n,r){return Cn(e,t,i,fn,Tn(e,0,n),Tn(e,n+1,-1),n,r)}function Jn(e,t,i){switch(function(e,t){return 45^En(e,0)?(((t<<2^En(e,0))<<2^En(e,1))<<2^En(e,2))<<2^En(e,3):0}(e,t)){case 5103:return hn+"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 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return hn+e+e;case 4855:return hn+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return cn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return hn+e+cn+e+ln+e+e;case 5936:switch(En(e,t+11)){case 114:return hn+e+ln+wn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return hn+e+ln+wn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return hn+e+ln+wn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return hn+e+ln+e+e;case 6165:return hn+e+ln+"flex-"+e+e;case 5187:return hn+e+wn(e,/(\w+).+(:[^]+)/,hn+"box-$1$2"+ln+"flex-$1$2")+e;case 5443:return hn+e+ln+"flex-item-"+wn(e,/flex-|-self/g,"")+(yn(e,/flex-|baseline/)?"":ln+"grid-row-"+wn(e,/flex-|-self/g,""))+e;case 4675:return hn+e+ln+"flex-line-pack"+wn(e,/align-content|flex-|-self/g,"")+e;case 5548:return hn+e+ln+wn(e,"shrink","negative")+e;case 5292:return hn+e+ln+wn(e,"basis","preferred-size")+e;case 6060:return hn+"box-"+wn(e,"-grow","")+hn+e+ln+wn(e,"grow","positive")+e;case 4554:return hn+wn(e,/([^-])(transform)/g,"$1"+hn+"$2")+e;case 6187:return wn(wn(wn(e,/(zoom-|grab)/,hn+"$1"),/(image-set)/,hn+"$1"),e,"")+e;case 5495:case 3959:return wn(e,/(image-set\([^]*)/,hn+"$1$`$1");case 4968:return wn(wn(e,/(.+:)(flex-)?(.*)/,hn+"box-pack:$3"+ln+"flex-pack:$3"),/space-between/,"justify")+hn+e+e;case 4200:if(!yn(e,/flex-|baseline/))return ln+"grid-column-align"+Tn(e,t)+e;break;case 2592:case 3360:return ln+wn(e,"template-","")+e;case 4384:case 3616:return i&&i.some((function(e,i){return t=i,yn(e.props,/grid-\w+-end/)}))?~bn(e+(i=i[t].value),"span",0)?e:ln+wn(e,"-start","")+e+ln+"grid-row-span:"+(~bn(i,"span",0)?yn(i,/\d+/):+yn(i,/\d+/)-+yn(e,/\d+/))+";":ln+wn(e,"-start","")+e;case 4896:case 4128:return i&&i.some((function(e){return yn(e.props,/grid-\w+-start/)}))?e:ln+wn(wn(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return wn(e,/(.+)-inline(.+)/,hn+"$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(Sn(e)-1-t>6)switch(En(e,t+1)){case 109:if(45!==En(e,t+4))break;case 102:return wn(e,/(.+:)(.+)-([^]+)/,"$1"+hn+"$2-$3$1"+cn+(108==En(e,t+3)?"$3":"$2-$3"))+e;case 115:return~bn(e,"stretch",0)?Jn(wn(e,"stretch","fill-available"),t,i)+e:e}break;case 5152:case 5920:return wn(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,i,n,r,s,o,a){return ln+i+":"+n+a+(r?ln+i+"-span:"+(s?o:+o-+n)+a:"")+e}));case 4949:if(121===En(e,t+6))return wn(e,":",":"+hn)+e;break;case 6444:switch(En(e,45===En(e,14)?18:11)){case 120:return wn(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+hn+(45===En(e,14)?"inline-":"")+"box$3$1"+hn+"$2$3$1"+ln+"$2box$3")+e;case 100:return wn(e,":",":"+ln)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return wn(e,"scroll-","scroll-snap-")+e}return e}function er(e,t){for(var i="",n=0;n<e.length;n++)i+=t(e[n],n,e,t)||"";return i}function tr(e,t,i,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case fn:return e.return=e.return||e.value;case un:return"";case pn:return e.return=e.value+"{"+er(e.children,n)+"}";case dn:if(!Sn(e.value=e.props.join(",")))return""}return Sn(i=er(e.children,n))?e.return=e.value+"{"+i+"}":""}function ir(e,t,i,n){if(e.length>
1-1&&!e.return)switch(e.type){case fn:return void(e.return=Jn(e.value,e.length,i));case pn:return er([Nn(e,{value:wn(e.value,"@","@"+hn)})],n);case dn:if(e.length)return function(e,t){return e.map(t).join("")}(i=e.props,(function(t){switch(yn(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Dn(Nn(e,{props:[wn(t,/:(read-\w+)/,":-moz-$1")]})),Dn(Nn(e,{props:[t]})),xn(e,{props:_n(i,n)});break;case"::placeholder":Dn(Nn(e,{props:[wn(t,/:(plac\w+)/,":"+hn+"input-$1")]})),Dn(Nn(e,{props:[wn(t,/:(plac\w+)/,":-moz-$1")]})),Dn(Nn(e,{props:[wn(t,/:(plac\w+)/,ln+"input-$1")]})),Dn(Nn(e,{props:[t]})),xn(e,{props:_n(i,n)})}return""}))}}var nr,rr,sr={};const or="undefined"!=typeof process&&void 0!==sr&&(sr.REACT_APP_SC_ATTR||sr.SC_ATTR)||"data-styled",ar="active",lr="data-styled-version",cr="6.4.4",hr="/*!sc*/\n",ur="undefined"!=typeof window&&"undefined"!=typeof document;function dr(e){if("undefined"!=typeof process&&void 0!==sr){const t=sr[e];if(void 0!==t&&""!==t)return"false"!==t}}const fr=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:null!==(rr=null!==(nr=dr("REACT_APP_SC_DISABLE_SPEEDY"))&&void 0!==nr?nr:dr("SC_DISABLE_SPEEDY"))&&void 0!==rr?rr:"undefined"!=typeof process&&void 0!==sr&&!1);function pr(e,...t){return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`)}let mr=new Map,gr=new Map,xr=1;const vr=e=>{if(mr.has(e))return mr.get(e);for(;gr.has(xr);)xr++;const t=xr++;return mr.set(e,t),gr.set(t,e),t},yr=e=>gr.get(e),wr=(e,t)=>{xr=t+1,mr.set(e,t),gr.set(t,e)},br=Object.freeze([]),Er=Object.freeze({});const Tr=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Sr=/(^-|-$)/g;function Mr(e){return e.replace(Tr,"-").replace(Sr,"")}const Ar=/(a)(d)/gi,_r=e=>String.fromCharCode(e+(e>25?39:97));function Rr(e){let t,i="";for(t=Math.abs(e);t>52;t=t/52|0)i=_r(t%52)+i;return(_r(t%52)+i).replace(Ar,"$1-$2")}const Pr=5381,kr=(e,t)=>{let i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return e},Or=e=>kr(Pr,e);function Lr(e){return"string"==typeof e&&!0}function Ir(e){return Lr(e)?`styled.${e}`:`Styled(${function(e){return e.displayName||e.name||"Component"}(e)})`}const Cr=Symbol.for("react.memo"),Nr=Symbol.for("react.forward_ref"),Dr={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Fr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},jr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},zr={[Nr]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Cr]:jr};function Br(e){return("type"in(t=e)&&t.type.$$typeof)===Cr?jr:"$$typeof"in e?zr[e.$$typeof]:Dr;var t}const Ur=Object.defineProperty,Vr=Object.getOwnPropertyNames,Gr=Object.getOwnPropertySymbols,Wr=Object.getOwnPropertyDescriptor,$r=Object.getPrototypeOf,qr=Object.prototype;function Xr(e,t,i){if("string"!=typeof t){const r=$r(t);r&&r!==qr&&Xr(e,r,i);const s=Vr(t).concat(Gr(t)),o=Br(e),a=Br(t);for(let l=0;l<s.length;++l){const r=s[l];if(!(r in Fr||i&&i[r]||a&&r in a||o&&r in o)){const i=Wr(t,r);try{Ur(e,r,i)}catch(n){}}}}return e}function Hr(e){return"function"==typeof e}const Zr=Symbol.for("react.forward_ref");function Yr(e){return null!=e&&("object"==typeof e||"function"==typeof e)&&e.$$typeof===Zr&&"styledComponentId"in e}function Qr(e,t){return e&&t?e+" "+t:e||t||""}function Kr(e,t){return e.join("")}function Jr(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function es(e,t,i=!1){if(!i&&!Jr(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let n=0;n<t.length;n++)e[n]=es(e[n],t[n]);else if(Jr(t))for(const n in t)e[n]=es(e[n],t[n]);return e}function ts(e,t){Object.defineProperty(e,"toString",{value:t})}const is=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let i=this._cGroup;i<e;i++)t+=this.groupSizes[i];else for(let i=this._cGroup-1;i>=e;i--)t-=this.groupSizes[i];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const t=this.groupSizes,i=t.length;let n=i;for(;e>=n;)if(n<<=1,n<0)throw pr(16,`${e}`);this.groupSizes=new Uint32Array(n),this.groupSizes.set(t),this.length=n;for(let e=i;e<n;e++)this.groupSizes[e]=0}let i=this.indexOfGroup(e+1),n=0;for(let r=0,s=t.length;r<s;r++)this.tag.insertRule(i,t[r])&&(this.groupSizes[e]++,i++,n++);n>0&&this._cGroup>e&&(this._cIndex+=n)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],i=this.indexOfGroup(e),n=i+t;this.groupSizes[e]=0;for(let e=i;e<n;e++)this.tag.deleteRule(i);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||0===this.groupSizes[e])return t;const i=this.groupSizes[e],n=this.indexOfGroup(e),r=n+i;for(let s=n;s<r;s++)t+=this.tag.getRule(s)+hr;return t}},ns=`style[${or}][${lr}="${cr}"]`,rs=new RegExp(`^${or}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),ss=e=>"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType,os=e=>{if(!e)return document;if(ss(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(ss(t))return t}return document},as=(e,t,i)=>{const n=i.split(",");let r;for(let s=0,o=n.length;s<o;s++)(r=n[s])&&e.registerName(t,r)},ls=(e,t)=>{var i;const n=(null!==(i=t.textContent)&&void 0!==i?i:"").split(hr),r=[];for(let s=0,o=n.length;s<o;s++){const t=n[s].trim();if(!t)continue;const i=t.match(rs);if(i){const t=0|parseInt(i[1],10),n=i[2];0!==t&&(wr(n,t),as(e,n,i[3]),e.getTag().insertRules(t,r)),r.length=0}else r.push(t)}},cs=e=>{const t=os(e.options.target).querySelectorAll(ns);for(let i=0,n=t.length;i<n;i++){const n=t[i];n&&n.getAttribute(or)!==ar&&(ls(e,n),n.parentNode&&n.parentNode.removeChild(n))}};let hs=!1;const us=(e,t)=>{const i=document.head,n=e||i,r=document.createElement("style"),s=(e=>{const t=Array.from(e.querySelectorAll(`style[${or}]`));return t[t.length-1]})(n),o=void 0!==s?s.nextSibling:null;r.setAttribute(or,ar),r.setAttribute(lr,cr);const a=t||function(){if(!1!==hs)return hs;if("undefined"!=typeof document){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return hs=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return hs=t.getAttribute("content")||void 0}return hs="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0}();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},ds=class{constructor(e,t){this.element=us(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(e=>{var t;if(e.sheet)return e.sheet;const i=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets;for(let n=0,r=i.length;n<r;n++){const t=i[n];if(t.ownerNode===e)return t}throw pr(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(i){return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}}
vendor: 2,862 bytes, line 1
1,fs=class{constructor(e,t){this.element=us(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const i=document.createTextNode(t);return this.element.insertBefore(i,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}};let ps=ur;const ms={isServer:!ur,useCSSOMInjection:!fr};class gs{static registerId(e){return vr(e)}constructor(e=Er,t={},i){this.options=Object.assign(Object.assign({},ms),e),this.gs=t,this.keyframeIds=new Set,this.names=new Map(i),this.server=!!e.isServer,!this.server&&ur&&ps&&(ps=!1,cs(this)),ts(this,(()=>(e=>{const t=e.getTag(),{length:i}=t;let n="";for(let r=0;r<i;r++){const i=yr(r);if(void 0===i)continue;const s=e.names.get(i);if(void 0===s||!s.size)continue;const o=t.getGroup(r);if(0===o.length)continue;const a=or+".g"+r+'[id="'+i+'"]';let l="";for(const e of s)e.length>0&&(l+=e+",");n+=o+a+'{content:"'+l+'"}'+hr}return n})(this)))}rehydrate(){!this.server&&ur&&cs(this)}reconstructWithOptions(e,t=!0){const i=new gs(Object.assign(Object.assign({},this.options),e),this.gs,t&&this.names||void 0);return i.keyframeIds=new Set(this.keyframeIds),!this.server&&ur&&e.target!==this.options.target&&os(this.options.target)!==os(e.target)&&cs(i),i}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||(this.tag=(e=(({useCSSOMInjection:e,target:t,nonce:i})=>e?new ds(t,i):new fs(t,i))(this.options),new is(e)));var e}hasNameForId(e,t){var i,n;return null!==(n=null===(i=this.names.get(e))||void 0===i?void 0:i.has(t))&&void 0!==n&&n}registerName(e,t){vr(e),e.startsWith("sc-keyframes-")&&this.keyframeIds.add(e);const i=this.names.get(e);i?i.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,i){this.registerName(e,t),this.getTag().insertRules(vr(e),i)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(vr(e)),this.clearNames(e)}clearTag(){this.tag=void 0}}const xs=new WeakSet,vs={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale: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};function ys(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in vs||e.startsWith("--")?String(t).trim():t+"px"}const ws=47;function bs(e){if(45===e.charCodeAt(0)&&45===e.charCodeAt(1))return e;let t="";for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);t+=n>
1=65&&n<=90?"-"+String.fromCharCode(n+32):e[i]}return t.startsWith("ms-")?"-"+t:t}const Es=Symbol.for("sc-keyframes");function Ts(e){return Hr(e)&&!(e.prototype&&e.prototype.isReactComponent)}const Ss=e=>null==e||!1===e||""===e,Ms=Symbol.for("react.client.reference");function As(e){return e.$$typeof===Ms}function _s(e,t){for(const i in e){const n=e[i];e.hasOwnProperty(i)&&!Ss(n)&&(Array.isArray(n)&&xs.has(n)||Hr(n)?t.push(bs(i)+":",n,";"):Jr(n)?(t.push(i+" {"),_s(n,t),t.push("}")):t.push(bs(i)+": "+ys(i,n)+";"))}}function Rs(e,t,i,n,r=[]){if(Ss(e))return r;const s=typeof e;if("string"===s)return r.push(e),r;if("function"===s){if(As(e))return r;if(Ts(e)&&t){return Rs(e(t),t,i,n,r)}return r.push(e),r}if(Array.isArray(e)){for(let s=0;s<e.length;s++)Rs(e[s],t,i,n,r);return r}return Yr(e)?(r.push(`.${e.styledComponentId}`),r):function(e){return"object"==typeof e&&null!==e&&Es in e}(e)?(i?(e.inject(i,n),r.push(e.getName(n))):r.push(e),r):As(e)?r:Jr(e)?e.toString!==Object.prototype.toString?(r.push(e.toString()),r):(_s(e,r),r):(r.push(e.toString()),r)}const Ps=Or(cr);class ks{constructor(e,t,i){this.rules=e,this.componentId=t,this.baseHash=kr(Ps,t),this.baseStyle=i,gs.registerId(t)}generateAndInjectStyles(e,t,i){let n=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,i):"";{let r="";for(let n=0;n<this.rules.length;n++){const s=this.rules[n];if("string"==typeof s)r+=s;else if(s)if(Ts(s)){const n=s(e);"string"==typeof n?r+=n:null!=n&&!1!==n&&(r+=Kr(Rs(n,e,t,i)))}else r+=Kr(Rs(s,e,t,i))}if(r){this.dynamicNameCache||(this.dynamicNameCache=new Map);const e=i.hash?i.hash+r:r;let s=this.dynamicNameCache.get(e);if(!s){if(s=Rr(kr(kr(this.baseHash,i.hash),r)>>>0),this.dynamicNameCache.size>=200){const e=this.dynamicNameCache.keys().next().value;void 0!==e&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,s)}if(!t.hasNameForId(this.componentId,s)){const e=i(r,"."+s,void 0,this.componentId);t.insertRules(this.componentId,s,e)}n=Qr(n,s)}}return n}}const Os=/&/g;function Ls(e,t){let i=0;for(;--t>=0&&92===e.charCodeAt(t);)i++;return!(1&~i)}function Is(e){const t=e.length;let i="",n=0,r=0,s=0,o=!1,a=!1;for(let l=0;l<t;l++){const c=e.charCodeAt(l);if(0!==s||o||c!==ws||42!==e.charCodeAt(l+1))if(o)42===c&&e.charCodeAt(l+1)===ws&&(o=!1,l++);else if(34!==c&&39!==c||Ls(e,l)){if(0===s)if(123===c)r++;else if(125===c){if(r--,r<0){a=!0;let i=l+1;for(;i<t;){const t=e.charCodeAt(i);if(59===t||10===t)break;i++}i<t&&59===e.charCodeAt(i)&&i++,r=0,l=i-1,n=i;continue}0===r&&(i+=e.substring(n,l+1),n=l+1)}else 59===c&&0===r&&(i+=e.substring(n,l+1),n=l+1)}else 0===s?s=c:s===c&&(s=0);else o=!0,l++}return a||0!==r||0!==s?(n<t&&0===r&&0===s&&(i+=e.substring(n)),i):e}function Cs(e,t){const i=t+" ",n=","+i;for(let r=0;r<e.length;r++){const s=e[r];if("rule"===s.type){s.value=(i+s.value).replaceAll(",",n);const e=s.props,t=[];for(let n=0;n<e.length;n++)t[n]=i+e[n];s.props=t}Array.isArray(s.children)&&"@keyframes"!==s.type&&Cs(s.children,t)}return e}function Ns({options:e=Er,plugins:t=br}=Er){let i,n,r;const s=(e,t,r)=>r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?`.${i}`:e,o=t.slice();o.push((e=>{e.type===dn&&e.value.includes("&")&&(r||(r=new RegExp(`\\${n}\\b`,"g")),e.props[0]=e.props[0].replace(Os,n).replace(r,s))})),e.prefix&&o.push(ir),o.push(tr);let a=[];const l=(u=o.concat((f=e=>a.push(e),function(e){e.root||(e=e.return)&&f(e)})),d=Mn(u),function(e,t,i,n){for(var r="",s=0;s<d;s++)r+=u[s](e,t,i,n)||"";return r}),c=(t,s="",o="",c="&")=>{i=c,n=s,r=void 0;const h=function(e){const t=-1!==e.indexOf("//"),i=-1!==e.indexOf("}");if(!t&&!i)return e;if(!t)return Is(e);const n=e.length;let r="",s=0,o=0,a=0,l=0,c=0,h=!1;for(;o<n;){const t=e.charCodeAt(o);if(34!==t&&39!==t||Ls(e,o))if(0===a)if(t===ws&&o+1<n&&42===e.charCodeAt(o+1)){for(o+=2;o+1<n&&(42!==e.charCodeAt(o)||e.charCodeAt(o+1)!==ws);)o++;o+=2}else if(40!==t)if(41!==t)if(l>0)o++;else if(42===t&&o+1<n&&e.charCodeAt(o+1)===ws)r+=e.substring(s,o),o+=2,
1s=o,h=!0;else if(t===ws&&o+1<n&&e.charCodeAt(o+1)===ws){for(r+=e.substring(s,o);o<n&&10!==e.charCodeAt(o);)o++;s=o,h=!0}else 123===t?c++:125===t&&c--,o++;else l>0&&l--,o++;else l++,o++;else o++;else 0===a?a=t:a===t&&(a=0),o++}return h?(s<n&&(r+=e.substring(s)),0===c?r:Is(r)):0===c?e:Is(e)}(t);let u=Hn(o||s?o+" "+s+" { "+h+" }":h);return e.namespace&&(u=Cs(u,e.namespace)),a=[],er(u,l),a},h=e;var u,d,f;let p=Pr;for(let m=0;m<t.length;m++)t[m].name||pr(15),p=kr(p,t[m].name);return(null==h?void 0:h.namespace)&&(p=kr(p,h.namespace)),(null==h?void 0:h.prefix)&&(p=kr(p,"p")),c.hash=p!==Pr?p.toString():"",c}const Ds=new gs,Fs=Ns(),js=React.createContext({shouldForwardProp:void 0,styleSheet:Ds,stylis:Fs,stylisPlugins:void 0});function zs(){return React.useContext(js)}function Bs(e){var t;const i=zs(),{styleSheet:n}=i,r=React.useMemo((()=>{let t=n;return e.sheet?t=e.sheet:e.target?t=t.reconstructWithOptions(void 0!==e.nonce?{target:e.target,nonce:e.nonce}:{target:e.target},!1):void 0!==e.nonce&&(t=t.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,n]),s=React.useMemo((()=>{var t;return void 0===e.stylisPlugins&&void 0===e.namespace&&void 0===e.enableVendorPrefixes?i.stylis:Ns({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:null!==(t=e.stylisPlugins)&&void 0!==t?t:i.stylisPlugins})}),[e.enableVendorPrefixes,e.namespace,e.stylisPlugins,i.stylis,i.stylisPlugins]),o="shouldForwardProp"in e?e.shouldForwardProp:i.shouldForwardProp,a=null!==(t=e.stylisPlugins)&&void 0!==t?t:i.stylisPlugins,l=React.useMemo((()=>({shouldForwardProp:o,styleSheet:r,stylis:s,stylisPlugins:a})),[o,r,s,a]);return React.createElement(js.Provider,{value:l},e.children)}js.Consumer;const Us=React.createContext(void 0);Us.Consumer;const Vs=Object.prototype.hasOwnProperty,Gs={};function Ws(e,t){const i="string"!=typeof e?"sc":Mr(e);Gs[i]=(Gs[i]||0)+1;const n=i+"-"+function(e){return Rr(Or(e)>>>0)}(cr+i+Gs[i]);return t?t+"-"+n:n}function $s(e,t,i){const n=Yr(e),r=e,s=!Lr(e),{attrs:a=br,componentId:l=Ws(t.displayName,t.parentComponentId),displayName:c=Ir(e)}=t,h=t.displayName&&t.componentId?Mr(t.displayName)+"-"+t.componentId:t.componentId||l,u=n&&r.attrs?r.attrs.concat(a).filter(Boolean):a;let{shouldForwardProp:d}=t;if(n&&r.shouldForwardProp){const e=r.shouldForwardProp;if(t.shouldForwardProp){const i=t.shouldForwardProp;d=(t,n)=>e(t,n)&&i(t,n)}else d=e}const f=new ks(i,h,n?r.componentStyle:void 0);function p(e,t){return function(e,t,i){const{attrs:n,componentStyle:r,defaultProps:s,foldedComponentIds:a,styledComponentId:l,target:c}=e,h=React.useContext(Us),u=zs(),d=e.shouldForwardProp||u.shouldForwardProp,f=function(e,t,i=Er){return e.theme!==i.theme&&e.theme||t||i.theme}(t,h,s)||Er;let p,m;{const e=React.useRef(null),i=e.current;if(null!==i&&i[1]===f&&i[2]===u.styleSheet&&i[3]===u.stylis&&i[7]===r&&function(e,t,i){const n=e,r=t;let s=0;for(const o in r)if(Vs.call(r,o)&&(s++,n[o]!==r[o]))return!1;return s===i}(i[0],t,i[4]))p=i[5],m=i[6];else{p=function(e,t,i){const n=Object.assign(Object.assign({},t),{className:void 0,theme:i}),r=e.length>1;for(let s=0;s<e.length;s++){const i=e[s],o=Hr(i)?i(r?Object.assign({},n):n):i;for(const e in o)"className"===e?n.className=Qr(n.className,o[e]):"style"===e?n.style=Object.assign(Object.assign({},n.style),o[e]):e in t&&void 0===t[e]||(n[e]=o[e])}return"className"in t&&"string"==typeof t.className&&(n.className=Qr(n.className,t.className)),n}(n,t,f),g=r,x=p,v=u.styleSheet,y=u.stylis,m=g.generateAndInjectStyles(x,v,y);let i=0;for(const e in t)Vs.call(t,e)&&i++;e.current=[t,f,u.styleSheet,u.stylis,i,p,m,r]}}var g,x,v,y;const w=p.as||c,b=function(e,t,i,n){const r={};for(const s in e)void 0===e[s]||"$"===s[0]||"as"===s||"theme"===s&&e.theme===i||("forwardedAs"===s?r.as=e.forwardedAs:n&&!n(s,t)||(r[s]=e[s]));return r}(p,w,f,d);let E=Qr(a,l);return m&&(E+=" "+m),p.className&&(E+=" "+p.className),b[Lr(w)&&w.includes("-")?"class":"className"]=E,i&&(b.ref=i),o.createElement(w,b)}(m,e,t)}p.displayName=c;let m=React.forwardRef(p);return m.attrs=u,m.componentStyle=f,m.displayName=c,m.shouldForwardProp=d,m.foldedComponentIds=n?Qr(r.foldedComponentIds,r.styledComponentId):"",m.
1styledComponentId=h,m.target=n?r.target:e,Object.defineProperty(m,"defaultProps",{get(){return this._foldedDefaultProps},set(e){this._foldedDefaultProps=n?function(e,...t){for(const i of t)es(e,i,!0);return e}({},r.defaultProps,e):e}}),ts(m,(()=>`.${m.styledComponentId}`)),s&&Xr(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),m}function qs(e,t){const i=[e[0]];for(let n=0,r=t.length;n<r;n+=1)i.push(t[n],e[n+1]);return i}const Xs=e=>(xs.add(e),e);function Hs(e,t,i=Er){if(!t)throw pr(1,t);const n=(n,...r)=>e(t,i,function(e,...t){if(Hr(e)||Jr(e))return Xs(Rs(qs(br,[e,...t])));const i=e;return 0===t.length&&1===i.length&&"string"==typeof i[0]?Rs(i):Xs(Rs(qs(i,t)))}(n,...r));return n.attrs=n=>Hs(e,t,Object.assign(Object.assign({},i),{attrs:Array.prototype.concat(i.attrs,n).filter(Boolean)})),n.withConfig=n=>Hs(e,t,Object.assign(Object.assign({},i),n)),n}const Zs=e=>Hs($s,e),Ys=Zs;new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","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","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]).forEach((e=>{Ys[e]=Zs(e)}));const Qs="rgba(223, 223, 223, 1)",Ks="rgba(156, 156, 156, 1)",Js="rgba(243, 151, 143, 1)",eo="rgba(240, 97, 84,1)",to="rgba(38, 38, 38, 0.7)",io="rgba(61, 61, 63, 0.7)",no="rgba(61, 61, 63, 0.6)",ro="rgba(61, 61, 63, 1)",so="linear-gradient(to bottom, #343434, #393939)",oo="linear-gradient(to bottom, rgba(52, 52, 52, 0.75), rgba(57, 57, 57, 0.75))",ao="linear-gradient(to bottom, rgba(75, 75, 75, 0.75), rgba(80, 80, 80, 0.75))",lo="30px",co="30px",ho="14px",uo="3px",fo="10px",po="10px 3px 3px 10px",mo="3px 10px 10px 3px",go="70px",xo="30px",vo="3px",yo=Ys.button`
2	background: ${oo};
3	border: none;
4	display: flex;
5	align-items: center;
6	justify-content: center;
7	cursor: pointer;
8	color: ${Qs};
9	border: 1px solid transparent;
10	border-radius: ${uo};
11	font-size: ${ho};
12	height: ${lo};
13	min-width: ${co};
14	transition: all 0.2s ease-in-out;
15	text-transform: none;
16	box-shadow: none;
17	font-family: Arial, sans-serif;
18
19	&:first-child {
20		border-radius: ${({$reverse:e})=>e?mo:po};
21	}
22
23	&:last-child {
24		border-radius: ${({$reverse:e})=>e?po:mo};
25	}
26
27	&:first-child:last-child {
28		border-radius: ${fo};
29	}
30`,wo=Ys.div`
31	padding: 2px;
32	display: flex;
33	background-color: ${to};
34	border: 1px solid ${io};
35	backdrop-filter: blur(40px);
36	-webkit-backdrop-filter: blur(40px);
37	justify-content: center;
38	pointer-events: all;
39	border-radius: 14px;
40	align-items: center;
41	height: 24px;
42`,bo=Ys.button`
43	background-color: transparent;
44	border: none;
45	display: flex;
46	align-items: center;
47	justify-content: center;
48	cursor: pointer;
49	color: ${Qs};
50	border-radius: 4px;
51	font-size: 16px;
52	height: 24px;
53	min-width: 24px;
54	transition: all 0.2s ease-in-out;
55	text-transform: none;
56	box-shadow: none;
57	padding: 1px 5px;
58	font-family: Arial, sans-serif;
59
60	&:hover {
61		background-color: ${ro};
62	}
63
64	&:active {
65		background-color: ${ro};
66	}
67
68	&:focus {
69		outline: none;
70	}
71
72	&:first-child {
73		border-radius: 12px 4px 4px 12px;
74	}
75
76	&:last-child {
77		border-radius: 4px 12px 12px 4px;
78	}
79
80	&:first-child:last-child {
81		border-radius: 12px;
82	}
83`,Eo=Ys.div`
84	background-color: ${({$pressed:e})=>e?ro:no};
85	border: none;
86	display: flex;
87	align-items: center;
88	justify-content: center;
89	color: ${Qs};
90	border-radius: 8px;
91	font-size: 14px;
92	font-family: Arial, sans-serif;
93	height: 30px;
94	width: 30px;
95	transition: all 0.2s ease-in-out;
96`,To=Ys.div`
97	display: flex;
98	align-items: center;
99	height: 30px;
100	margin-bottom: 3px;
101	justify-content: flex-start;
102	flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"};
103
104	&:last-child {
105		margin-bottom: 0;
106	}
107`,So=Ys.div`
108	display: flex;
109	flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"};
110	height: 100%;
111	justify-content: space-between;
112	align-items: center;
113	margin: ${({$reverse:e})=>e?"0 5px 0 0":"0 0 0 5px"};
114	gap: 3px;
115`;Ys.button`
116	background-color: rgba(255, 255, 255, 0.3);
117	border: none;
118	display: flex;
119	justify-content: center;
120	align-items: center;
121	padding: 0;
122	pointer-events: none;
123	width: 50px;
124	height: 50px;
125	border-radius: 50%;
126	position: relative;
127	margin: 0 5px;
128	backdrop-filter: blur(10px);
129	-webkit-backdrop-filter: blur(10px);
130`,Ys.div`
131	position: absolute;
132	background-color: ${Qs};
133	border-radius: 50%;
134	width: 36px;
135	height: 36px;
136	cursor: pointer;
137	pointer-events: auto;
138`;const Mo=Ys.input.attrs({type:"range"})`
139	-webkit-appearance: none;
140	appearance: none;
141	background: ${oo};
142	border: none;
143	height: 100%;
144	width: ${go};
145	cursor: pointer;
146	margin: 0;
147	transition: all 0.2s ease-in-out;
148	border-radius: ${({$reverse:e})=>e?po:mo};
149
150	&::-webkit-slider-thumb {
151		-webkit-appearance: none;
152		appearance: none;
153		width: 8px;
154		height: 30px;
155		background-color: ${Qs};
156		border-radius: ${uo};
157	}
158
159	&::-moz-range-thumb {
160		width: 10px;
161		height: 30px;
162		background-color: ${Qs};
163		border-radius: ${uo};
164	}
165
166	&::-ms-thumb {
167		width: 8px;
168		height: 24px;
169		background-color: ${Qs};
170		border-radius: ${uo};
171	}
172`;Ys.div`
173	display: flex;
174	flex-direction: column;
175	align-items: ${({$reverse:e})=>e?"flex-start":"flex-end"};
176	justify-content: center;
177	margin: ${({$reverse:e})=>e?"2px -26px 0 0":"2px 0 0 -26px"};
178`,Ys.div`
179	display: flex;
180	flex-direction: ${({$reverse:e})=>e?"row-reverse":"row"};
181	align-items: center;
182	justify-content: center;
183`;const Ao=Ys(on)`
184	height: ${({$size:e=14})=>`${e}px`};
185	min-height: ${({$size:e=14})=>`${e}px`};
186	max-height: ${({$size:e=14})=>`${e}px`};
187	width: ${({$size:e=14})=>`${e}px`};
188	min-width: ${({$size:e=14})=>`${e}px`};
189	max-width: ${({$size:e=14})=>`${e}px`};
190	transform: ${({$reverse:e})=>e?"scaleX(-1)":"unset"};
191`,_o=Ys(on)`
192	height: 18px;
193	min-height: 18px;
194	max-height: 18px;
195	width: 18px;
196	min-width: 18px;
197	max-width: 18px;
198	margin: 6px;
199	transform: ${({$reverse:e})=>e?"scaleX(-1)":"unset"};
200`,Ro=Ys.div`
201	position: fixed;
202	padding: 5px;
203	font-family: Arial, sans-serif;
204	color: ${Qs};
205	pointer-events: all;
206	background-color: ${to};
207	border: 1px solid ${io};
208	backdrop-filter: blur(40px);
209	-webkit-backdrop-filter: blur(40px);
210	border-radius: 12px;
211	box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
212	overflow: hidden;
213	display: flex;
214	flex-direction: column;
215`,Po=Ys.hr`
216	width: ${({$horizontal:e=!0})=>e?"unset":"1px"};
217	height: ${({$horizontal:e=!0})=>e?"1px":"unset"};
218	background-color: ${io};
219	margin: 5px 3px;
220	border: none;
221`,ko=Ys.button`
222	background-color: transparent;
223	border: none;
224	display: flex;
225	align-items: center;
226	justify-content: center;
227	cursor: pointer;
228	color: ${({$isRed:e})=>e?Js:Qs};
229	font-size: 12px;
230	padding: 3px;
231	text-transform: none;
232	box-shadow: none;
233
234	&:hover {
235		color: ${({$isRed:e})=>e?eo:"#ffffff"};
236	}
237
238	&:active {
239		color: ${({$isRed:e})=>e?eo:"#ffffff"};
240	}
241
242	&:focus {
243		outline: none;
244	}
245`,Oo=Ys.div`
246	display: flex;
247	flex-direction: row;
248	gap: ${vo};
249	height: 25px;
250`,Lo=Ys.input.attrs({type:"text"})`
251	width: 50px;
252	outline: none;
253	background: ${so};
254	border: 1px solid transparent;
255	border-radius: 5px;
256	height: 25px;
257	color: ${Qs};
258	padding: 0 10px 0 5px;
259	box-sizing: border-box;
260	font-size: 10px;
261
262	&:read-only {
263		background: ${oo};
264	}
265
266	&:invalid {
267		background-color: ${Js};
268	}
269`,Io=Ys.span`
270	position: absolute;
271	right: 5px;
272	top: 50%;
273	transform: translateY(-50%);
274	pointer-events: none;
275	color: ${Ks};
276	font-size: 10px;
277`,Co={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"]},No={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"]},Do={prefix:"fas",iconName:"gamepad",icon:[640,512,[],"f11b","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"]},Fo={prefix:"fas",iconName:"hand",icon:[512,512,[129306,9995,"hand-paper"],"f256","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2
277-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z"]},jo={prefix:"fas",iconName:"plug",icon:[384,512,[128268],"f1e6","M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2C297 398 352 333.4 352 256l0-32c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]},zo={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"]},Bo={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"]},Uo={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"]},Vo={prefix:"fas",iconName:"person-shelter",icon:[512,512,[],"e54f","M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.4L256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280l0-88 16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]},Go={prefix:"fas",iconName:"hand-scissors",icon:[512,512,[],"f257","M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9c0 0 0 .1 0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]},Wo={prefix:"fas",iconName:"street-view",icon:[512,512,[],"f21d","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]},$o={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.
2776 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},qo={prefix:"fas",iconName:"bug",icon:[512,512,[],"f188","M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]},Xo={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"]},Ho={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},Zo={prefix:"fas",iconName:"hand-lizard",icon:[512,512,[],"f258","M0 112C0 85.5 21.5 64 48 64l112 0 80 0 46.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 12 0 16 0 48c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8L273.9 352 240 352l-80 0-48 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l48 0 80 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-80 0L48 160c-26.5 0-48-21.5-48-48z"]},Yo={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},Qo={prefix:"fas",iconName:"vr-cardboard",icon:[640,512,[],"f729","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]},Ko={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 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"]},Jo={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"]},ea=lo,ta={"x-button-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75
277a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),i.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}}),i.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}})]}),"y-button-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"a-button-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"b-button-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-up-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-down-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-right-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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",
277style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"pose-left":()=>i.jsx(_o,{icon:Go,$reverse:!0}),"pinch-left":()=>i.jsx(_o,{icon:Zo,$reverse:!0}),"thumbstick-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-up-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-down-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbstick-right-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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.3
27719h.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}})]}),"thumbstick-left-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"trigger-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"trigger-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"squeeze-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"squeeze-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbrest-left":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.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}})]}),"thumbrest-right":({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:ea,height:ea,fill:"none",transform:`scale(${e}, ${e})`,children:[i.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}}),i.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}}),i.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.11
2777 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}})]}),"pose-right":()=>i.jsx(_o,{icon:Go,$reverse:!1}),"pinch-right":()=>i.jsx(_o,{icon:Zo,$reverse:!1})},ia=({buttonName:e,handedness:t})=>{const n=ta[`${e}-${t}`];return n?i.jsx(n,{}):i.jsx("div",{style:{width:lo,height:lo}})},na=({size:e=14,color:t=Qs})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:i.jsx("path",{stroke:t,strokeWidth:1.5,d:"M7 13.037V5.512m-.324.289 6.3-2.275m-11.952 0 6.3 2.275m.23 6.937 4.233-1.528a1.627 1.627 0 0 0 1.076-1.53V4.396c0-.685-.43-1.297-1.076-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.075 1.53V9.68c0 .686.43 1.298 1.075 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),ra=({size:e=14,color:t=Qs})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:i.jsx("path",{stroke:t,strokeWidth:1.2,d:"M7 13.037V5.512M3.937 11.9V4.375m6.126 7.525V4.375M6.675 5.8l6.3-2.275m-9.275.962 6.3-2.275M1.024 3.526l6.3 2.275M6.85 9.388l6.3-2.275m-12.302 0 6.3 2.276m-3.15-7.176 6.3 2.276m-2.746 8.248 4.234-1.527a1.627 1.627 0 0 0 1.075-1.53V4.396c0-.685-.43-1.297-1.075-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.076 1.53V9.68c0 .686.43 1.298 1.076 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),sa=({size:e=14,color:t=Qs})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:i.jsx("path",{stroke:t,strokeWidth:1.2,d:"M1.225 8.225h11.55M2.1 5.075h9.8m-7 7L5.6 2.1m3.5 9.975L8.4 2.1m-5.708 9.712h8.617a1.75 1.75 0 0 0 1.696-2.183l-1.567-6.125a1.75 1.75 0 0 0-1.695-1.317H4.258c-.8 0-1.498.542-1.696 1.317L.996 9.629a1.75 1.75 0 0 0 1.696 2.183Z",style:{stroke:t,strokeOpacity:1}})}),oa=({size:e=14,color:t=Qs})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[i.jsx("path",{fill:t,d:"M10.5 8.367a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8Z",style:{fill:t,fillOpacity:1}}),i.jsx("path",{fill:t,fillRule:"evenodd",d:"M0 5.8A2.8 2.8 0 0 1 2.8 3h8.4A2.8 2.8 0 0 1 14 5.8v2.8a2.8 2.8 0 0 1-2.8 2.8H9.526c-.619 0-1.184-.35-1.46-.903l-.108-.214a.933.933 0 0 0-.835-.516h-.246c-.354 0-.677.2-.835.516l-.107.214a1.633 1.633 0 0 1-1.461.903H2.8A2.8 2.8 0 0 1 0 8.6V5.8Zm4.9 1.167a1.4 1.4 0 1 1-2.8 0 1.4 1.4 0 0 1 2.8 0Zm8.367-.768a.268.268 0 0 0 .076-.292 2.942 2.942 0 0 0-.187-.407l-.055-.096a3.012 3.012 0 0 0-.262-.37.27.27 0 0 0-.29-.08l-.66.21a2.279 2.279 0 0 0-.522-.302l-.148-.676a.268.268 0 0 0-.215-.211 3.062 3.062 0 0 0-1.008.001.268.268 0 0 0-.215.21l-.148.677a2.28 2.28 0 0 0-.522.301l-.66-.21a.268.268 0 0 0-.29.081c-.096.116-.184.24-.262.37l-.056.096c-.072.13-.135.265-.187.406a.268.268 0 0 0 .076.292l.513.467a2.293 2.293 0 0 0 0 .603l-.513.467a.268.268 0 0 0-.076.291c.052.141.115.276.187.407l.056.096c.078.13.166.253.262.37a.27.27 0 0 0 .29.08l.66-.211c.158.122.333.224.52.3l.149.677a.268.268 0 0 0 .215.211 3.06 3.06 0 0 0 1.007 0 .268.268 0 0 0 .216-.21l.148-.677a2.28 2.28 0 0 0 .521-.301l.66.21c.105.033.22.004.29-.08.097-.117.184-.24.263-.37l.055-.097c.073-.13.135-.265.188-.406a.268.268 0 0 0-.076-.292l-.513-.466a2.299 2.299 0 0 0 0-.602l.513-.467Z",clipRule:"evenodd",style:{fill:t,fillOpacity:1}})]}
277),aa={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:i.jsx(Ao,{icon:{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"]}}),Backspace:i.jsx(Ao,{icon:{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"]}}),Enter:i.jsx(Ao,{style:{transform:"rotate(90deg)"},icon:{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"]}}),ShiftLeft:i.jsx(Ao,{icon:Xo}),ShiftRight:i.jsx(Ao,{icon:Xo}),Space:" ",ArrowUp:i.jsx(Ao,{icon:{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"]}}),ArrowDown:i.jsx(Ao,{icon:{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"]}}),ArrowLeft:i.jsx(Ao,{icon:{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"]}}),ArrowRight:i.jsx(Ao,{icon:{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"]}}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:i.jsx((({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[i.jsx("g",{clipPath:"url(#a)",children:i.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}})}),i.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),i.jsx("defs",{children:i.jsx("clipPath",{id:"a",children:i.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{}),MouseRight:i.jsx((({scale:e=1.2})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[i.jsx("g",{clipPath:"url(#a)",children:i.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}})}),i.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}}),i.jsx("defs",{children:i.jsx("clipPath",{id:"a",children:i.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{})},la={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",pinch:"MouseLeft",pose:"KeyF"},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",pinch:"MouseRight",pose:"Backslash"}},ca=a((e=>({keyMap:la,bindKey:(t,i,n="Unmapped")=>e((e=>({keyMap:{...e.keyMap,[t]:{...e.keyMap[t],[i]:n}}})))}))),ha=Ys.div`
278	display: flex;
279	height: ${lo};
280	align-items: center;
281	justify-content: space-between;
282	margin-bottom: ${vo};
283
284	&:last-child {
285		margin-bottom: 0;
286	}
287`,ua=({handedness:e,actions:t})=>{const{keyMap:n,bindKey:r}=ca(),[s,a]=o.useState(null);return o.useEffect((()=>{const t=t=>{s&&aa[t.code]&&(r(e,s.action,t.code),a(null))},i=t=>{if(s){const i=0===t.button?"MouseLeft":2===t.button?"MouseRight":null;i&&aa[i]&&(r(e,s.action,i),a(null))}},n=e=>{e.preventDefault()};return window.addEventListener("keydown",t),window.addEventListener("mousedown",i),window.addEventListener("contextmenu",n),()=>{window.removeEventListener("keydown",t),window.removeEventListener("mousedown",i),window.removeEventListener("contextmenu",n)}}),[s]),Object.keys(n[e]).filter((e=>t.includes(e))).map((t=>i.jsxs(ha,{children:[i.jsx(ia,{buttonName:"up"===t?"thumbstick":t,handedness:e}),i.jsxs(So,{$reverse:!1,children:[i.jsx(yo,{$reverse:!1,style:{width:"100px",background:s&&s.action===t?ao:oo},onClick:()=>(e=>{a({action:e})})(t),onContextMenu:e=>e.preventDefault(),children:n[e][t]}),i.jsx(yo,{style:{width:xo},$reverse:!1,onClick:()=>r(e,t),onContextMenu:e=>e.preventDefault(),children:i.jsx(on,{icon:zo})})]})]},t)))},da=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[s,a]=o.useState(!1),[l,c]=o.useState(!1),[h,u]=o.useState(!1),[d,f]=o.useState(0),p=e.inputSource.handedness;return o.useEffect((()=>{const i=i=>{i.code===r&&(e.updateButtonValue(t,1),u(!0))},s=i=>{i.code===r&&(e.updateButtonValue(t,0),u(!1))},o=i=>{("MouseLeft"===r&&0===i.button||"MouseRight"===r&&2===i.button)&&(e.updateButtonValue(t,1),u(!0))},a=i=>{("MouseLeft"===r&&0===i.button||"MouseRight"===r&&2===i.button)&&(e.updateButtonValue(t,0),u(!1))};return n?"MouseLeft"===r||"MouseRight"===r?(window.addEventListener("mousedown",o),window.addEventListener("mouseup",a)):(window.addEventListener("keydown",i),window.addEventListener("keyup",s)):"MouseLeft"===r||"MouseRight"===r?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",a)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",s)),()=>{"MouseLeft"===r||"MouseRight"===r?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",a)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",s))}}),[r,n,t,e]),i.jsxs(To,{$reverse:"right"===p,children:[i.jsx(ia,{buttonName:t,handedness:p}),i.jsx(So,{$reverse:"right"===p,children:n?i.jsx(Eo,{$pressed:h,children:aa[r]}):i.jsxs(i.Fragment,{children:[i.jsx(yo,{$reverse:"right"===p,style:{background:l?ao:oo,width:go},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout((()=>{c(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),i.jsx(yo,{title:"Click to toggle touch state",$reverse:"right"===p,style:{background:s?ao:oo,width:xo},onClick:()=>{a(!s),e.updateButtonTouch(t,!s)},children:i.jsx(Ao,{icon:No})}),i.jsx(Mo,{$reverse:"right"===p,value:d,onChange:i=>{const n=Number(i.target.value);f(n),e.updateButtonValue(t,n/100)},min:"0",max:"100"})]})})]})},fa=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:r})=>{const[s,a]=o.useState(!1),[l,c]=o.useState(!1),[h,u]=o.useState(!1),[d,f]=o.useState(!1),p=e.inputSource.handedness;return o.useEffect((()=>{const i=i=>{i.code===r&&(e.updateButtonValue(t,1),f(!0))},s=i=>{i.code===r&&(e.updateButtonValue(t,0),f(!1))};return n?(window.addEventListener("keydown",i),window.addEventListener("keyup",s)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",s)),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",s)}}),[r,n,t,e]),i.jsxs(To,{$reverse:"right"===p,children:[i.jsx(ia,{buttonName:t,handedness:p}),i.jsx(So,{$reverse:"right"===p,children:n?i.jsx(Eo,{$pressed:d,children:aa[r]}):i.jsxs(i.Fragment,{children:[i.jsx(yo,{$reverse:"right"===p,style:{background:h?ao:oo,width:go},onClick:()=>{u(!0),e.updateButtonValue(t,1),setTimeout((()=>{u(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),i.jsx(yo,{title:"Click to toggle touch state",$reverse:"right"===p,style:{background:s?ao:oo,width:xo},onClick:()=>{a(!s),e.updateButtonTouch(t,!s)},children:i.jsx(Ao,{icon:No})}),i.jsx(yo,{$reverse:"right"===p,style:{background:l?ao:oo,width:go},onClick:()=>{c(!l),e.updateButtonValue(t,l?0:1)},children:"Hold"})]})})]})},pa=Ys.div`
288	display: flex;
289	align-items: center;
290	margin-bottom: ${vo};
291`,ma=`calc(2 * ${lo} + ${vo})`,ga=Ys.button`
292	background: ${oo};
293	border: none;
294	display: flex;
295	justify-content: center;
296	align-items: center;
297	padding: 0;
298	pointer-events: none;
299	width: ${ma};
300	height: ${ma};
301	border-radius: 50%;
302	position: relative;
303	margin: 0 5px;
304`,xa=Ys.div`
305	position: absolute;
306	font-size: 50px;
307	display: flex;
308	align-items: center;
309	justify-content: center;
310	color: ${Qs};
311	cursor: pointer;
312	pointer-events: auto;
313`,va=Ys(yo)`
314	width: ${go};
315	font-size: ${ho};
316
317	${({$reverse:e})=>e?`\n    &:first-child {\n      border-radius: ${mo};\n    }\n\n    &:last-child {\n      border-radius: ${po};\n    }\n  `:`\n    &:first-child {\n      border-radius: ${po};\n    }\n\n    &:last-child {\n      border-radius: ${mo};\n    }\n  `}
318`,ya=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:r,mappedKeyDown:s,mappedKeyLeft:a,mappedKeyRight:l,mappedKeyPressed:c})=>{const h=o.useRef(null),[u,d]=o.useState(!1),[f,p]=o.useState(!1),[m,g]=o.useState(!1),[x,v]=o.useState(!1),[y,w]=o.useState({x:0,y:0}),[b,E]=o.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),T=e.inputSource.handedness,S=t=>{if(u&&h.current){const i=t.clientX-y.x,r=t.clientY-y.y,s=12;let o,a;if(Math.sqrt(i*i+r*r)<s)o=i,a=r;else{const e=Math.atan2(r,i);o=Math.cos(e)*s,a=Math.sin(e)*s}h.current.style.transform=`translate(${o}px, ${a}px)`;const l=o/s,c=a/s;e.updateAxes(n,l,c)}},M=()=>{d(!1),h.current&&(h.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return o.useEffect((()=>{const i=t=>{const i={...b};t.code===r&&(i.up=!0),t.code===s&&(i.down=!0),t.code===a&&(i.left=!0),t.code===l&&(i.right=!0),t.code===c&&(i.pressed=!0,e.updateButtonValue(n,1)),E(i),h(i)},o=t=>{const i={...b};t.code===r&&(i.up=!1),t.code===s&&(i.down=!1),t.code===a&&(i.left=!1),t.code===l&&(i.right=!1),t.code===c&&(i.pressed=!1,e.updateButtonValue(n,0)),E(i),h(i)},h=t=>{const i=(t.right?1:0)-(t.left?1:0),r=(t.down?1:0)-(t.up?1:0),s=Math.sqrt(i*i+r*r);if(0===s)return void e.updateAxes(n,0,0);const o=i/s,a=r/s;e.updateAxes(n,o,a)};return t?(window.addEventListener("keydown",i),window.addEventListener("keyup",o)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",o)),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",o)}}),[r,s,a,l,t,b]),o.useEffect((()=>(document.addEventListener("mousemove",S),document.addEventListener("mouseup",M),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",M)})),[u,y]),t?i.jsxs(i.Fragment,{children:[i.jsxs(To,{$reverse:"right"===T,children:[i.jsx(ia,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),i.jsxs(So,{$reverse:"right"===T,children:[i.jsx(Eo,{$pressed:b.up,children:aa[r]}),i.jsx(Eo,{$pressed:b.pressed,children:aa[c]})]})]}),i.jsx(To,{$reverse:"right"===T,style:"right"===T?{marginRight:"2px"}:{marginLeft:"2px"},children:i.jsxs(So,{$reverse:!1,style:{margin:0},children:[i.jsx(Eo,{$pressed:b.left,children:aa[a]}),i.jsx(Eo,{$pressed:b.down,children:aa[s]}),i.jsx(Eo,{$pressed:b.right,children:aa[l]})]})})]}):i.jsx(pa,{style:{flexDirection:"left"===e.inputSource.handedness?"row":"row-reverse",alignItems:"flex-start"},children:i.jsxs(i.Fragment,{children:[i.jsx(ia,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),i.jsx(ga,{style:{margin:"0 5px"},children:i.jsx(xa,{ref:h,onMouseDown:()=>{if(h.current){const e=h.current.getBoundingClientRect();w({x:e.left+e.width/2,y:e.top+e.height/2}),d(!0)}},children:i.jsx(Ao,{icon:Ko,$size:50})})}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"right"===T?"start":"end"},children:[i.jsx(yo,{$reverse:"right"===T,style:{background:x?ao:oo,width:`calc(${go} + ${xo} + ${vo})`,marginBottom:vo,borderRadius:fo},onClick:()=>{v(!0),e.updateButtonValue(n,1),setTimeout((()=>{v(!1),e.updateButtonValue(n,0)}),250)},children:"Press"}),i.jsxs(So,{$reverse:"right"===T,children:[i.jsx(va,{title:"Click to toggle touch state",$reverse:"left"!==e.inputSource.handedness,style:{background:f?ao:oo,width:xo},onClick:()=>{p(!f),e.updateButtonTouch(n,!f)},children:i.jsx(Ao,{icon:No})}),i.jsx(va,{$reverse:"left"!==e.inputSource.handedness,style:{background:m?ao:oo,width:go},onClick:()=>{g(!m),e.updateButtonValue(n,m?0:1)},children:"Hold"})]})]})]})})};function wa(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}const ba=Ys.div`
319	width: 100%;
320	display: flex;
321	flex-direction: row;
322	justify-content: space-between;
323	align-items: center;
324	margin: 0;
325	font-size: 12px;
326`,Ea=({vector:e,label:t="",icon:n,multiplier:r=1,precision:s=2,onValidInput:a=()=>{},marginBottom:l="0"})=>
326{const[c,h]=o.useState({x:(e.x/r).toFixed(s),y:(e.y/r).toFixed(s),z:(e.z/r).toFixed(s)}),u=o.useRef({x:wa(e.x/r,s),y:wa(e.y/r,s),z:wa(e.z/r,s)}),d=o.useRef(null),f=()=>{const t={x:wa(e.x/r,s),y:wa(e.y/r,s),z:wa(e.z/r,s)},{x:i,y:n,z:o}=u.current;t.x===i&&t.y===n&&t.z===o||(u.current=t,h({x:t.x.toFixed(s),y:t.y.toFixed(s),z:t.z.toFixed(s)})),d.current=requestAnimationFrame(f)};o.useEffect((()=>(d.current=requestAnimationFrame(f),()=>{d.current&&cancelAnimationFrame(d.current)})),[e,r,s]);const p=t=>i=>{const n=i.target.value,s=parseFloat(n);h((e=>({...e,[t]:n}))),isNaN(s)||(u.current[t]=s,e[t]=s*r,a())};return i.jsxs(ba,{style:{marginBottom:l},children:[n?i.jsx(Ao,{icon:n,style:{marginRight:"5px"}}):i.jsx("span",{style:{marginRight:"5px"},children:t}),i.jsx(Oo,{children:["x","y","z"].map((e=>i.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[i.jsx(Lo,{value:c[e],onChange:p(e),className:parseFloat(c[e])!==u.current[e]?"invalid":void 0}),i.jsx(Io,{children:e.toUpperCase()})]},`${t}-${e}`)))})]})};const Ta=({controller:e,handle:t,handedness:n,pointerLocked:r})=>{const{keyMap:s}=ca(),[o,a]=React.useState(e.connected),[l,c]=React.useState(!1),h=function(e){const t=new Set;for(const n of e.axes)n&&n.id&&t.add(n.id);const i=e.buttons.filter((e=>null!==e)).map((e=>({id:e.id,type:e.type,hasAxes:t.has(e.id)})));return i.sort(((e,t)=>e.hasAxes&&!t.hasAxes?-1:!e.hasAxes&&t.hasAxes?1:0)),i}(e.gamepadConfig),u=h.flatMap((e=>e.hasAxes?[`${e.id}-left`,`${e.id}-right`,`${e.id}-up`,`${e.id}-down`,e.id]:e.id));return React.useEffect((()=>{r&&c(!1)}),[r]),i.jsxs(Ro,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!r&&i.jsx(i.Fragment,{children:i.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[i.jsx(Ao,{icon:Do,style:{marginRight:"5px"}}),"Controller ",i.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:o?i.jsxs(i.Fragment,{children:[i.jsx(ko,{title:`Click to ${l?"close":"change"} key bindings`,onClick:()=>{c(!l)},children:i.jsx(Ao,{icon:$o})}),i.jsx(ko,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,a(!1)},children:i.jsx(Ao,{icon:Ko})})]}):i.jsx(ko,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,a(!0)},style:{marginLeft:"5px"},children:i.jsx(Ao,{icon:jo})})})]})}),o&&!r&&i.jsxs(i.Fragment,{children:[!l&&i.jsxs(i.Fragment,{children:[i.jsx(Po,{}),i.jsx(Ea,{vector:t.position,label:"Position",marginBottom:vo}),i.jsx(Ea,{vector:t.rotation,label:"Rotation"})]}),i.jsx(Po,{})]}),o&&(l?i.jsx(ua,{handedness:n,actions:u}):h.map((t=>{const o=s[n];return t.hasAxes?i.jsx(ya,{xrController:e,pointerLocked:r,buttonId:t.id,mappedKeyUp:s[n][`${t.id}-up`],mappedKeyDown:o[`${t.id}-down`],mappedKeyLeft:o[`${t.id}-left`],mappedKeyRight:o[`${t.id}-right`],mappedKeyPressed:o[t.id]},t.id):"analog"===t.type?i.jsx(da,{xrController:e,buttonId:t.id,mappedKey:o[t.id],pointerLocked:r},t.id):i.jsx(fa,{xrController:e,buttonId:t.id,mappedKey:o[t.id],pointerLocked:r},t.id)})))]},n)},Sa=`calc(${go} + ${xo} + ${vo})`,Ma=({hand:e,pointerLocked:t,mappedKey:n})=>{const[r,s]=o.useState(!1),[a,l]=o.useState(!1),[c,h]=o.useState(0),u=e.inputSource.handedness;return o.useEffect((()=>{const i=t=>{t.code===n&&(e.updatePinchValue(1),l(!0))},r=t=>{t.code===n&&(e.updatePinchValue(0),l(!1))},s=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(1),l(!0))},o=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(0),l(!1))};return t?"MouseLeft"===n||"MouseRight"===n?(window.addEventListener("mousedown",s),window.addEventListener("mouseup",o)):(window.addEventListener("keydown",i),window.addEventListener("keyup",r)):"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",s),window.removeEventListener("mouseup",o)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r)),()=>{"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",s),window.removeEventListener("mouseup",o)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r))}}),[n,t,e]),i.jsxs(To,{$reverse:"right"===u,children:[i.jsx(_o,{icon:Zo,$reverse:"left"===u}),i.jsx(So,{$reverse:"right"===u,children:t?i.jsx(Eo,{$pressed:a,children:aa[n]}):i.jsxs(i.Fragment,{children:[i.jsx(yo,{$reverse:"right"===u,style:{background:r?ao:oo,width:go},onClick:()=>{s(!0),e.updatePinchValue(1),setTimeout((()=>{s(!1),e.updatePinchValue(0)}),250)},children:"Pinch"}),i.jsx(Mo,{$reverse:"right"===u,value:c,onChange:t=>{const i=Number(t.target.value);h(i),e.updatePinchValue(i/100)},style:{width:Sa},min:"0",max:"100"})]})})]})},Aa=["default","point"],_a=`calc(2 * ${go} - ${xo})`,Ra=({hand:e,pointerLocked:t,mappedKey:n})=>{const[r,s]=o.useState(e.poseId),[a,l]=o.useState(!1),c=e.inputSource.handedness,h=t=>{const i=(Aa.indexOf(e.poseId)+Aa.length+t)%Aa.length;s(Aa[i]),e.poseId=Aa[i]},u="right"===c;return o.useEffect((()=>{const e=e=>{e.code===n&&(h(1),l(!0))},i=e=>{e.code===n&&l(!1)};return t?(window.addEventListener("keydown",e),window.addEventListener("keyup",i)):(window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)}}),[n,t,e]),i.jsxs(To,{$reverse:u,children:[i.jsx(_o,{icon:Go,$reverse:"left"===c}),i.jsx(So,{$reverse:u,children:t?i.jsx(Eo,{$pressed:a,children:aa[n]}):i.jsxs(i.Fragment,{children:[i.jsx(yo,{$reverse:u,style:{width:xo},onClick:()=>{h(u?1:-1)},children:i.jsx(Ao,{icon:u?Yo:Ho})}),i.jsxs(yo,{$reverse:u,style:{width:_a},disabled:!0,children:["Pose: ",r]}),i.jsx(yo,{$reverse:u,style:{width:xo},onClick:()=>{h(u?-1:1)},children:i.jsx(Ao,{icon:u?Ho:Yo})})]})})]})},Pa=({hand:e,handle:t,handedness:n,pointerLocked:r})=>{const{keyMap:s}=ca(),[o,a]=React.useState(e.connected),[l,c]=React.useState(!1);return React.useEffect((()=>{r&&c(!1)}
326),[r]),i.jsxs(Ro,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!r&&i.jsx(i.Fragment,{children:i.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[i.jsx(Ao,{icon:Fo,$reverse:"left"===n,style:{marginRight:"5px"}}),"Hand ",i.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:o?i.jsxs(i.Fragment,{children:[i.jsx(ko,{title:`Click to ${l?"close":"change"} key bindings`,onClick:()=>{c(!l)},children:i.jsx(Ao,{icon:$o})}),i.jsx(ko,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,a(!1)},children:i.jsx(Ao,{icon:Ko})})]}):i.jsx(ko,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,a(!0)},style:{marginLeft:"5px"},children:i.jsx(Ao,{icon:jo})})})]})}),o&&!r&&i.jsxs(i.Fragment,{children:[!l&&i.jsxs(i.Fragment,{children:[i.jsx(Po,{}),i.jsx(Ea,{vector:t.position,label:"Position",marginBottom:vo}),i.jsx(Ea,{vector:t.rotation,label:"Rotation"})]}),i.jsx(Po,{})]}),o&&(l?i.jsx(ua,{handedness:n,actions:["pose","pinch"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ra,{hand:e,pointerLocked:r,mappedKey:s[n].pose}),i.jsx(Ma,{hand:e,pointerLocked:r,mappedKey:s[n].pinch})]}))]},n)},ka=a((e=>({inputMode:"controller",setInputMode:t=>e((()=>({inputMode:t})))}))),Oa=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const{inputMode:r}=ka();return i.jsx(i.Fragment,{children:"controller"===r?Object.entries(e.controllers).map((([e,r])=>i.jsx(Ta,{controller:r,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`controller-${e}`))):Object.entries(e.hands).map((([e,r])=>i.jsx(Pa,{hand:r,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`hand-${e}`)))})},La=Ys.td`
327	text-align: right;
328	color: ${Qs};
329	padding: 0 8px 0 0;
330	font-weight: bold;
331`,Ia=Ys.td`
332	text-align: left;
333	color: ${Ks};
334	padding: 0;
335`,Ca=["meeting_room","living_room","music_room","office_large","office_small"],Na=a((e=>({infoPanelOpen:!1,envDropDownOpen:!1,setInfoPanelOpen:t=>e((()=>({infoPanelOpen:t}))),setEnvDropDownOpen:t=>e((()=>({envDropDownOpen:t})))})));const Da=({xrDevice:e,inputLayer:t})=>{var n,r,s;const[o,a]=React.useState(Boolean(null===(n=e.sem)||void 0===n?void 0:n.planesVisible)),[l,c]=React.useState(Boolean(null===(r=e.sem)||void 0===r?void 0:r.boun
335dingBoxesVisible)),[h,u]=React.useState(Boolean(null===(s=e.sem)||void 0===s?void 0:s.meshesVisible)),{inputMode:d,setInputMode:f}=ka(),{infoPanelOpen:p,setInfoPanelOpen:m,envDropDownOpen:g,setEnvDropDownOpen:x}=Na();return i.jsxs("div",{style:{display:"flex",justifyContent:"center",flexDirection:"row",alignItems:"center",gap:"6px",padding:"8px"},children:[i.jsx(wo,{children:i.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[i.jsx(bo,{title:"Click to reset device transforms",onClick:()=>{t.resetDeviceTransforms()},children:i.jsx(Ao,{icon:Bo,$size:16})}),i.jsx(bo,{title:"Click to activate play mode",onClick:()=>{t.lockPointer(),x(!1),m(!1)},children:i.jsx(Ao,{icon:Uo,$size:16})}),i.jsx(bo,{title:"Click to toggle input mode",onClick:()=>{"controller"===d?(f("hand"),e.primaryInputMode="hand"):(f("controller"),e.primaryInputMode="controller")},children:i.jsx(Ao,{icon:"controller"===d?Do:Fo,$size:16})}),e.sem&&i.jsxs(i.Fragment,{children:[i.jsx(Po,{$horizontal:!1}),i.jsx(bo,{title:"Click to select/change emulated environment",onClick:()=>x(!g),children:i.jsx(Ao,{icon:Vo,$size:16})}),i.jsx(bo,{title:"Click to toggle visibility of planes",onClick:()=>{e.sem.planesVisible=!o,a(!o)},children:i.jsx(sa,{size:16,color:o?Qs:Ks})}),i.jsx(bo,{title:"Click to toggle visibility of bounding boxes",onClick:()=>{e.sem.boundingBoxesVisible=!l,c(!l)},children:i.jsx(na,{size:16,color:l?Qs:Ks})}),i.jsx(bo,{title:"Click to toggle visibility of meshes",onClick:()=>{e.sem.meshesVisible=!h,u(!h)},children:i.jsx(ra,{size:16,color:h?Qs:Ks})})]}),i.jsx(Po,{$horizontal:!1}),i.jsx(bo,{title:"Click to exit XR session",onClick:()=>{const t=e.activeSession;null==t||t.end()},children:i.jsx(Ao,{icon:Co,$size:16})})]})}),i.jsx(wo,{children:i.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[i.jsx(bo,{title:"About IWER",onClick:()=>{m(!p)},children:i.jsx(oa,{size:16})}),i.jsx(bo,{title:"Report issues",onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/issues","_blank")},children:i.jsx(Ao,{icon:qo,$size:16})})]})}),p&&i.jsxs(Ro,{style:{top:"50vh",left:"50vw",transform:"translate(-50%, -50%)",maxWidth:"240px",gap:"4px"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"end"},children:i.jsx(ko,{$isRed:!0,onClick:()=>{m(!1)},children:i.jsx(Ao,{icon:Ko})})}),i.jsx("div",{style:{display:"flex",justifyContent:"center"},children:i.jsx(oa,{size:100})}),i.jsxs("p",{style:{textAlign:"center",padding:"0 5px",margin:"0"},children:[i.jsx("b",{children:"Immersive Web Emulation Runtime"})," (IWER) is a free, open-source WebXR developer tool created by Meta Platforms, Inc."]}),i.jsx("table",{style:{width:"100%",borderCollapse:"collapse",display:"flex",justifyContent:"center",fontSize:"12px",padding:"8px"},children:i.jsxs("tbody",{children:[i.jsxs("tr",{children:[i.jsx(La,{children:"IWER"}),i.jsxs(Ia,{children:["v",e.version]})]}),i.jsxs("tr",{children:[i.jsx(La,{children:"DevUI"}),i.jsxs(Ia,{children:["v",e.devui.version]})]}),e.sem&&i.jsxs("tr",{children:[i.jsx(La,{children:"SEM"}),i.jsxs(Ia,{children:["v",e.sem.version]})]})]})}),i.jsx(yo,{style:{borderRadius:fo},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/blob/main/LICENSE","_blank")},children:"MIT License"}),i.jsx(yo,{style:{borderRadius:fo},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime","_blank")},children:"View Source on GitHub"})]}),g&&i.jsx(Ro,{style:{position:"absolute",top:"40px"},children:Ca.map((t=>{return i.jsx("div",{children:i.jsx(bo,{style:{fontSize:"12px",width:"100%",justifyContent:"start",borderRadius:"8px"},onClick:()=>{e.sem.loadDefaultEnvironment(t)},children:(n=t,n.split("_").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))})},t);var n}))})]})},Fa=Ys.div`
336	width: 100%;
337	display: flex;
338	flex-direction: row;
339	justify-content: space-between;
340	align-items: center;
341	margin-top: ${vo};
342	font-size: 12px;
343`,ja=Ys.input.attrs({type:"range"})`
344	-webkit-appearance: none;
345	appearance: none;
346	background: ${so};
347	border: 1px solid transparent;
348	height: 25px;
349	color: ${Qs};
350	width: ${go};
351	cursor: pointer;
352	margin: 0;
353	border-radius: 5px;
354	padding: 0 10px 0 5px;
355	box-sizing: border-box;
356	font-size: 10px;
357
358	&::-webkit-slider-thumb {
359		-webkit-appearance: none;
360		appearance: none;
361		width: 8px;
362		height: 25px;
363		background-color: ${Qs};
364		border-radius: ${uo};
365	}
366
367	&::-moz-range-thumb {
368		width: 8px;
369		height: 25px;
370		background-color: ${Qs};
371		border-radius: ${uo};
372	}
373
374	&::-ms-thumb {
375		width: 8px;
376		height: 25px;
377		background-color: ${Qs};
378		border-radius: ${uo};
379	}
380`,za=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const[r,s]=React.useState(e.fovy);return i.jsxs(Ro,{style:{left:"8px",top:"8px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:"20px"},children:[i.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"start"},children:[i.jsx(Ao,{icon:Qo,style:{marginRight:"5px"}}),i.jsx("div",{style:{alignItems:"end"},children:e.name})]}),i.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"}})]}),i.jsx(Po,{}),i.jsx(Ea,{vector:t.combinedCameraPosition,icon:Wo}),!n&&i.jsxs(Fa,{children:[i.jsx(Ao,{icon:Jo,style:{marginRight:"5px"}}),i.jsxs(Oo,{children:[i.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[i.jsx(Lo,{type:"text",value:(r/Math.PI*180).toFixed(0)+"°",readOnly:!0,style:{width:"73px"}}),i.jsx(Io,{children:"FOV-Y"})]}),i.jsx("div",{style:{position:"relative",display:"inline-block"},children:i.jsx(ja,{value:r,onChange:t=>{const i=Number(t.target.value);s(i),e.fovy=i}
380,min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48,style:{width:"80px"}})})]})]})]})},Ba=new c,Ua=new c,Va={x:"XYZ",y:"YXZ",z:"ZXY"};function Ga(e,t,i,n,r,s){Ba.copy(i),null!=r&&Ba.premultiply(Ua.copy(r).invert());const o=new l,a=new h,c=new l;let d;Ba.decompose(o,a,c),el(o,n.initialTargetPosition,s.translate??!0);const f=s.rotate??!0;if(!1===f)a.copy(n.initialTargetQuaternion),d=n.initialTargetRotation.clone();else if(Array.isArray(f)||!0===f||"string"!=typeof f&&!Array.isArray(f)&&!0===f.x&&!0===f.y&&!0===f.z)d=(new u).setFromQuaternion(a,n.initialTargetRotation.order);else if("string"==typeof f){const e=Va[f];d=(new u).setFromQuaternion(a,e);for(const t of e){const e=t.toLowerCase();e!==f&&(d[e]=0)}d.order=n.initialTargetRotation.order,a.setFromEuler(d)}else d=function(e,t,i){let n="",r="";for(const a of t.order)!1===i[a.toLowerCase()]?r+=a:n+=a;const s=n+r,o=(new u).setFromQuaternion(e,s);for(const a of s){const e=a.toLowerCase();o[e]=tl(e,o[e],t[e],i)}return e.setFromEuler(o),o}(a,n.initialTargetRotation,f);return"object"==typeof s.scale&&s.scale.uniform||el(c,n.initialTargetScale,s.scale??!0),{pointerAmount:t,position:o,quaternion:a,rotation:d,scale:c,time:e}}const Wa=new d,$a=new l,qa=new l,Xa=new l,Ha=new h;function Za(e,t,i){return Wa.normal.copy(e),Wa.constant=0,function(e,t){if(0===t.x)return void e.set(1,0,0);if(0===t.y)return void e.set(0,1,0);if(0===t.z)return void e.set(0,0,1);e.set(-t.y,t.x,0)}($a,Wa.normal),qa.copy($a),qa.applyQuaternion(Ha.copy(t).invert().premultiply(i)),Wa.projectPoint($a,$a).normalize(),Wa.projectPoint(qa,qa).normalize(),(Xa.crossVectors($a,Wa.normal).dot(qa)<0?1:-1)*$a.angleTo(qa)}const Ya=new l,Qa=new d,Ka=new l,Ja=new l;function el(e,t,i){if(Array.isArray(i))switch(i.length){case 0:return void e.copy(t);case 1:return e.sub(t),xl(e,i[0]instanceof l?i[0]:Ya.fromArray(i[0])),void e.add(t);case 2:return Ya.crossVectors(i[0]instanceof l?i[0]:Ka.fromArray(i[0]),i[1]instanceof l?i[1]:Ja.fromArray(i[1])),Qa.setFromNormalAndCoplanarPoint(Ya,t),void Qa.projectPoint(e,e)}else e.x=tl("x",e.x,t.x,i),e.y=tl("y",e.y,t.y,i),e.z=tl("z",e.z,t.z,i)}function tl(e,t,i,n){if("boolean"==typeof n)return n?t:i;if("string"==typeof n)return n===e?t:i;const r=n[e];return!1===r?i:Array.isArray(r)?B(t,...r):t}function il(e=!0,t,i,n,r,s){if(e){switch(t.length){case 0:case 3:return;case 1:return void function(e,t,i,n,r){const s=null==r?0:1-Math.abs(t.dot(r));if(null==r||s<.001)return void gl(n,e,t);ml.subVectors(i,e);const o=t.dot(r),a=t.dot(ml),l=r.dot(ml),c=1-o*o,h=(a-o*l)/c;if((o*a-l)/c<0)return void gl(n,e,t);ml.copy(n),n.copy(e).addScaledVector(t,h)}(i,...t,n,r,s);case 2:return void function(e,t,i,n,r,s){pl.crossVectors(e,t).normalize(),fl.setFromNormalAndCoplanarPoint(pl,i);const o=null==s?0:Math.abs(pl.dot(s));if(null==s||o<.01)return void fl.projectPoint(r,r);const a=fl.distanceToPoint(n),l=-a/s.dot(fl.normal);if(l<0)return void fl.projectPoint(r,r);ml.copy(r),r.copy(n).addScaledVector(s,l)}(...t,i,n,r,s)}throw new Error(`space cannot be ${t.length}D but received (${t.map((e=>e.toArray().join("/"))).join("; ")})`)}}const nl={x:new l(1,0,0),y:new l(0,1,0),z:new l(0,0,1)};function rl(e,t,i,n,r){if(!1!==n){if(!0===n)return e[0]=nl.x,e[1]=nl.y,void(e[2]=nl.z);if("string"!=typeof n)if(Array.isArray(n))for(const s of n)hl(e,t,i,s,r);else!1!==n.x&&hl(e,t,i,"x",r),!1!==n.y&&hl(e,t,i,"y",r),!1!==n.z&&hl(e,t,i,"z",r);else hl(e,t,i,n,r)}}const sl=new h,ol=new u,al=new l,ll=new l,cl=new l;function hl(e,t,i,n,r){if(Array.isArray(n)?al.set(...n):n instanceof l?al.copy(n):al.copy(nl[n]),"translate"===r)return al.applyQuaternion(t),void dl(e,al);if("scale"===r)return Array.isArray(n)?sl.identity():sl.setFromEuler(i),sl.premultiply(t),al.applyQuaternion(sl),void dl(e,al);if(Array.isArray(n))ol.set(0,0,0);else{ol.copy(i);for(let e=2;e>=0;e--){const t=i.order[e].toLowerCase();if(ol[t]=0,t===n)break}}sl.setFromEuler(ol).premultiply(t),al.normalize(),ll.set(0,1,0),al.dot(ll)>.99&&ll.set(0,0,1),cl.crossVectors(al,ll).normalize(),ll.copy(cl),cl.applyQuaternion(sl),dl(e,cl),cl.crossVectors(al,ll).normalize(),cl.applyQuaternion(sl),dl(e,cl)}const ul=new l;function dl(e,t){3!==e.length&&(0!==e.length?1!==e.length?(ul.crossVectors(e[0],e[1]),Math.abs(ul.dot(t))<.001||e.push(t.clone())):Math.abs(e[0].dot(t))<.999&&e.push(t.clone()):e.push(t.clone()))}const fl=new d,pl=new l,ml=new l;function gl(e,t,i){e.sub(t),xl(e,i),e.add(t)}function xl(e,t){const i=e.dot(t);e.copy(t).multiplyScalar(i)}const vl=new c,yl=new c,wl=new l,bl=new l,El=new h,Tl=new l(1,1,1),Sl=[];
380const Ml=new l,Al=new l,_l=new l,Rl=new l,Pl=new l,kl=new l,Ol=new l,Ll=new c,Il=new c,Cl=new c,Nl=new h,Dl=new h,Fl=[];const jl=new l,zl=new l,Bl=new l,Ul=new l,Vl=new l,Gl=new h,Wl=new h,$l=new c,ql=new l,Xl=[];class Hl{constructor(e,i){t(this,"t1"),t(this,"t2"),t(this,"_position"),t(this,"_quaternion"),t(this,"_rotation"),t(this,"_scale"),this.t1=e,this.t2=i}get time(){return this.t1.time-this.t2.time}get position(){return this._position??(this._position=this.t1.position.clone().sub(this.t2.position))}get quaternion(){return this._quaternion??(this._quaternion=this.t2.quaternion.clone().invert().premultiply(this.t1.quaternion))}get rotation(){return this._rotation??(this._rotation=(new u).setFromQuaternion(this.quaternion))}get scale(){return this._scale??(this._scale=this.t1.scale.clone().sub(this.t2.scale))}}class Zl{constructor(e){t(this,"cancel"),t(this,"previous"),t(this,"memo"),t(this,"event"),t(this,"initial"),t(this,"current"),t(this,"first"),t(this,"last"),t(this,"_delta"),t(this,"_offset"),this.cancel=e}start(e,t){this.event=e,this.previous=void 0,this.current=t,this.initial=t,this.first=!0,this.last=!1,this.memo=void 0,this._delta=void 0,this._offset=void 0}update(e,t){this.event=e,this.previous=this.current,this.current=t,this.first=!1,this.last=!1,this._delta=void 0,this._offset=void 0}end(e){this.event=e,this.first=!1,this.last=!0,this._delta=void 0,this._offset=void 0}get delta(){if(null!=this.previous)return this._delta??(this._delta=new Hl(this.current,this.previous))}get offset(){return this._offset??(this._offset=new Hl(this.current,this.initial))}}function Yl(e,t){if("sphere"===e.details.type)return!1;if("lines"===e.details.type){const{line:i}=e.details;return t.copy(i.end).sub(i.start).normalize(),!0}return"screen-ray"===e.details.type?(t.copy(e.details.direction),!0):(t.set(0,0,-1).applyQuaternion(e.pointerQuaternion),!0)}const Ql=new l;class Kl{constructor(e,i=()=>({})){t(this,"target"),t(this,"getOptions"),t(this,"outputState"),t(this,"latestMoveEvent"),t(this,"inputState",new Map),t(this,"capturedObjects",new Map),t(this,"initialTargetPosition",new l),t(this,"initialTargetQuaternion",new h),t(this,"initialTargetRotation",new u),t(this,"initialTargetScale",new l),t(this,"initialTargetParentWorldMatrix"),t(this,"prevTwoPointerDeltaRotation"),t(this,"prevTranslateAsDeltaRotation"),t(this,"prevAngle"),t(this,"handlers",{onPointerDown:this.onPointerDown.bind(this),onPointerMove:this.onPointerMove.bind(this),onPointerEnd:this.onPointerEnd.bind(this)}),this.target=e,this.getOptions=i,this.outputState=new Zl(this.cancel.bind(this))}firstOnPointer(e){const t=this.getTarget();if(null==t)return;const i=Yl(e,Ql)?Ql.clone():void 0;e.intersection.details.type,this.inputState.set(e.pointerId,{pointerWorldDirection:i,pointerWorldPoint:e.point,pointerWorldOrigin:e.pointerPosition,pointerWorldQuaternion:e.pointerQuaternion,initialPointerWorldPoint:e.point.clone(),initialPointerWorldDirection:null==i?void 0:i.clone(),initialPointerWorldQuaternion:e.pointerQuaternion.clone(),prevPointerWorldQuaternion:e.pointerQuaternion}),this.save(),1===this.inputState.size&&this.outputState.start(e,{pointerAmount:1,time:e.timeStamp,position:this.initialTargetPosition.clone(),quaternion:this.initialTargetQuaternion.clone(),rotation:this.initialTargetRotation.clone(),scale:this.initialTargetScale.clone()}),this.outputState.memo=this.apply(t)}onPointerDown(e){var t,i;!1!==(null==(i=(t=this.getOptions()).filter)?void 0:i.call(t,e))&&(this.stopPropagation(e),this.capturePointer(e.pointerId,e.object)&&this.firstOnPointer(e))}onPointerMove(e){if(!this.capturedObjects.has(e.pointerId))return;this.stopPropagation(e);const t=this.inputState.get(e.pointerId);null!=t?(this.latestMoveEvent=e,t.pointerWorldPoint=e.point,t.prevPointerWorldQuaternion=t.pointerWorldQuaternion,t.pointerWorldQuaternion=e.pointerQuaternion,t.pointerWorldOrigin=e.pointerPosition,null!=t.pointerWorldDirection&&Yl(e,t.pointerWorldDirection)):this.firstOnPointer(e)}cancel(){if(0===this.capturedObjects.size)return;for(const[t,i]of this.capturedObjects)i.releasePointerCapture(t);this.capturedObjects.clear(),this.inputState.clear(),this.outputState.end(void 0);const e=this.getTarget();null!=e&&this.apply(e)}onPointerEnd(e){const t=this.capturedObjects.get(e.pointerId);null!=t&&(this.stopPropagation(e),this.releasePointer(e.pointerId,t,e))}update(e){var t,i,n;const r=this.getTarget();if(null==r||0===this.inputState.size||null==this.latestMoveEvent&&!1===(this.getOptions().al
380waysUpdate??!1))return;const s=this.getOptions();let o;if("as-rotate"===s.translate||"as-rotate-and-scale"===s.translate||"as-scale"===s.translate){s.translate,this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0;const[i]=this.inputState.values();o=function(e,t,i,n,r,s){if(null==r?Gl.identity():r.decompose(jl,Gl,zl),Xl.length=0,"as-scale"===s.translate&&rl(Xl,Gl,i.initialTargetRotation,s.scale??!0,"scale"),"as-scale"!=s.translate&&rl(Xl,Gl,i.initialTargetRotation,s.rotate??!0,"rotate"),$l.makeTranslation(i.initialTargetPosition),null!=i.initialTargetParentWorldMatrix&&$l.premultiply(i.initialTargetParentWorldMatrix),Ul.setFromMatrixPosition($l),il(s.projectRays,Xl,t.initialPointerWorldPoint,t.pointerWorldOrigin,Ul,void 0),Ul.negate().add(t.initialPointerWorldPoint),Vl.setFromMatrixPosition(n),il(s.projectRays,Xl,t.initialPointerWorldPoint,t.pointerWorldOrigin,Vl,void 0),il(s.projectRays,Xl,t.initialPointerWorldPoint,t.pointerWorldOrigin,zl.copy(t.pointerWorldPoint),t.pointerWorldDirection),Vl.negate().add(zl),"as-scale"===s.translate?Gl.copy(i.initialTargetQuaternion):(jl.copy(Ul),null!=i.prevTranslateAsDeltaRotation&&jl.applyQuaternion(i.prevTranslateAsDeltaRotation),jl.normalize(),zl.copy(Vl).normalize(),Gl.setFromUnitVectors(jl,zl),null==i.prevTranslateAsDeltaRotation?i.prevTranslateAsDeltaRotation=new h:Gl.multiply(i.prevTranslateAsDeltaRotation),i.prevTranslateAsDeltaRotation.copy(Gl),null!=i.initialTargetParentWorldMatrix&&(Wl.setFromRotationMatrix(i.initialTargetParentWorldMatrix),Gl.multiply(Wl.normalize()),Gl.premultiply(Wl.invert())),Gl.multiply(i.initialTargetQuaternion)),"as-rotate"===s.translate)ql.set(1,1,1);else if("object"==typeof s.scale&&s.scale.uniform)ql.setScalar(Vl.length()/Ul.length());else if("as-rotate-and-scale"===s.translate){$l.compose(i.initialTargetPosition,i.initialTargetQuaternion,i.initialTargetScale),null!=i.initialTargetParentWorldMatrix&&$l.premultiply(i.initialTargetParentWorldMatrix),$l.decompose(zl,Wl,Bl),jl.copy(Ul).applyQuaternion(Wl.invert()).divide(Bl),jl.x=Math.abs(jl.x),jl.y=Math.abs(jl.y),jl.z=Math.abs(jl.z);const e=Math.max(...jl.toArray());jl.divideScalar(e),ql.set(1,1,1),ql.addScaledVector(jl,Vl.length()/Ul.length()-1)}else null!=i.initialTargetParentWorldMatrix?(i.initialTargetParentWorldMatrix.decompose(jl,Wl,zl),Wl.multiply(i.initialTargetQuaternion)):Wl.copy(i.initialTargetQuaternion),jl.copy(Ul).applyQuaternion(Wl.invert()),null!=r?(r.decompose(zl,Wl,Bl),Wl.multiply(i.initialTargetQuaternion)):Wl.copy(i.initialTargetQuaternion),zl.copy(Vl).applyQuaternion(Wl.invert()),ql.x=Math.abs(jl.x)<.001?1:Math.abs(zl.x/jl.x),ql.y=Math.abs(jl.y)<.001?1:Math.abs(zl.y/jl.y),ql.z=Math.abs(jl.z)<.001?1:Math.abs(zl.z/jl.z);return ql.multiply(i.initialTargetScale),$l.compose(i.initialTargetPosition,Gl,ql),Ga(e,1,$l,i,void 0,s)}(e,i,this,r.matrixWorld,null==(t=r.parent)?void 0:t.matrixWorld,s)}else if(1===this.inputState.size){this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0,this.prevTranslateAsDeltaRotation=void 0;const[t]=this.inputState.values();o=function(e,t,i,n,r){return null==n?El.identity():n.decompose(wl,El,bl),Sl.length=0,rl(Sl,El,i.initialTargetRotation,r.translate??!0,"translate"),yl.makeRotationFromQuaternion(El.copy(t.initialPointerWorldQuaternion).invert()).multiply(vl.makeTranslation(wl.copy(t.initialPointerWorldPoint).negate())),null!=i.initialTargetParentWorldMatrix&&yl.multiply(i.initialTargetParentWorldMatrix),il(r.projectRays,Sl,t.initialPointerWorldPoint,t.pointerWorldOrigin,wl.copy(t.pointerWorldPoint),t.pointerWorldDirection),El.copy(t.pointerWorldQuaternion),!1===(r.rotate??!0)&&El.copy(t.initialPointerWorldQuaternion),vl.compose(wl,El,Tl).multiply(yl).multiply(yl.compose(i.initialTargetPosition,i.initialTargetQuaternion,i.initialTargetScale)),Ga(e,1,vl,i,n,r)}(e,t,this,null==(i=r.parent)?void 0:i.matrixWorld,s)}else{this.prevTranslateAsDeltaRotation=void 0;const[t,i]=this.inputState.values();o=function(e,t,i,n,r,s){null==r?Nl.identity():r.decompose(_l,Nl,Rl),Fl.length=0,rl(Fl,Nl,n.initialTargetRotation,s.translate??!0,"translate"),rl(Fl,Nl,n.initialTargetRotation,s.rotate??!0,"rotate"),rl(Fl,Nl,n.initialTargetRotation,s.scale??!0,"scale"),il(s.projectRays,Fl,t.initialPointerWorldPoint,t.pointerWorldOrigin,_l.copy(t.pointerWorldPoint),t.pointerWorldDirection),il(s.projectRays,Fl,i.initialPointerWorldPoint,i.pointerWorldOrigin,Rl.copy(i.pointerWorldPoint),i.pointerWorldDirection),Ml.copy(i.initialPointerWorldPoint).sub(t.initialPointerWorldPoint),Al.copy(Rl).sub(_l),_l.copy(Ml),null!=n.prevTwoPointerDeltaRotation&&_l.applyQuaternion(n.prevTwoPointerDeltaRotation),_l.normalize(),Rl.copy(Al).normalize(),Nl.setFromUnitVectors(_l,Rl),null==n.prevTwoPointerDeltaRotation?n.prevTwoPointerDeltaRotation=new h:Nl.multiply(n.prevTwoPointerDeltaRotation),n.prevTwoPointerDeltaRotation.copy(Nl);const o=.5*(Za(Rl,t.prevPointerWorldQuaternion,t.pointerWorldQuaternion)+Za(Rl,i.prevPointerWorldQuaternion,i.pointerWorldQuaternion))+(n.prevAngle??0);if(n.prevAngle=o,Nl.premultiply(Dl.setFromAxisAngle(Rl,o)),Cl.compose(n.initialTargetPosition,n.initialTargetQuaternion,n.initialTargetScale),null!=n.initialTargetParentWorldMatrix&&Cl.premultiply(n.initialTargetParentWorldMatrix),"object"==typeof s.scale&&s.scale.uniform)Ol.setScalar(Al.length()/Ml.length());else{Cl.decompose(Pl,Dl,kl),_l.copy(Ml).applyQuaternion(Dl.invert()).divide(kl),_l.x=Math.abs(_l.x),_l.y=Math.abs(_l.y),_l.z=Math.abs(_l.z);const e=Math.max(..._l.toArray());_l.divideScalar(e),Ol.set(1,1,1),Ol.addScaledVector(_l,Al.length()/Ml.length()-1)}return Ll.makeTranslation(_l.copy(Al).multiplyScalar(.5).add(t.pointerWorldPoint)).multiply(Il.makeRotationFromQuaternion(Nl)).multiply(Il.makeRotationFromQuaternion(Dl.invert())).multiply(Il.makeScale(Ol.x,Ol.y,Ol.z)).multiply(Il.makeRotationFromQuaternion(Dl.invert())).multiply(Il.makeTranslation(_l.copy(Ml).multiplyScalar(.5).add(t.initialPointerWorldPoint).negate())).multiply(Cl),Ga(e,2,Ll,n,r,s)}(e,t,i,this,null==(n=r.parent)?void 0:n.matrixWorld,s)}this.outputState.update(this.latestMoveEvent,o),this.outputState.memo=this.apply(r),this.latestMoveEvent=void 0}getTarget(){var e;return this.target instanceof f?this.target:null==(e=this.target)?void 0:e.current}capturePointer(e,t){if(this.capturedObjects.has(e))return!1;const{multitouch:i,translate:n}=this.getOptions();return(!1!==(i??!0)&&"string"!=typeof n||1!==this.capturedObjects.size)&&(this.capturedObjects.set(e,t),t.setPointerCapture(e),!0)}releasePointer(e,t,i){const n=this.getTarget();null!=n&&this.capturedObjects.delete(e)&&(this.inputState.delete(e),t.releasePointerCapture(e),this.inputState.size>0?this.save():(this.outputState.end(i),this.apply(n)))}stopPropagation(e){var t;null!=e&&((null==(t=this.getOptions())?void 0:t.stopPropagation)??1)&&e.stopPropagation()}apply(e){return(this.getOptions().apply??ec)(this.outputState,e)}getState(){return 0===this.inputState.size?void 0:this.outputState}save(){var e,t;const i=this.getTarget();if(null!=i){i.updateWorldMatrix(!0,!1),this.prevAngle=void 0,this.prevTwoPointerDeltaRotation=void 0,this.prevTranslateAsDeltaRotation=void 0,this.initialTargetParentWorldMatrix=null==(e=i.parent)?void 0:e.matrixWorld.clone(),i.matrixAutoUpdate?(this.initialTargetPosition.copy(i.position),this.initialTargetQuaternion.copy(i.quaternion),this.initialTargetRotation.copy(i.rotation),this.initialTargetScale.copy(i.scale)):(i.matrix.decompose(this.initialTargetPosition,this.initialTargetQuaternion,this.initialTargetScale),this.initialTargetRotation.setFromQuaternion(this.initialTargetQuaternion,i.rotation.order));for(const e of this.inputState.values())null!=e.pointerWorldDirection&&(null==(t=e.initialPointerWorldDirection)||t.copy(e.pointerWorldDirection)),e.initialPointerWorldPoint.copy(e.pointerWorldPoint),e.initialPointerWorldQuaternion.copy(e.pointerWorldQuaternion)}}bind(e){const{onPointerDown:t,onPointerMove:i,onPointerEnd:n}=this.handlers;return e.addEventListener("pointerdown",t),e.addEventListener("pointermove",i),e.addEventListener("pointercancel",n),e.addEventListener("pointerup",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("pointermove",i),e.removeEventListener("pointercancel",n),e.removeEventListener("pointerup",n),this.cancel()}}capture(e,t){return this.capturePointer(e,t)?()=>this.releasePointer(e,t,void 0):Jl}}function Jl(){}function ec(e,t){t.position.copy(e.current.position),t.rotation.order=e.current.rotation.order,t.quaternion.copy(e.current.quaternion),t.scale.copy(e.current.scale)}class tc{constructor(e,i){t(this,"target"),t(this,"getOptions"),t(this,"handles",[]),t(this,"hoveredTagMap",new Map),t(this,"hoverSubscriptions",[]),t(this,"applySubscriptions",[]),t(this,"space"),this.target=e,this.getOptions=i}getSpace(){return this.space??"world"}getTarget(){return this.target instanceof f?this.target:this.target.current}getHandleOptions(e,t){var i;const n=null==(i=this.getOptions)?void 0:i.call(this),r=null==t?void 0:t();return{...n,...r,apply:(t,i)=>{var s;return this.onApply(e,t,i),null==(s=(null==r?void 0:r.apply)??(null==n?void 0:n.apply)??ec)?void 0:s(t,i)}}}registerHandle(e,t,i){const n={object:t,store:e,tag:i};this.handles.push(n);const r=e.bind(t),s=this.onPointerEnter.bind(this,i),o=this.onPointerLeave.bind(this);return t.addEventListener("pointerenter",s),t.addEventListener("pointerleave",o),()=>{const t=this.handles.indexOf(n);-1!=t&&this.handles.splice(t,1),r(),e.cancel()}}subscribeHover(e){return this.hoverSubscriptions.push(e),e(Array.from(this.hoveredTagMap.values())
380),()=>{const t=this.hoverSubscriptions.indexOf(e);-1!==t&&this.hoverSubscriptions.splice(t,1)}}subscribeApply(e){return this.applySubscriptions.push(e),()=>{const t=this.applySubscriptions.indexOf(e);-1!==t&&this.applySubscriptions.splice(t,1)}}update(e){for(const{store:t}of this.handles)t.update(e)}onPointerEnter(e,t){this.hoveredTagMap.set(t.pointerId,e),this.updateHover()}onPointerLeave(e){this.hoveredTagMap.delete(e.pointerId),this.updateHover()}updateHover(){const e=Array.from(this.hoveredTagMap.values());for(const t of this.hoverSubscriptions)t(e)}onApply(e,t,i){for(const n of this.applySubscriptions)n(e,t,i)}}const ic={depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0};function nc(e,t,i,{color:n,hoverColor:r,hoverOpacity:s,opacity:o,disabled:a=!1}){return null==r&&null==s||a?(t.color.set(n),t.opacity=o??1,void(a&&(t.opacity*=.5,t.color.lerp(new p(1,1,1),.5)))):(r??(r=n),e.subscribeHover((e=>{const a=e.some((e=>e.includes(i)));t.color.set(a?r:n),t.opacity=(a?s:o)??1})))}const rc=new h,sc=new g;sc.setAttribute("position",new v([-1e3,0,0,1e3,0,0],3));class oc extends m{constructor(e,i){super(sc),t(this,"context"),t(this,"rotationOffset"),this.context=e,this.rotationOffset=i,this.renderOrder=1/0}update(){this.quaternion.setFromEuler(this.rotationOffset);const e=this.context.getTarget();"world"===this.context.getSpace()&&null!=e&&(e.getWorldQuaternion(rc).invert(),this.quaternion.premultiply(rc))}bind(e){this.material=new x({...ic,color:this.material.color??"white",opacity:this.material.opacity??1});const t=this.context.subscribeHover((t=>{const i=t.some((t=>t.includes(e)));this.visible=i})),i=this.context.subscribeApply(((e,t)=>{if(t.last)return void this.position.set(0,0,0);this.position.copy(t.initial.position).sub(t.current.position);const i=this.context.getTarget();null!=i&&(rc.copy(i.quaternion).invert(),this.position.applyQuaternion(rc))}));return()=>{this.material.dispose(),t(),i()}}}class ac extends y{constructor(e,i,n,r){super(),t(this,"context"),t(this,"axis"),t(this,"store"),t(this,"options"),t(this,"tag"),this.context=e,this.axis=i,this.tag=(n??"")+i,this.store=new Kl(e.target,(()=>e.getHandleOptions(this.tag,r)))}}function lc(e,t=!0){if(!1===t)return{options:!1,disabled:!0};if(!0===t){const t={x:!1,y:!1,z:!1,e:!1};for(const i of e)t[i]=!0;return{options:t,disabled:!1}}if("disabled"===t)return{options:{x:!0,y:!0,z:!0,e:!0},disabled:!0};if("string"==typeof t)return{options:t===e&&{x:!1,y:!1,z:!1,e:!1,[e]:!0},disabled:!1};const i={x:!1,y:!1,z:!1,e:!1};let n=!1;for(const r of e){let e=t[r]??!0;if(!1===e)return{options:!1,disabled:!0};"disabled"===e&&(n=!0,e=!0),i[r]=e}return{options:i,disabled:n}}const cc=new l,hc=new l;function uc(e,t,i,n){if(!i)return n;let r;return t instanceof w?r=(t.top-t.bottom)/t.zoom:(t.getWorldPosition(cc),e.getWorldPosition(hc),r=cc.distanceTo(hc)*Math.min(1.9*Math.tan(Math.PI*t.fov/360)/t.zoom,7)),r*n/4}const dc=new T(0,.04,.1,12);dc.translate(0,.05,0);const fc=new T(.0075,.0075,.5,3);fc.translate(0,.25,0);const pc=new u(0,0,-Math.PI/2),mc=new u(0,0,Math.PI/2);class gc extends ac{constructor(e,i,n="",r,s=!1,o=!0){super(e,i,n,(()=>({scale:!1,rotate:!1,translate:null!=r?[r]:this.options,multitouch:!1}))),t(this,"invert"),t(this,"showArrowBody"),this.invert=s,this.showArrowBody=o}bind(e,t,i){const{options:n,disabled:r}=lc(this.axis,i);if(!1===n)return;this.options=n;const s=this.invert?mc:pc,o=new b(ic),a=nc(this.context,o,this.tag,{color:e,hoverColor:t,disabled:r}),l=new E(dc,o);let c,h;if(l.renderOrder=1/0,l.position.x=this.invert?-.5:.5,l.rotation.copy(s),this.add(l),this.showArrowBody){const t=new b(ic);c=nc(this.context,t,this.tag,{color:e,hoverColor:16777024,disabled:r}),h=new E(fc,t),h.renderOrder=1/0,h.rotation.copy(s),this.add(h)}const u=new E(new T(.13,0,.6,4));u.pointerEventsOrder=1/0,u.position.x=this.invert?-.3:.3,u.rotation.copy(s),u.visible=!1,this.add(u);const d=r?void 0:this.context.registerHandle(this.store,u,this.tag);return()=>{o.dispose(),null==d||d(),null==a||a(),null==c||c(),this.remove(l),null!=h&&this.remove(h),this.remove(u)}}}class xc extends ac{constructor(e,t,i="",n){super(e,t,i,(()=>({translate:n??this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e,t,i){const{options:n,disabled:r}=lc(this.axis,i);if(!1===n)return;this.options=n;const s=new b(ic),o=nc(this.context,s,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t,disabled:r}),a=new E(new S(.2,.2,.01),s);a.renderOrder=1/0,a.pointerEventsOrder=1/0,a.position.set(.15,.15,0);const l=r?void 0:this.context.registerHandle(this.store,a,this.tag);return this.add(a),()=>{s.dispose(),a.geometry.dispose(),null==l||l(),null==o||o(),this.remove(a)}}}new l;const vc=new h;class yc extends ac{constructor(e){super(e,"xyz","",(()=>({translate:this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e){const{options:t,disabled:i}=lc(this.axis,e);if(!1===t)return;this.options=t;const n=new b(ic),r=nc(this.context,n,this.tag,{color:16777215,hoverColor:16776960,op
380acity:.25,hoverOpacity:1,disabled:i}),s=new E(new M(.1,0),n);s.renderOrder=1/0,this.add(s);const o=new E(new M(.2,0));o.pointerEventsOrder=1/0,o.visible=!1,this.add(o);const a=i?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{n.dispose(),s.geometry.dispose(),o.geometry.dispose(),null==a||a(),null==r||r(),this.remove(s),this.remove(o)}}}const wc=new l,bc=new h,Ec=new h,Tc=(new h).setFromEuler(new u(0,0,Math.PI/2)),Sc=(new h).setFromEuler(new u(0,-Math.PI/2,0)),Mc=new h,Ac=(new h).setFromEuler(new u(0,-Math.PI/2,0)),_c=(new h).setFromEuler(new u(Math.PI/2,0,0));class Rc extends y{constructor(e,i,n){super(),t(this,"context"),t(this,"size"),t(this,"fixed"),t(this,"free"),t(this,"translationX"),t(this,"translationY"),t(this,"translationZ"),t(this,"translationNegX"),t(this,"translationNegY"),t(this,"translationNegZ"),t(this,"translationXY"),t(this,"translationYZ"),t(this,"translationXZ"),t(this,"scaleGroup",new y),t(this,"xAxis",new l),t(this,"yAxis",new l),t(this,"zAxis",new l),t(this,"negXAxis",new l),t(this,"negYAxis",new l),t(this,"negZAxis",new l),this.context=e,this.size=i,this.fixed=n,this.add(this.scaleGroup),this.free=new yc(this.context),this.scaleGroup.add(this.free),this.translationX=new gc(this.context,"x",void 0,this.xAxis),this.scaleGroup.add(this.translationX),this.translationY=new gc(this.context,"y",void 0,this.yAxis),this.scaleGroup.add(this.translationY),this.translationZ=new gc(this.context,"z",void 0,this.zAxis),this.scaleGroup.add(this.translationZ),this.translationNegX=new gc(this.context,"x",void 0,this.negXAxis,!0,!1),this.scaleGroup.add(this.translationNegX),this.translationNegY=new gc(this.context,"y",void 0,this.negYAxis,!0,!1),this.scaleGroup.add(this.translationNegY),this.translationNegZ=new gc(this.context,"z",void 0,this.negZAxis,!0,!1),this.scaleGroup.add(this.translationNegZ),this.translationXY=new xc(this.context,"xy",void 0,[this.xAxis,this.yAxis]),this.scaleGroup.add(this.translationXY),this.translationXZ=new xc(this.context,"xz",void 0,[this.xAxis,this.zAxis]),this.scaleGroup.add(this.translationXZ),this.translationYZ=new xc(this.context,"yz",void 0,[this.yAxis,this.zAxis]),this.scaleGroup.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.xAxis.set(1,0,0),this.yAxis.set(0,1,0),this.zAxis.set(0,0,1),this.free.quaternion.identity(),this.translationX.quaternion.copy(Ec),this.translationY.quaternion.copy(Tc),this.translationZ.quaternion.copy(Sc),this.translationNegX.quaternion.copy(Ec),this.translationNegY.quaternion.copy(Tc),this.translationNegZ.quaternion.copy(Sc),this.translationXY.quaternion.copy(Mc),this.translationYZ.quaternion.copy(Ac),this.translationXZ.quaternion.copy(_c);const t=this.context.getSpace(),i=this.context.getTarget();"world"==t&&null!=i?(i.getWorldQuaternion(bc).invert(),this.free.quaternion.premultiply(bc),this.translationX.quaternion.premultiply(bc),this.translationY.quaternion.premultiply(bc),this.translationZ.quaternion.premultiply(bc),this.translationNegX.quaternion.premultiply(bc),this.translationNegY.quaternion.premultiply(bc),this.translationNegZ.quaternion.premultiply(bc),this.translationXY.quaternion.premultiply(bc),this.translationYZ.quaternion.premultiply(bc),this.translationXZ.quaternion.premultiply(bc),null!=i.parent&&(i.parent.getWorldQuaternion(bc).invert(),this.xAxis.applyQuaternion(bc),this.yAxis.applyQuaternion(bc),this.zAxis.applyQuaternion(bc))):null!=i&&(this.xAxis.applyQuaternion(i.quaternion),this.yAxis.applyQuaternion(i.quaternion),this.zAxis.applyQuaternion(i.quaternion)),this.negXAxis.copy(this.xAxis).negate(),this.negYAxis.copy(this.yAxis).negate(),this.negZAxis.copy(this.zAxis).negate(),this.scaleGroup.scale.setScalar(1),null!=i&&(i.getWorldScale(wc),this.scaleGroup.scale.divide(wc)),this.scaleGroup.scale.multiplyScalar(uc(this,e,this.fixed??!0,this.size??1))}bind(e){const t=function(e,t){const i=new E(new M(.01,2),new b(ic));i.renderOrder=1/0,i.visible=!1,e.add(i);const n=new E(new M(.01,2),new b(ic));n.renderOrder=1/0,n.visible=!1,e.add(n);const r=new g;r.setAttribute("position",new v([0,0,0,1,1,1],3));const s=new m(r,new x(ic));s.renderOrder=1/0,s.visible=!1,e.add(s);const o=t.subscribeApply(((e,r)=>{n.position.set(0,0,0),i.position.copy(r.initial.position).sub(r.current.position);const o=t.getTarget();null!=o&&(vc.copy(o.quaternion).invert(),i.position.applyQuaternion(vc)),s.position.set(0,0,0),s.scale.copy(i.position),i.visible=!r.last,s.visible=!r.last,n.visible=!r.last}));return()=>{i.geometry.dispose(),i.material.dispose(),n.geometry.dispose(),n.material.dispose(),s.geometry.dispose(),s.material.dispose(),e.remove(i),e.remove(n),e.remove(s),o()}}(this,this.context),i=this.translationX.bind(16711680,16776960,e),n=this.translationY.bind(65280,16776960,e),r=this.translationZ.bind(255,16776960,e),s=this.translationNegX.bind(16711680,16776960,e),o=this.translationNegY.bind(65280,16776960,e),a=this.translationNegZ.bind(255,16776960,e),l=this.translationXY.bind(255,16776960,e),c=this.translationYZ.bind(16711680,16776960,e),h=this.translationXZ.bind(65280,16776960,e),u=this.free.bind(e);return()=>{t(),null==i||i(),null==n||n(),null==r||r(),null==s||s(),null==o||o(),null==a||a(),null==l||l(),null==c||c(),null==h||h(),null==u||u()}}}const Pc=new u(0,0,-Math.PI/2),kc=new u(0,0,Math.PI/2);class Oc extends ac{constructor(e,i,n="",r=!1,s=!0){super(e,i,n,(()=>({scale:this.options,rotate:!1,translate:"as-scale",multitouch:!1}))),t(this,"invert"),t(this,"showHandleLine"),this.invert=r,this.showHandleLine=s}bind(e,t,i){const{options:n,disabled:r}=lc(this.axis,i);if(!1===n)return;this.options=n;const s=this.invert?kc:Pc,o=new y;o.position.x=this.invert?-.5:.5,o.rotation.copy(s),this.add(o);const a=new b(ic),l=nc(this.context,a,this.tag,{color:e,hoverColor:t,disabled:r}
380),c=new E(new S(.08,.08,.08),a);let h,u,d;if(c.renderOrder=1/0,c.rotation.copy(s),o.add(c),this.showHandleLine){d=new y,d.rotation.copy(s),this.add(d);const i=new b(ic);h=nc(this.context,i,this.tag,{color:e,hoverColor:t,disabled:r}),u=new E(new T(.0075,.0075,.5,3),i),u.renderOrder=1/0,u.position.y=.25,d.add(u)}const f=new y;f.visible=!1,f.rotation.copy(s),f.position.x=this.invert?-.3:.3,this.add(f);const p=new E(new T(.2,0,.5,4));p.pointerEventsOrder=1/0,p.position.y=.04,f.add(p);const m=r?void 0:this.context.registerHandle(this.store,p,this.tag);return()=>{a.dispose(),p.geometry.dispose(),c.geometry.dispose(),null==u||u.geometry.dispose(),null==m||m(),null==l||l(),null==h||h(),null!=d&&this.remove(d),this.remove(f),this.remove(o)}}}class Lc extends ac{constructor(e,t,i=""){super(e,t,i,(()=>({translate:"as-scale",scale:this.options,rotate:!1,multitouch:!1})))}bind(e,t,i){const{options:n,disabled:r}=lc(this.axis,i);if(!1===n)return;this.options=n;const s=new b(ic),o=nc(this.context,s,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t,disabled:r}),a=new E(new S(.2,.2,.01),s);a.renderOrder=1/0,a.pointerEventsOrder=1/0,a.position.set(.15,.15,0);const l=r?void 0:this.context.registerHandle(this.store,a,this.tag);return this.add(a),()=>{s.dispose(),a.geometry.dispose(),null==l||l(),null==o||o(),this.remove(a)}}}const Ic=new u(0,0,-Math.PI/2),Cc=new u(0,0,Math.PI/2);class Nc extends ac{constructor(e,i="",n,r=!1){super(e,"xyz",i,(()=>({scale:{uniform:!0,...this.options},rotate:!1,translate:"as-scale",multitouch:!1}))),t(this,"actualAxis"),t(this,"invert"),this.actualAxis=n,this.invert=r}bind(e,t,i){const{options:n,disabled:r}=lc(this.actualAxis,i);if(!1===n)return;this.options=n;const s=this.invert?Cc:Ic,o=new y;o.position.x=this.invert?-.7:.7,o.rotation.copy(s),this.add(o);const a=new b(ic),l=nc(this.context,a,this.tag,{color:e,hoverColor:t,o
380pacity:.5,hoverOpacity:1,disabled:r}),c=new E(new S(.08,.08,.08),a);c.renderOrder=1/0,c.rotation.copy(s),o.add(c);const h=new E(new S(.15,.15,.15),a);h.visible=!1,h.pointerEventsOrder=1/0,h.rotation.copy(s),o.add(h);const u=r?void 0:this.context.registerHandle(this.store,h,this.tag);return()=>{a.dispose(),c.geometry.dispose(),null==u||u(),null==l||l(),this.remove(o)}}}const Dc=new l;class Fc extends y{constructor(e,i,n){super(),t(this,"context"),t(this,"size"),t(this,"fixed"),t(this,"scaleX"),t(this,"scaleY"),t(this,"scaleZ"),t(this,"scaleNegX"),t(this,"scaleNegY"),t(this,"scaleNegZ"),t(this,"translationX"),t(this,"translationY"),t(this,"translationZ"),t(this,"translationNegX"),t(this,"translationNegY"),t(this,"translationNegZ"),t(this,"translationXY"),t(this,"translationYZ"),t(this,"translationXZ"),this.context=e,this.size=i,this.fixed=n,this.scaleX=new Nc(this.context,void 0,"x"),this.add(this.scaleX),this.scaleY=new Nc(this.context,void 0,"y"),this.scaleY.rotation.z=Math.PI/2,this.add(this.scaleY),this.scaleZ=new Nc(this.context,void 0,"z"),this.scaleZ.rotation.y=-Math.PI/2,this.add(this.scaleZ),this.scaleNegX=new Nc(this.context,void 0,"x",!0),this.add(this.scaleNegX),this.scaleNegY=new Nc(this.context,void 0,"y",!0),this.scaleNegY.rotation.z=Math.PI/2,this.add(this.scaleNegY),this.scaleNegZ=new Nc(this.context,void 0,"z",!0),this.scaleNegZ.rotation.y=-Math.PI/2,this.add(this.scaleNegZ),this.translationX=new Oc(this.context,"x"),this.add(this.translationX),this.translationY=new Oc(this.context,"y"),this.translationY.rotation.z=Math.PI/2,this.add(this.translationY),this.translationZ=new Oc(this.context,"z"),this.translationZ.rotation.y=-Math.PI/2,this.add(this.translationZ),this.translationNegX=new Oc(this.context,"x",void 0,!0,!1),this.add(this.translationNegX),this.translationNegY=new Oc(this.context,"y",void 0,!0,!1),this.translationNegY.rotation.z=Math.PI/2,this.add(this.translationNegY),this.translationNegZ=new Oc(this.context,"z",void 0,!0,!1),this.translationNegZ.rotation.y=-Math.PI/2,this.add(this.translationNegZ),this.translationXY=new Lc(this.context,"xy"),this.add(this.translationXY),this.translationXZ=new Lc(this.context,"xz"),this.translationXZ.rotation.x=Math.PI/2,this.add(this.translationXZ),this.translationYZ=new Lc(this.context,"yz"),this.translationYZ.rotation.y=-Math.PI/2,this.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(Dc),this.scale.divide(Dc)),this.scale.multiplyScalar(uc(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.scaleX.bind(16777215,16776960,e),i=this.scaleY.bind(16777215,16776960,e),n=this.scaleZ.bind(16777215,16776960,e),r=this.scaleNegX.bind(16777215,16776960,e),s=this.scaleNegY.bind(16777215,16776960,e),o=this.scaleNegZ.bind(16777215,16776960,e),a=this.translationX.bind(16711680,16776960,e),l=this.translationY.bind(65280,16776960,e),c=this.translationZ.bind(255,16776960,e),h=this.translationNegX.bind(16711680,16776960,e),u=this.translationNegY.bind(65280,16776960,e),d=this.translationNegZ.bind(255,16776960,e),f=this.translationXY.bind(255,16776960,e),p=this.translationYZ.bind(16711680,16776960,e),m=this.translationXZ.bind(65280,16776960,e);return()=>{null==a||a(),null==l||l(),null==c||c(),null==h||h(),null==u||u(),null==d||d(),null==f||f(),null==p||p(),null==m||m(),null==t||t(),null==i||i(),null==n||n(),null==r||r(),null==s||s(),null==o||o()}}}const jc={x:{vector1:new l(0,0,-1),vector2:new l(0,-1,0),rotationOffset:new h,axis:[1,0,0]},y:{vector1:new l(0,0,-1),vector2:new l(-1,0,-1),rotationOffset:(new h).setFromEuler(new u(0,0,Math.PI/2)),axis:[0,1,0]},z:{vector1:new l(-1,0,0),vector2:new l(0,-1,0),rotationOffset:(new h).setFromEuler(new u(0,Math.PI/2,0)),axis:[0,0,1]}},zc=new l,Bc=new l,Uc=new l,Vc=new l,Gc=new h;class Wc extends ac{constructor(e,i,n=""){super(e,i,n,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1}))),t(this,"direction",new l(1,0,0))}update(e){const{rotationOffset:t,vector1:i,vector2:n}=jc[this.axis];e.getWorldPosition(zc),this.getWorldPosition(Bc).sub(zc),Uc.copy(i),Vc.copy(n);const r=this.context.getTarget(),s=this.context.getSpace();"local"===s&&null!=r&&(r.getWorldQuaternion(Gc),Uc.applyQuaternion(Gc),Vc.applyQuaternion(Gc)),Vc.crossVectors(Uc,Vc);const o=Bc.dot(Vc);Vc.multiplyScalar(o),Bc.sub(Vc),this.quaternion.setFromUnitVectors(Uc,Bc.normalize()),"local"===s&&null!=r&&(r.getWorldQuaternion(Gc),this.quaternion.multiply(Gc)),this.quaternion.multiply(t),null!=(null==r?void 0:r.parent)?(r.parent.matrixWorld.decompose(zc,Gc,Bc),Gc.invert(),this.quaternion.premultiply(Gc)):Gc.identity(),null==this.store.getState()&&(this.direction.fromArray(jc[this.axis].axis),this.direction.applyQuaternion("local"===s&&null!=r?null==r?void 0:r.quaternion:Gc)),null!=r&&this.quaternion.premultiply(Gc.copy(r.quaternion).invert())}bind(e,t){const{options:i,disabled:n}=lc(this.axis,t);if(!1===i)return;this.options=i;const r=new b(ic),s=nc(this.context,r,this.tag,{color:e,hoverColor:16776960,disabled:n}),o=new E(th(.5,.5),r);o.renderOrder=1/0,this.add(o);const a=new E(new A(.5,.1,4,24));a.visible=!1,a.pointerEventsOrder=1/0,a.rotation.set(0,-Math.PI/2,-Math.PI/2),this.add(a);const l=n?void 0:this.context.registerHandle(this.store,a,this.tag);return()=>
380{r.dispose(),a.geometry.dispose(),o.geometry.dispose(),null==l||l(),null==s||s(),this.remove(a),this.remove(o)}}}const $c=new l,qc=new l,Xc=new l(1,0,0),Hc=new h;class Zc extends ac{constructor(e,t=""){super(e,"xyz",t,(()=>({scale:!1,translate:"as-rotate",rotate:this.options,multitouch:!1})))}update(e){e.getWorldPosition($c),this.getWorldPosition(qc).sub($c),this.quaternion.setFromUnitVectors(Xc,qc.normalize());const t=this.context.getTarget();null!=(null==t?void 0:t.parent)&&(t.parent.matrixWorld.decompose($c,Hc,qc),Hc.invert(),this.quaternion.premultiply(Hc)),null!=t&&(Hc.copy(t.quaternion).invert(),this.quaternion.premultiply(Hc))}bind(e){const{options:t,disabled:i}=lc(this.axis,e);if(!1===t)return;this.options=t;const n=new b(ic),r=nc(this.context,n,this.tag,{color:16777215,hoverColor:16776960,opacity:.25,disabled:i}),s=new E(th(.5,1),n);s.renderOrder=1/0,this.add(s);const o=new E(new _(.25,10,8));o.visible=!1,o.pointerEventsOrder=1/0,this.add(o);const a=i?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{this.pointerEvents="none",n.dispose(),o.geometry.dispose(),s.geometry.dispose(),null==a||a(),null==r||r(),this.remove(o),this.remove(s)}}}const Yc=new l,Qc=new l,Kc=new l(1,0,0),Jc=new h;class eh extends ac{constructor(e,i=""){super(e,"e",i,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1}))),t(this,"direction",new l(1,0,0))}update(e){e.getWorldPosition(Yc),this.getWorldPosition(this.direction).sub(Yc).normalize(),this.quaternion.setFromUnitVectors(Kc,this.direction);const t=this.context.getTarget();null!=(null==t?void 0:t.parent)&&(t.parent.matrixWorld.decompose(Yc,Jc,Qc),Jc.invert(),this.quaternion.premultiply(Jc),this.direction.applyQuaternion(Jc)),null!=t&&(Jc.copy(t.quaternion).invert(),this.quaternion.premultiply(Jc)),this.direction.negate()}bind(e){const{options:t,disabled:i}=lc(this.axis,e);if(!1===t)return;this.options=t;const n=new b(ic),r=nc(this.context,n,this.tag,{color:16776960,hoverColor:16776960,opacity:.5,disabled:i}),s=new E(th(.75,1),n);s.renderOrder=1/0,this.add(s);const o=new E(new A(.75,.1,2,24),new b({color:"white"}));o.visible=!1,o.rotation.y=Math.PI/2,o.pointerEventsOrder=1/0,this.add(o);const a=i?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{n.dispose(),o.geometry.dispose(),s.geometry.dispose(),null==a||a(),null==r||r(),this.remove(o),this.remove(s)}}}function th(e,t){const i=new A(e,.0075,3,64,t*Math.PI*2);return i.rotateY(Math.PI/2),i.rotateX(Math.PI/2),i}const ih=new l;class nh extends y{constructor(e,i,n){super(),t(this,"context"),t(this,"fixed"),t(this,"size"),t(this,"rotationX"),t(this,"rotationY"),t(this,"rotationZ"),t(this,"free"),t(this,"screen"),this.context=e,this.fixed=i,this.size=n,this.rotationX=new Wc(this.context,"x"),this.add(this.rotationX),this.rotationY=new Wc(this.context,"y"),this.add(this.rotationY),this.rotationZ=new Wc(this.context,"z"),this.add(this.rotationZ),this.free=new Zc(this.context),this.add(this.free),this.screen=new eh(this.context),this.add(this.screen)}update(e){this.updateWorldMatrix(!0,!1),this.rotationX.update(e),this.rotationY.update(e),this.rotationZ.update(e),this.free.update(e),this.screen.update(e),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(ih),this.scale.divide(ih)),this.scale.multiplyScalar(uc(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.rotationX.bind(16711680,e),i=this.rotationY.bind(65280,e),n=this.rotationZ.bind(255,e),r=this.screen.bind(e),s=this.free.bind(e);return()=>{null==t||t(),null==i||i(),null==n||n(),null==r||r(),null==s||s()}}}const rh=new u,sh=new u(0,0,Math.PI/2),oh=new u(0,-Math.PI/2,0);class ah extends y{constructor(e){super(),t(this,"xAxisHighlight"),t(this,"yAxisHighlight"),t(this,"zAxisHighlight"),t(this,"handles"),t(this,"context"),this.context=new tc(this,e),this.xAxisHighlight=new oc(this.context,rh),this.add(this.xAxisHighlight),this.yAxisHighlight=new oc(this.context,sh),this.add(this.yAxisHighlight),this.zAxisHighlight=new oc(this.context,oh),this.add(this.zAxisHighlight)}set space(e){this.context.space=e}get space(){return this.context.space}update(e,t){var i;
380this.context.update(e),this.xAxisHighlight.update(),this.yAxisHighlight.update(),this.zAxisHighlight.update(),null==(i=this.handles)||i.update(t)}bind(e,t){const i=this.xAxisHighlight.bind("x"),n=this.yAxisHighlight.bind("y"),r=this.zAxisHighlight.bind("z");switch(e){case"rotate":this.handles=new nh(this.context);break;case"scale":this.handles=new Fc(this.context);break;case"translate":this.handles=new Rc(this.context)}this.add(this.handles);const s=this.handles.bind(t);return()=>{null!=this.handles&&this.remove(this.handles),this.handles=void 0,s(),i(),n(),r()}}}new l(0,0,1),new l(0,1,0),new l,new l,new u,new l,new R,new l,new l,new l,new R,new R,new l,new l,new R,new R,new R,new R,new l,new l;class lh{constructor(e){this.xrDevice=e,this.combinedCameraPosition=new l,this.isPointerLocked=!1,this.vec3=new l,this.quat=new h,this.keyState={ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},this.lastTime=0,this.scene=new P,this.camera=new k(50,window.innerWidth/window.innerHeight,.1,40),this.playerRig=new y,this.cameraRig=new y,this.scene.add(this.playerRig),this.playerRig.add(this.cameraRig),this.cameraRig.position.fromArray(e.position.vec3),this.cameraRig.quaternion.fromArray(e.quaternion.quat),this.cameraRig.add(this.camera),this.camera.position.x-=e.ipd/2;const t=new E(new O(.25,.27,32),new b({color:16777215,side:L}));t.rotateX(-Math.PI/2),this.scene.add(t),this.renderer=new I({alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setClearColor(0,0),this.renderer.domElement.style.position="fixed",this.renderer.domElement.style.top="50vh",this.renderer.domElement.style.left="50vw",this.renderer.domElement.style.transform="translate(-50%, -50%)",this.transformHandles=new Map,["left","right"].forEach((t=>{const i=new ah;i.scale.setScalar(.1),i.position.fromArray(e.controllers[t].position.vec3),i.quaternion.fromArray(e.controllers[t].quaternion.quat),this.cameraRig.attach(i),i.userData={defaultPosition:i.position.toArray(),defaultQuaternion:i.quaternion.toArray()},i.userData.setMode=e=>{var t,n;null===(n=(t=i.userData).modeCleanup)||void 0===n||n.call(t),i.userData.modeCleanup=i.bind(e),i.userData.mode=e},i.userData.setMode("translate"),i.space="local",this.transformHandles.set(t,i),i.addEventListener("click",(()=>{"translate"===i.userData.mode?i.userData.setMode("rotate"):i.userData.setMode("translate")}))})),window.transformHandles=this.transformHandles,this.mouseMoveHandler=t=>{if(!this.isPointerLocked)return;const i=t.movementX||t.mozMovementX||t.webkitMovementX||0,n=t.movementY||t.mozMovementY||t.webkitMovementY||0;this.playerRig.rotation.y-=.002*i,this.cameraRig.rotation.x-=.002*n,e.quaternion.copy(this.cameraRig.getWorldQuaternion(new h))},this.cameraRig.getWorldPosition(this.combinedCameraPosition),this.headsetDefaultPosition=this.cameraRig.position.clone(),this.headsetDefaultQuaternion=this.cameraRig.quaternion.clone(),this.forwardHtmlEvents=V(this.renderer.domElement,(()=>this.camera),this.scene).update,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.renderer.domElement.requestPointerLock=this.renderer.domElement.requestPointerLock||this.renderer.domElement.mozRequestPointerLock||this.renderer.domElement.webkitRequestPointerLock,this.renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this.isPointerLocked=document.pointerLockElement===this.renderer.domElement||document.mozPointerLockElement===this.renderer.domElement||document.webkitPointerLockElement===this.renderer.domElement,this.isPointerLocked?(document.addEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEach((e=>{e.visible=!1}))):(document.removeEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEac
380h((e=>{e.visible=!0})))}keyDownHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!0),t.ShiftLeft&&t.ArrowUp&&(this.cameraRig.position.y+=.05),t.ShiftLeft&&t.ArrowDown&&(this.cameraRig.position.y-=.05)}keyUpHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!1)}movePlayerRig(e){const{playerRig:t,keyState:i,vec3:n}=this;n.set((i.KeyD?1:0)-(i.KeyA?1:0),0,(i.KeyS?1:0)-(i.KeyW?1:0)),n.lengthSq()>0&&i.ShiftLeft&&(n.normalize().multiplyScalar(2*e).applyQuaternion(t.quaternion),t.position.add(n))}resetDeviceTransforms(){const{playerRig:e,cameraRig:t,transformHandles:i}=this;t.position.copy(this.headsetDefaultPosition),t.quaternion.copy(this.headsetDefaultQuaternion),e.position.set(0,0,0),e.quaternion.set(0,0,0,1),i.forEach((e=>{e.position.fromArray(e.userData.defaultPosition),e.quaternion.fromArray(e.userData.defaultQuaternion)}))}syncDeviceTransforms(){const{xrDevice:e,cameraRig:t,transformHandles:i}=this;e.position.copy(t.getWorldPosition(this.vec3)),e.quaternion.copy(t.getWorldQuaternion(this.quat)),i.forEach(((t,i)=>{const n="controller"===e.primaryInputMode?e.controllers[i]:e.hands[i];n.position.copy(t.getWorldPosition(this.vec3)),n.quaternion.copy(t.getWorldQuaternion(this.quat))}))}renderScene(e){const t=this.xrDevice.fovy/Math.PI*180;let i=!1;this.camera.fov!==t&&(this.camera.fov=t,i=!0);const n=this.xrDevice.canvasDimensions;if(n){const e=this.renderer.domElement;(e.width!==n.width||e.height!==n.height)&&(this.camera.aspect=n.width/n.height,this.renderer.setSize(n.width,n.height),i=!0)}i&&this.camera.updateProjectionMatrix(),this.isPointerLocked?this.cameraRig.getWorldPosition(this.combinedCameraPosition):(this.cameraRig.position.y=this.combinedCameraPosition.y,this.playerRig.position.x=this.combinedCameraPosition.x,this.playerRig.position.z=this.combinedCameraPosition.z),this.forwardHtmlEvents(),this.transformHandles.forEach(((t,i)=>{var n;const r=Boolean(null===(n=this.xrDevice.controllers[i])||void 0===n?void 0:n.connected);t.visible=r&&!this.isPointerLocked,r&&t.update(e,this.camera)}));const r=Math.min((e-this.lastTime)/1e3,.1);this.movePlayerRig(r),this.syncDeviceTransforms(),this.renderer.render(this.scene,this.camera),this.lastTime=e}get domElement(){return this.renderer.domElement}dispose(){this.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.mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}class ch{constructor(e){this.version="1.1.1",e.ipd=0,ka.getState().setInputMode(e.primaryInputMode),this.devUIContainer=document.createElement("div"),this.devUIContainer.style.position="fixed",this.devUIContainer.style.width="100vw",this.devUIContainer.style.height="100vh",this.devUIContainer.style.top="50vh",this.devUIContainer.style.left="50vw",this.devUIContainer.style.transform="translate(-50%, -50%)",this.devUIContainer.style.pointerEvents="none";const t=this.devUIContainer.attachShadow({mode:"open"});this.inputLayer=new lh(e);n.createRoot(t).render(i.jsx(hh,{xrDevice:e,inputLayer:this.inputLayer,shadowRoot:t}));const r=()=>{const t=document.createElement("div");document.body.appendChild(t);const r=t.attachShadow({mode:"open"});n.createRoot(r).render(i.jsx(uh,{xrDevice:e,shadowRoot:r}))};document.body?r():window.onload=r}render(e){this.inputLayer.renderScene(e)}get devUICanvas(){return this.inputLayer.domElement}}const hh=({xrDevice:e,inputLayer:t,shadowRoot:n})=>{const[r,s]=o.useState(!1);return o.useEffect((()=>{const e=()=>{const e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;s(!!e)};return document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),()=>{document.removeEventListener("pointerlockchange",e,!1),document.removeEventListener("mozpointerlockchange",e,!1),document.removeEventListener("webkitpointerlockchange",e,!1)}}),[]),i.jsx(Bs,{target:n,disableCSSOMInjection:!0,children:i.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none"},children:[i.jsx(Da,{xrDevice:e,inputLayer:t}),i.jsx(za,{xrDevice:e,inputLayer:t,pointerLocked:r}),i.jsx(Oa,{xrDevice:e,inputLayer:t,pointerLocked:r})]})})},uh=({xrDevice:e,shadowRoot:t})=>{const[n,r]=React.useState(e.sessionOffered&&!e.activeSession);return React.useEffect((()=>{setInterval((()=>{r(e.sessionOffered&&!e.activeSession)}),1e3)}),[]),i.jsx(Bs,{target:t,disableCSSOMInjection:!0,children:i.jsxs(wo,{style:{zIndex:899,position:"fixed",top:n?"8px":"-30px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"space-between",left:"50vw",transform:"translateX(-50%)",transition:"all 0.2s ease-in-out",paddingLeft:"5px",gap:"3px"},children:[i.jsx(oa,{size:24}),i.jsx(bo,{onClick:()=>{e.grantOfferedSession()},style:{fontSize:"16px"},children:"Enter XR"})]})})};var dh=1e-6,fh="undefined"!=typeof Float32Array?Float32Array:Array;function ph(){var e=new fh(16);return fh!=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 mh(e){var t=new fh(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 gh(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 xh(e){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
380]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function vh(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],x=t[15],v=i*a-n*o,y=i*l-r*o,w=i*c-s*o,b=n*l-r*a,E=n*c-s*a,T=r*c-s*l,S=h*m-u*p,M=h*g-d*p,A=h*x-f*p,_=u*g-d*m,R=u*x-f*m,P=d*x-f*g,k=v*P-y*R+w*_+b*A-E*M+T*S;return k?(k=1/k,e[0]=(a*P-l*R+c*_)*k,e[1]=(r*R-n*P-s*_)*k,e[2]=(m*T-g*E+x*b)*k,e[3]=(d*E-u*T-f*b)*k,e[4]=(l*A-o*P-c*M)*k,e[5]=(i*P-r*A+s*M)*k,e[6]=(g*w-p*T-x*y)*k,e[7]=(h*T-d*w+f*y)*k,e[8]=(o*R-a*A+c*S)*k,e[9]=(n*A-i*R-s*S)*k,e[10]=(p*E-m*w+x*v)*k,e[11]=(u*w-h*E-f*v)*k,e[12]=(a*M-o*_-l*S)*k,e[13]=(i*_-n*M+r*S)*k,e[14]=(m*y-p*b-g*v)*k,e[15]=(h*b-u*y+d*v)*k,e):null}function yh(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],x=t[14],v=t[15],y=i[0],w=i[1],b=i[2],E=i[3];return e[0]=y*n+w*a+b*u+E*m,e[1]=y*r+w*l+b*d+E*g,e[2]=y*s+w*c+b*f+E*x,e[3]=y*o+w*h+b*p+E*v,y=i[4],w=i[5],b=i[6],E=i[7],e[4]=y*n+w*a+b*u+E*m,e[5]=y*r+w*l+b*d+E*g,e[6]=y*s+w*c+b*f+E*x,e[7]=y*o+w*h+b*p+E*v,y=i[8],w=i[9],b=i[10],E=i[11],e[8]=y*n+w*a+b*u+E*m,e[9]=y*r+w*l+b*d+E*g,e[10]=y*s+w*c+b*f+E*x,e[11]=y*o+w*h+b*p+E*v,y=i[12],w=i[13],b=i[14],E=i[15],e[12]=y*n+w*a+b*u+E*m,e[13]=y*r+w*l+b*d+E*g,e[14]=y*s+w*c+b*f+E*x,e[15]=y*o+w*h+b*p+E*v,e}function wh(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 bh(e,t,i){var n,r,s,o=i[0],a=i[1],l=i[2],c=Math.sqrt(o*o+a*a+l*l);return c<dh?null:(o*=c=1/c,a*=c,l*=c,n=Math.sin(t),s=1-(r=Math.cos(t)),e[0]=o*o*s+r,e[1]=a*o*s+l*n,e[2]=l*o*s-a*n,e[3]=0,e[4]=o*a*s-l*n,e[5]=a*a*s+r,e[6]=l*a*s+o*n,e[7]=0,e[8]=o*l*s+a*n,e[9]=a*l*s-o*n,e[10]=l*l*s+r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Eh(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=n+n,l=r+r,c=s+s,h=n*a,u=n*l,d=n*c,f=r*l,p=r*c,m=s*c,g=o*a,x=o*l,v=o*c;return e[0]=1-(f+m),e[1]=u+v,e[2]=d-x,e[3]=0,e[4]=u-v,e[5]=1-(h+m),e[6]=p+g,e[7]=0,e[8]=d+x,e[9]=p-g,e[10]=1-(h+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function Th(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Sh(e,t){var i=t[0],n=t[1],r=t[2],s=t[4],o=t[5],a=t[6],l=t[8],c=t[9],h=t[10];return e[0]=Math.sqrt(i*i+n*n+r*r),e[1]=Math.sqrt(s*s+o*o+a*a),e[2]=Math.sqrt(l*l+c*c+h*h),e}function Mh(e,t){var i=new fh(3);Sh(i,t);var n=1/i[0],r=1/i[1],s=1/i[2],o=t[0]*n,a=t[1]*r,l=t[2]*s,c=t[4]*n,h=t[5]*r,u=t[6]*s,d=t[8]*n,f=t[9]*r,p=t[10]*s,m=o+h+p,g=0;return m>0?(g=2*Math.sqrt(m+1),e[3]=.25*g,e[0]=(u-f)/g,e[1]=(d-l)/g,e[2]=(a-c)/g):o>h&&o>p?(g=2*Math.sqrt(1+o-h-p),e[3]=(u-f)/g,e[0]=.25*g,e[1]=(a+c)/g,e[2]=(d+l)/g):h>p?(g=2*Math.sqrt(1+h-o-p),e[3]=(d-l)/g,e[0]=(a+c)/g,e[1]=.25*g,e[2]=(u+f)/g):(g=2*Math.sqrt(1+p-o-h),e[3]=(a-c)/g,e[0]=(d+l)/g,e[1]=(u+f)/g,e[2]=.25*g),e}var Ah=function(e,t,i,n,r){var s=1/Math.tan(t/2);if(e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0){var o=1/(n-r);e[10]=(r+n)*o,e[14]=2*r*n*o}else e[10]=-1,e[14]=-2*n;return e};function _h(){var e=new fh(3);return fh!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Rh(e,t,i){var n=new fh(3);return n[0]=e,n[1]=t,n[2]=i,n}function Ph(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function kh(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function Oh(e,t){var i=t[0],n=t[1],r=t[2],s=i*i+n*n+r*r;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function Lh(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ih(e,t,i){var n=t[0],r=t[1],s=t[2],o=i[0],a=i[1],l=i[2];return e[0]=r*l-s*a,e[1]=s*o-n*l,e[2]=n*a-r*o,e}function Ch(e,t,i,n){var r=t[0],s=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=s+n*(i[1]-s),e[2]=o+n*(i[2]-o),e}function Nh(){var e=new fh(4);return fh!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Dh(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function Fh(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*s+i[12]*o,e[1]=i[1]*n+i[5]*r+i[9]*s+i[13]*o,e[2]=i[2]*n+i[6]*r+i[10]*s+i[14]*o,e[3]=i[3]*n+i[7]*r+i[11]*s+i[15]*o,e}function jh(){var e=new fh(4);return fh!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function zh(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function Bh(e,t,i,n){var r,s,o,a,l,c=t[0],h=t[1],u=t[2],d=t[3],f=i[0],p=i[1],m=i[2],g=i[3];return(s=c*f+h*p+u*m+d*g)<0&&(s=-s,f=-f,p=-p,m=-m,g=-g),1-s>dh?(r=Math.acos(s),o=Math.sin(r),a=Math.sin((1-n)*r)/o,l=Math.sin(n*r)/o):(a=1-n,l=n),e[0]=a*c+l*f,e[1]=a*h+l*p,e[2]=a*u+l*m,e[3]=a*d+l*g,e}_h(),function(){var e=Nh()}();var Uh,Vh=function(e,t,i,n){var r=new fh(4);return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r},Gh=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},Wh=Dh,$h=function(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=i*i+n*n+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=i*o,e[1]=n*o,e[2]=r*o,e[3]=s*o,e};_h(),Rh(1,0,0),Rh(0,1,0),jh(),jh(),Uh=new fh(9),fh!=Float32Array&&(Uh[1]=0,Uh[2]=0,Uh[3]=0,Uh[5]=0,Uh[6]=0,Uh[7]=0),Uh[0]=1,Uh[4]=1,Uh[8]=1;const qh=Symbol("@iwer/action-player"),Xh=Symbol("@iwer/xr-anchor"),Hh=Symbol("@iwer/xr-controller"),Zh=Symbol("@iwer/xr-device"),Yh=Symbol("@iwer/xr-hand-input"),Qh=Symbol("@iwer/xr-tracked-input"),Kh=Symbol("@iwer/xr-frame"),Jh=Symbol("@iwer/gamepad"),eu=Symbol("@iwer/xr-system"),tu=Symbol("@iwer/xr-input-source"),iu=Symbol("@iwer/xr-webgl-layer"),nu=Symbol("@iwer/xr-mesh"),ru=Symbol("@iwer/xr-plane"),su=Symbol("@iwer/xr-joint-pose"),ou=Symbol("@iwer/xr-pose"),au=Symbol("@iwer/xr-viewer-pose"),lu=Symbol("@iwer/xr-rigid-transform"),cu=Symbol("@iwer/xr-render-state"),hu=Symbol("@iwer/xr-session"),uu=Symbol("@iwer/xr-joint-space"),du=Symbol("@iwer/xr-reference-space"),fu=Symbol("@iwer/xr-space"),pu=Symbol("@iwer/xr-view"),mu=Symbol("@iwer/xr-viewport"),gu=Symbol("@iwer/xr-ray"),xu=Symbol("@iwer/xr-depth-info"),vu=Symbol("@iwer/xr-hit-test"),yu=_h();
380class wu extends EventTarget{constructor(e,t){super(),this[fu]={parentSpace:e,offsetMatrix:t?mh(t):ph(),emulated:!0}}}class bu extends wu{constructor(){super(void 0,ph())}}class Eu{static updateOffsetPosition(e,t){wh(e[fu].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[fu].offsetMatrix;Th(yu,i),Eh(i,t,yu)}static updateOffsetMatrix(e,t){gh(e[fu].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,t=ph()){const i=[];let n=e;for(;n;)i.push(n),n=n[fu].parentSpace;xh(t);for(let r=i.length-1;r>=0;r--)yh(t,t,i[r][fu].offsetMatrix);return t}}let Tu=class e{constructor(e=0,t=0,i=0){this.vec3=Rh(e,t,i),this.tempVec3=_h()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return kh(this.vec3,e,t,i),this}clone(){return new e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.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 Ph(this.tempVec3,this.vec3),Oh(this.vec3,this.tempVec3),this}add(e){return Ph(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return Ph(this.tempVec3,this.vec3),function(e,t,i){var n=i[0],r=i[1],s=i[2],o=i[3],a=t[0],l=t[1],c=t[2],h=r*c-s*l,u=s*a-n*c,d=n*l-r*a;h+=h,u+=u,d+=d,e[0]=a+o*h+r*d-s*u,e[1]=l+o*u+s*h-n*d,e[2]=c+o*d+n*u-r*h}(this.vec3,this.tempVec3,e.quat),this}},Su=class e{constructor(e=0,t=0,i=0,n=1){this.quat=Vh(e,t,i,n),this.tempQuat=jh()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,n){return Wh(this.quat,e,t,i,n),this}clone(){return new e(this.x,this.y,this.z,this.w)}copy(e){return Wh(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return Gh(this.tempQuat,this.quat),$h(this.quat,this.tempQuat),this}invert(){return Gh(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return Gh(this.tempQuat,this.quat),function(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=i[0],l=i[1],c=i[2],h=i[3];e[0]=n*h+o*a+r*c-s*l,e[1]=r*h+o*l+s*a-n*c,e[2]=s*h+o*c+n*l-r*a,e[3]=o*h-n*a-r*l-s*c}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return zh(this.quat,e.vec3,t),this}};function Mu(e){return{x:e.x,y:e.y,z:e.z}}function Au(e){return{x:e.x,y:e.y,z:e.z,w:e.w}}function _u(e){const{x:t,y:i,z:n,w:r}=e,s=180/Math.PI,o=Math.max(-1,Math.min(1,2*(r*t-i*n)));let a;a=Math.abs(o)>=1?Math.sign(o)*Math.PI/2:Math.asin(o);const l=2*(r*i+t*n),c=1-2*(t*t+i*i),h=2*(r*n+t*i),u=1-2*(t*t+n*n);return{pitch:a*s,yaw:Math.atan2(l,c)*s,roll:Math.atan2(h,u)*s}}function Ru(e){return function(e){return"pitch"in e||"yaw"in e||"roll"in e}(e)?function(e){var t,i,n;const r=Math.PI/180,s=(null!==(t=e.pitch)&&void 0!==t?t:0)*r,o=(null!==(i=e.yaw)&&void 0!==i?i:0)*r,a=(null!==(n=e.roll)&&void 0!==n?n:0)*r,l=Math.cos(.5*s),c=Math.sin(.5*s),h=Math.cos(.5*o),u=Math.sin(.5*o),d=Math.cos(.5*a),f=Math.sin(.5*a);return{w:l*h*d+c*u*f,x:c*h*d+l*u*f,y:l*u*d-c*h*f,z:l*h*f-c*u*d}}(e):e}function Pu(e,t,i){return e+(t-e)*i}const ku={right:"controller-right",left:"controller-left","right-controller":"controller-right","left-controller":"controller-left","controllers.right":"controller-right","controllers.left":"controller-left",rightController:"controller-right",leftController:"controller-left","right-hand":"hand-right","left-hand":"hand-left","hands.right":"hand-right","hands.left":"hand-left",rightHand:"hand-right",leftHand:"hand-left"};function Ou(e){var t;return null!==(t=ku[e])&&void 0!==t?t:e}const Lu=.15;function Iu(e){return"number"==typeof e&&Number.isFinite(e)}function Cu(e,t,i){return Math.min(i,Math.max(t,e))}function Nu(e){if(!Iu(e.x)||!Iu(e.y)||!Iu(e.z))throw new Error(`Invalid position: x, y, z must be finite numbers (got ${JSON.stringify(e)}).`)}function Du(e){if(!(Iu(e.x)&&Iu(e.y)&&Iu(e.z)&&Iu(e.w)))throw new Error(`Invalid orientation: x, y, z, w must be finite numbers (got ${JSON.stringify(e)}).`);const t=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w);if(t<1e-6)throw new Error("Invalid orientation: quaternion has near-zero length.");return{x:e.x/t,y:e.y/t,z:e.z/t,w:e.w/t}}class Fu{constructor(e){this.commandQueue=[],this._isCaptured=!1,this.releaseTimer=null,this.actionIdCounter=0,this.RELEASE_TIMEOUT_MS=3e4,this.ACTION_TIMEOUT_MS=1e4,this.actionTimers=new WeakMap,this.device=e}generateActionId(){return"action_"+ ++this.actionIdCounter}get isCaptured(){return this._isCaptured}
380get queueLength(){return this.commandQueue.length}enqueueDiscrete(e,t){return new Promise(((i,n)=>{const r={type:"discrete",id:this.generateActionId(),method:e,params:t,resolve:i,reject:n};this.commandQueue.push(r),this.armActionTimeout(r,e)}))}enqueueDuration(e,t,i,n,r){return new Promise(((s,o)=>{const a={type:"duration",id:this.generateActionId(),method:e,params:t,durationMs:i,elapsedMs:0,startState:n,targetState:r,resolve:s,reject:o};this.commandQueue.push(a),this.armActionTimeout(a,e,i)}))}armActionTimeout(e,t,i=0){const n=this.ACTION_TIMEOUT_MS+i,r=setTimeout((()=>{const i=this.commandQueue.indexOf(e);-1!==i&&(this.commandQueue.splice(i,1),this.actionTimers.delete(e),e.reject(new Error(`RemoteControlInterface: action '${t}' timed out after ${n}ms with no frame processing the queue (is the XR render loop running?).`)))}),n);this.actionTimers.set(e,r)}clearActionTimeout(e){const t=this.actionTimers.get(e);void 0!==t&&(clearTimeout(t),this.actionTimers.delete(e))}update(e){if(0!==this.commandQueue.length){for(this.cancelReleaseTimer(),this._isCaptured||(this._isCaptured=!0,this.device.controlMode="programmatic");this.commandQueue.length>0;){const i=this.commandQueue[0];if("discrete"===i.type){try{const e=this.executeDiscreteAction(i);i.resolve(e)}catch(t){i.reject(t)}this.clearActionTimeout(i),this.commandQueue.shift()}else{if(i.elapsedMs+=e,!(i.elapsedMs>=i.durationMs)){try{const e=i.elapsedMs/i.durationMs;this.applyDurationLerpState(i,e)}catch(t){i.reject(t),this.clearActionTimeout(i),this.commandQueue.shift();continue}break}try{this.applyDurationFinalState(i),i.resolve(this.getDurationResult(i))}catch(t){i.reject(t)}this.clearActionTimeout(i),this.commandQueue.shift()}}this.device.notifyStateChange(),0===this.commandQueue.length&&this.startReleaseTimer()}}startReleaseTimer(){this.cancelReleaseTimer(),this.releaseTimer=setTimeout((()=>{this._isCaptured=!1,this.device.controlMode="manual",this.releaseTimer=null}),this.RELEASE_TIMEOUT_MS)}cancelReleaseTimer(){null!==this.releaseTimer&&(clearTimeout(this.releaseTimer),this.releaseTimer=null)}getDeviceTransform(e){switch(e){case"headset":return{position:Mu(this.device.position),orientation:Au(this.device.quaternion)};case"controller-left":{const e=this.device.controllers.left;if(!e)throw new Error("Left controller not available");return{position:Mu(e.position),orientation:Au(e.quaternion)}}case"controller-right":{const e=this.device.controllers.right;if(!e)throw new Error("Right controller not available");return{position:Mu(e.position),orientation:Au(e.quaternion)}}case"hand-left":{const e=this.device.hands.left;if(!e)throw new Error("Left hand not available");return{position:Mu(e.position),orientation:Au(e.quaternion)}}case"hand-right":{const e=this.device.hands.right;if(!e)throw new Error("Right hand not available");return{position:Mu(e.position),orientation:Au(e.quaternion)}}default:throw new Error(`Unknown device: ${e}`)}}setDeviceTransform(e,t,i){t&&Nu(t);const n=i?Du(i):void 0;switch(e){case"headset":t&&this.device.position.set(t.x,t.y,t.z),n&&this.device.quaternion.set(n.x,n.y,n.z,n.w);break;case"controller-left":{const e=this.device.controllers.left;if(!e)throw new Error("Left controller not available");t&&e.position.set(t.x,t.y,t.z),n&&e.quaternion.set(n.x,n.y,n.z,n.w);break}case"controller-right":{const e=this.device.controllers.right;if(!e)throw new Error("Right controller not available");t&&e.position.set(t.x,t.y,t.z),n&&e.quaternion.set(n.x,n.y,n.z,n.w);break}case"hand-left":{const e=this.device.hands.left;if(!e)throw new Error("Left hand not available");t&&e.position.set(t.x,t.y,t.z),n&&e.quaternion.set(n.x,n.y,n.z,n.w);break}case"hand-right":{const e=this.device.hands.right;if(!e)throw new Error("Right hand not available");t&&e.position.set(t.x,t.y,t.z),n&&e.quaternion.set(n.x,n.y,n.z,n.w);break}default:throw new Error(`Unknown device: ${e}`)}}transformXROriginToGlobal(e){var t,i;const n=this.device.activeSession;if(!n)return e;const r=null===(t=n[hu])||void 0===t?void 0:t.referenceSpaces;if(!r||0===r.length)return e;
380const s=null===(i=r[0][fu])||void 0===i?void 0:i.offsetMatrix;if(!s)return e;const o=Rh(e.x,e.y,e.z);return function(e,t,i){var n=t[0],r=t[1],s=t[2],o=i[3]*n+i[7]*r+i[11]*s+i[15];o=o||1,e[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,e[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,e[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o}(o,o,s),{x:o[0],y:o[1],z:o[2]}}getDeviceSelectValue(e){var t,i,n,r,s,o,a,l;switch(e){case"controller-left":return null!==(i=null===(t=this.device.controllers.left)||void 0===t?void 0:t.getButtonValue("trigger"))&&void 0!==i?i:0;case"controller-right":return null!==(r=null===(n=this.device.controllers.right)||void 0===n?void 0:n.getButtonValue("trigger"))&&void 0!==r?r:0;case"hand-left":return null!==(o=null===(s=this.device.hands.left)||void 0===s?void 0:s.pinchValue)&&void 0!==o?o:0;case"hand-right":return null!==(l=null===(a=this.device.hands.right)||void 0===a?void 0:a.pinchValue)&&void 0!==l?l:0;default:throw new Error(`Unknown input device: ${e}`)}}setDeviceSelectValue(e,t){var i,n,r,s;switch(e){case"controller-left":null===(i=this.device.controllers.left)||void 0===i||i.updateButtonValue("trigger",t);break;case"controller-right":null===(n=this.device.controllers.right)||void 0===n||n.updateButtonValue("trigger",t);break;case"hand-left":null===(r=this.device.hands.left)||void 0===r||r.updatePinchValue(t);break;case"hand-right":null===(s=this.device.hands.right)||void 0===s||s.updatePinchValue(t);break;default:throw new Error(`Unknown input device: ${e}`)}}setDeviceConnected(e,t){switch(e){case"controller-left":this.device.controllers.left&&(this.device.controllers.left.connected=t);break;case"controller-right":this.device.controllers.right&&(this.device.controllers.right.connected=t);break;case"hand-left":this.device.hands.left&&(this.device.hands.left.connected=t);break;case"hand-right":this.device.hands.right&&(this.device.hands.right.connected=t);break;default:throw new Error(`Unknown input device: ${e}`)}}executeDiscreteAction(e){const{method:t,params:i}=e;switch(t){case"get_session_status":return this.executeGetSessionStatus();case"accept_session":return this.executeAcceptSession();case"end_session":return this.executeEndSession();case"get_transform":return this.executeGetTransform(i);case"set_transform":return this.executeSetTransform(i);case"look_at":return this.executeLookAt(i);case"set_input_mode":return this.executeSetInputMode(i);case"set_connected":return this.executeSetConnected(i);case"get_select_value":return this.executeGetSelectValue(i);case"set_select_value":return this.executeSetSelectValue(i);case"set_hand_pose":return this.executeSetHandPose(i);case"get_gamepad_state":return this.executeGetGamepadState(i);case"set_gamepad_state":return this.executeSetGamepadState(i);case"get_device_state":return this.executeGetDeviceState();case"set_device_state":return this.executeSetDeviceState(i);case"_select_press":{const e=i.device;return void this.setDeviceSelectValue(e,1)}case"_select_release":{const e=i.device;return void this.setDeviceSelectValue(e,0)}default:throw new Error(`Unknown method: ${t}`)}}executeGetSessionStatus(){const e=this.device.activeSession;return{deviceName:this.device.name,isRuntimeInstalled:!0,sessionActive:!!e,sessionOffered:this.device.sessionOffered,sessionMode:e?e[hu].mode:null,enabledFeatures:e?Array.from(e.enabledFeatures):[],visibilityState:this.device.visibilityState}}executeAcceptSession(){if(!this.device.sessionOffered)throw new Error("No session has been offered");return this.device.grantOfferedSession(),{success:!0}}executeEndSession(){const e=this.device.activeSession;if(!e)throw new Error("No active session");return e.end(),{success:!0}}executeGetTransform(e){const{device:t}=e,i=this.getDeviceTransform(t);return{device:t,position:i.position,orientation:i.orientation,euler:_u(i.orientation)}}executeSetTransform(e){const{device:t,position:i,orientation:n}=e,r=n?Ru(n):void 0;this.setDeviceTransform(t,i,r);const s=this.getDeviceTransform(t);return{device:t,position:s.position,orientation:s.orientation}}executeLookAt(e){const{device:t,target:i,moveToDistance:n}=e,r=this.getDeviceTransform(t),s=this.transformXROriginToGlobal(i),o=function(e,t){const i=t.x-e.x,n=t.y-e.y,r=t.z-e.z,s=Math.sqrt(i*i+n*n+r*r);return 0===s?{x:0,y:0,z:-1}:{x:i/s,y:n/s,z:r/s}}(r.position,s),a="headset"===t?function(e){const t=Math.sqrt(e.x*e.x+e.z*e.z);let i=0;t>1e-4&&(i=Math.atan2(-e.x,-e.z));const n=Math.atan2(e.y,t),r=Math.cos(.5*n),s=Math.sin(.5*n),o=Math.cos(.5*i),a=Math.sin(.5*i);return{w:r*o,x:s*o,y:r*a,z:-s*a}}(o):function(e,t={x:0,y:1,z:0}){const i=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z);if(0===i)return{x:0,y:0,z:0,w:1};const n=e.x/i,r=e.y/i,s=e.z/i,o={x:r*t.z-s*t.y,y:s*t.x-n*t.z,z:n*t.y-r*t.x},a=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);if(0===a){const e={x:1,y:0,z:0};o.x=r*e.z-s*e.y,o.y=s*e.x-n*e.z,o.z=n*e.y-r*e.x;const t=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z);o.x/=t,o.y/=t,o.z/=t}else o.x/=a,o.y/=a,o.z/=a;const l={x:o.y*s-o.z*r,y:o.z*n-o.x*s,z:o.x*r-o.y*n},c=o.x,h=l.x,u=-n,d=o.y,f=l.y,p=-r,m=o.z,g=l.z,x=-s,v=c+f+x;let y,w,b,E;if(v>0){const e=.5/Math.sqrt(v+1);y=.25/e,w=(g-p)*e,b=(u-m)*e,E=(d-h)*e}else if(c>f&&c>x){const e=2*Math.sqrt(1+c-f-x);y=(g-p)/e,w=.25*e,b=(h+d)/e,E=(u+m)/e}else if(f>x){const e=2*Math.sqrt(1+f-c-x);y=(u-m)/e,w=(h+d)/e,b=.25*e,E=(p+g)/e}else{const e=2*Math.sqrt(1+x-c-f);y=(d-h)/e,w=(u+m)/e,b=(p+g)/e,E=.25*e}const T=Math.sqrt(w*w+b*b+E*E+y*y);return T>0&&(w/=T,b/=T,E/=T,y/=T),{x:w,y:b,z:E,w:y}}(o);let l;void 0!==n&&(l={x:s.x-o.x*n,y:s.y-o.y*n,z:s.z-o.z*n}),this.setDeviceTransform(t,l,a);const c=this.getDeviceTransform(t);return{device:t,position:c.position,orientation:c.orientation}}executeSetInputMode(e){var t,i,n,r;const{mode:s}=e;this.device.primaryInputMode=s;const o=[];return"controller"===s?((null===(t=this.device.controllers.left)||void 0===t?void 0:t.connected)&&o.push("controller-left"),(null===(i=this.device.controllers.right)||void 0===i?void 0:i.connected)&&o.push("controller-right")):((null===(n=this.device.hands.left)||void 0===n?void 0:n.connected)&&o.push("hand-left"),(null===(r=this.device.hands.right)||void 0===r?void 0:r.connected)&&o.push("hand-right")),{mode:s,activeDevices:o}}executeSetConnected(e){const{device:t,connected:i}=e;return this.setDeviceConnected(t,i),{device:t,connected:i}}executeGetSelectValue(e){const{device:t}=e;return{device:t,value:this.getDeviceSelectValue(t)}}executeSetSelectValue(e){const{device:t,value:i}=e;return this.setDeviceSelectValue(t,i),{device:t,value:i}}executeSetHandPose(e){const{device:t,poseId:i}=e,n="hand-left"===t?"left":"hand-right"===t?"right":null;if(!n)throw new Error(`set_hand_pose requires device 'hand-left' or 'hand-right', got '${t}'.`);const r=this.device.hands[n];if(!r)throw new Error(`Hand ${n} not available`);return r.poseId=i,{device:t,poseId:i}}requireSem(){const e=this.device.sem;if(!e)throw new Error("Scene understanding (SEM) is not installed on this device. Install @iwer/sem to query the emulated world.");return e}executeGetObjects(){const e=this.requireSem(),t=[];
380return e.trackedPlanes.forEach((e=>{var i;t.push({type:"plane",semanticLabel:null!==(i=e.semanticLabel)&&void 0!==i?i:null})})),e.trackedMeshes.forEach((e=>{var i;t.push({type:"mesh",semanticLabel:null!==(i=e.semanticLabel)&&void 0!==i?i:null})})),{objects:t}}executeGetWorldState(){const e=this.requireSem();return{planeCount:e.trackedPlanes.size,meshCount:e.trackedMeshes.size,objects:this.executeGetObjects().objects}}listMethods(){const e=[];return Fu.IMMEDIATE_METHODS.forEach((t=>{e.push({method:t,immediate:!0,requiresSession:!1})})),Fu.SESSION_REQUIRED_METHODS.forEach((t=>{e.push({method:t,immediate:!1,requiresSession:!0})})),e}describe(){return this.listMethods()}connectTransport(e){e.addEventListener("message",(t=>{const i=t.data;if(!i||"string"!=typeof i.method)return;const{id:n,method:r,params:s}=i;this.dispatch(r,null!=s?s:{}).then((t=>e.postMessage({id:n,result:t}))).catch((t=>e.postMessage({id:n,error:t instanceof Error?t.message:String(t)})))}))}executeGetGamepadState(e){const{device:t}=e,i="controller-left"===t?"left":"right",n=this.device.controllers[i];if(!n)throw new Error(`Controller ${i} not available`);const r=["trigger","squeeze","thumbstick","left"===i?"x-button":"a-button","left"===i?"y-button":"b-button","thumbrest"].map(((e,t)=>({index:t,name:e.replace("x-button","x").replace("y-button","y").replace("a-button","a").replace("b-button","b"),value:n.getButtonValue(e),touched:n.getButtonTouched(e),pressed:n.getButtonValue(e)>.5}))),s=n.getAxes(),o=[{index:0,name:"thumbstick-x",value:s.x},{index:1,name:"thumbstick-y",value:s.y}];return{device:t,connected:n.connected,buttons:r,axes:o}}executeSetGamepadState(e){const{device:t,buttons:i,axes:n}=e,r="controller-left"===t?"left":"right",s=this.device.controllers[r];if(!s)throw new Error(`Controller ${r} not available`);let o=0,a=0;const l=["trigger","squeeze","thumbstick","left"===r?"x-button":"a-button","left"===r?"y-button":"b-button","thumbrest"];if(i)for(const c of i){const e=l[c.index];e&&Iu(c.value)&&(s.updateButtonValue(e,Cu(c.value,0,1)),void 0!==c.touched&&s.updateButtonTouch(e,c.touched),o++)}if(n){let e,t;for(const i of n)Iu(i.value)&&(0===i.index?(e=Cu(i.value,-1,1),a++):1===i.index&&(t=Cu(i.value,-1,1),a++));if(void 0!==e||void 0!==t){const i=s.getAxes();s.updateAxes("thumbstick",null!=e?e:i.x,null!=t?t:i.y)}}return{device:t,buttonsSet:o,axesSet:a}}executeGetDeviceState(){var e,t,i,n,r,s,o,a,l,c,h,u,d,f,p,m,g,x,v,y,w,b,E,T;return{headset:{position:Mu(this.device.position),orientation:Au(this.device.quaternion)},inputMode:this.device.primaryInputMode,controllers:{left:{connected:null!==(t=null===(e=this.device.controllers.left)||void 0===e?void 0:e.connected)&&void 0!==t&&t,position:Mu(null!==(n=null===(i=this.device.controllers.left)||void 0===i?void 0:i.position)&&void 0!==n?n:{x:0,y:0,z:0}),orientation:Au(null!==(s=null===(r=this.device.controllers.left)||void 0===r?void 0:r.quaternion)&&void 0!==s?s:{x:0,y:0,z:0,w:1})},right:{connected:null!==(a=null===(o=this.device.controllers.right)||void 0===o?void 0:o.connected)&&void 0!==a&&a,position:Mu(null!==(c=null===(l=this.device.controllers.right)||void 0===l?void 0:l.position)&&void 0!==c?c:{x:0,y:0,z:0}),orientation:Au(null!==(u=null===(h=this.device.controllers.right)||void 0===h?void 0:h.quaternion)&&void 0!==u?u:{x:0,y:0,z:0,w:1})}},hands:{left:{connected:null!==(f=null===(d=this.device.hands.left)||void 0===d?void 0:d.connected)&&void 0!==f&&f,position:Mu(null!==(m=null===(p=this.device.hands.left)||void 0===p?void 0:p.position)&&void 0!==m?m:{x:0,y:0,z:0}),orientation:Au(null!==(x=null===(g=this.device.hands.left)||void 0===g?void 0:g.quaternion)&&void 0!==x?x:{x:0,y:0,z:0,w:1})},right:{connected:null!==(y=null===(v=this.device.hands.right)||void 0===v?void 0:v.connected)&&void 0!==y&&y,position:Mu(null!==(b=null===(w=this.device.hands.right)||void 0===w?void 0:w.position)&&void 0!==b?b:{x:0,y:0,z:0}),orientation:Au(null!==(T=null===(E=this.device.hands.right)||void 0===E?void 0:E.quaternion)&&void 0!==T?T:{x:0,y:0,z:0,w:1})}},stereoEnabled:this.device.stereoEnabled,fov:this.device.fovy*(180/Math.PI)}}executeSetDeviceState(e){const{state:t}=e;if(t){if(t.headset){t.headset.position&&Nu(t.headset.position);const e=t.headset.orientation?Du(t.headset.orientation):void 0;t.headset.position&&this.device.position.set(t.headset.position.x,t.headset.position.y,t.headset.position.z),e&&this.device.quaternion.set(e.x,e.y,e.z,e.w)}void 0!==t.inputMode&&(this.device.primaryInputMode=t.inputMode),void 0!==t.stereoEnabled&&(this.device.stereoEnabled=t.stereoEnabled),void 0!==t.fov&&(this.device.fovy=t.fov*(Math.PI/180)
380),t.controllers&&(this.applyInputState("controller-left",t.controllers.left),this.applyInputState("controller-right",t.controllers.right)),t.hands&&(this.applyInputState("hand-left",t.hands.left),this.applyInputState("hand-right",t.hands.right))}else this.device.position.set(0,1.6,0),this.device.quaternion.set(0,0,0,1),this.device.primaryInputMode="controller",this.device.stereoEnabled=!1,this.device.controllers.left&&(this.device.controllers.left.position.set(-.2,1.4,-.3),this.device.controllers.left.quaternion.set(0,0,0,1),this.device.controllers.left.connected=!0),this.device.controllers.right&&(this.device.controllers.right.position.set(.2,1.4,-.3),this.device.controllers.right.quaternion.set(0,0,0,1),this.device.controllers.right.connected=!0),this.device.hands.left&&(this.device.hands.left.position.set(-.15,1.3,-.4),this.device.hands.left.quaternion.set(0,0,0,1),this.device.hands.left.connected=!0),this.device.hands.right&&(this.device.hands.right.position.set(.15,1.3,-.4),this.device.hands.right.quaternion.set(0,0,0,1),this.device.hands.right.connected=!0);return{state:this.executeGetDeviceState()}}applyInputState(e,t){t&&(void 0!==t.connected&&this.setDeviceConnected(e,t.connected),(t.position||t.orientation)&&this.setDeviceTransform(e,t.position,t.orientation))}applyDurationLerpState(e,t){const{startState:i,targetState:n,params:r}=e,s=r.device;let o,a;i.position&&n.position&&(o=function(e,t,i){return{x:Pu(e.x,t.x,i),y:Pu(e.y,t.y,i),z:Pu(e.z,t.z,i)}}(i.position,n.position,t)),i.orientation&&n.orientation&&(a=function(e,t,i){let n=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,r=t.x,s=t.y,o=t.z,a=t.w;if(n<0&&(n=-n,r=-r,s=-s,o=-o,a=-a),n>.9995){const t={x:Pu(e.x,r,i),y:Pu(e.y,s,i),z:Pu(e.z,o,i),w:Pu(e.w,a,i)},n=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w);return{x:t.x/n,y:t.y/n,z:t.z/n,w:t.w/n}}const l=Math.acos(n),c=l*i,h=Math.sin(c),u=Math.sin(l),d=Math.cos(c)-n*h/u,f=h/u;return{x:d*e.x+f*r,y:d*e.y+f*s,z:d*e.z+f*o,w:d*e.w+f*a}}(i.orientation,n.orientation,t)),this.setDeviceTransform(s,o,a)}applyDurationFinalState(e){const{targetState:t,params:i}=e,n=i.device;this.setDeviceTransform(n,t.position,t.orientation)}getDurationResult(e){const{params:t,elapsedMs:i}=e,n=t.device,r=this.getDeviceTransform(n);return{device:n,position:r.position,orientation:r.orientation,actualDuration:i/1e3}}activateCaptureMode(){this._isCaptured||(this._isCaptured=!0,this.cancelReleaseTimer(),this.device.controlMode="programmatic"),this.startReleaseTimer()}async dispatch(e,t={}){var i;const n="string"==typeof t.device?{...t,device:Ou(t.device)}:t;if(Fu.IMMEDIATE_METHODS.has(e))return Fu.ACTIVE_IMMEDIATE_METHODS.has(e)&&this.activateCaptureMode(),this.executeImmediateMethod(e,n);if(Fu.SESSION_REQUIRED_METHODS.has(e)&&!this.device.activeSession)throw new Error(`Cannot execute '${e}': No active XR session. Use 'get_session_status' to check session state, and 'accept_session' to start a session.`);if("animate_to"===e){const t=n,r=this.getDeviceTransform(t.device),s=1e3*(null!==(i=t.duration)&&void 0!==i?i:.5),o=t.orientation?Ru(t.orientation):void 0,a=t.position?this.transformXROriginToGlobal(t.position):void 0;return this.enqueueDuration(e,n,s,{position:t.position?r.position:void 0,orientation:o?r.orientation:void 0},{position:a,orientation:o})}if("select"===e){const e=n;return this.executeSelectSequence(e)}return this.enqueueDiscrete(e,n)}executeImmediateMethod(e,t){switch(e){case"get_session_status":return this.executeGetSessionStatus();case"accept_session":return this.executeAcceptSession();case"end_session":return this.executeEndSession();case"get_transform":return this.executeGetTransform(t);case"get_select_value":return this.executeGetSelectValue(t);case"get_gamepad_state":return this.executeGetGamepadState(t);case"get_device_state":return this.executeGetDeviceState();case"get_world_state":return this.executeGetWorldState();case"get_objects":return this.executeGetObjects();default:throw new Error(`Unknown immediate method: ${e}`)}}executeSelectSequence(e){const{device:t,duration:i=Lu}=e;return this.getDeviceSelectValue(t),new Promise(((e,n)=>{let r=0;const s=()=>{r++,3===r&&e({device:t,duration:i})},o={type:"discrete",id:this.generateActionId(),method:"_select_press",params:{device:t},resolve:s,reject:n},a={type:"duration",id:this.generateActionId(),method:"_select_wait",params:{device:t},durationMs:1e3*i,elapsedMs:0,startState:{},targetState:{},resolve:s,reject:n},l={type:"discrete",id:this.generateActionId(),method:"_select_release",params:{device:t},resolve:s,reject:n};this.commandQueue.push(o,a,l)}))}async acceptSession(){if(!this.device.sessionOffered)throw new Error("No session has been offered");return this.device.grantOfferedSession(),await function(e,t=5e3){return new Promise(((i,n)=>{const r=Date.now(),s=()=>{e()?i():Date.now()-r>t?n(new Error("Timeout waiting for condition")):requestAnimationFrame(s)};s()}))}((()=>!!this.device.activeSession),5e3),{success:!0}}forceRelease(){this.cancelReleaseTimer(),this._isCaptured=!1,this.device.controlMode="manual";for(const e of this.commandQueue)this.clearActionTimeout(e),e.reject(new Error("Capture released"));this.commandQueue=[];for(const e of["left","right"]){const t=this.device.controllers[e];if(t){const i=["trigger","squeeze","thumbstick","thumbrest","left"===e?"x-button":"a-button","left"===e?"y-button":"b
380-button"];for(const e of i)t.updateButtonValue(e,0);t.updateAxes("thumbstick",0,0)}const i=this.device.hands[e];i&&i.updatePinchValue(0)}}}var ju,zu,Bu,Uu,Vu,Gu;Fu.IMMEDIATE_METHODS=new Set(["get_session_status","accept_session","end_session","get_transform","get_select_value","get_gamepad_state","get_device_state","get_world_state","get_objects"]),Fu.ACTIVE_IMMEDIATE_METHODS=new Set(["accept_session","end_session"]),Fu.SESSION_REQUIRED_METHODS=new Set(["set_transform","look_at","animate_to","set_input_mode","set_connected","set_select_value","select","set_gamepad_state","set_device_state","set_hand_pose"]),(zu=ju||(ju={})).None="",zu.Standard="standard",zu.XRStandard="xr-standard";class Wu{constructor(e,t){this[Jh]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[Jh].type?this[Jh].pressed:this[Jh].value>0}get touched(){return"manual"===this[Jh].type?this[Jh].touched:this[Jh].touched||this.pressed}get value(){return this[Jh].value}}class $u{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class qu{constructor(e="vibration"){this[Jh]={type:e,lastPulse:null}}get type(){return this[Jh].type}pulse(e,t){return this[Jh].lastPulse={value:e,duration:t,startTime:performance.now()},Promise.resolve(!0)}}class Xu{constructor(e,t="",i=-1,n=0){this[Jh]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:Array.from({length:Math.max(0,n)},(()=>new qu("vibration"))),buttonsView:[],axesView:[],axesResolvers:[]},e.buttons.forEach((e=>{var t;null===e?this[Jh].buttonsSequence.push(null):(this[Jh].buttonsSequence.push(e.id),this[Jh].buttonsMap[e.id]=new Wu(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[Jh].axesSequence.push(null):(this[Jh].axesSequence.push(e.id+e.type),this[Jh].axesMap[e.id]||(this[Jh].axesMap[e.id]={x:0,y:0}))})),this[Jh].buttonsView=this[Jh].buttonsSequence.map((e=>null===e?new $u:this[Jh].buttonsMap[e])),this[Jh].axesResolvers=this[Jh].axesSequence.map((e=>null===e?null:{axisId:e.substring(0,e.length-6),isY:"y-axis"===e.substring(e.length-6)})),this[Jh].axesView=this[Jh].axesResolvers.map((()=>null))}get id(){return this[Jh].id}get index(){return this[Jh].index}get connected(){return this[Jh].connected}get timestamp(){return this[Jh].timestamp}get mapping(){return this[Jh].mapping}get axes(){const{axesView:e,axesResolvers:t,axesMap:i}=this[Jh];for(let n=0;n<t.length;n++){const r=t[n];if(null===r)e[n]=null;else{const t=i[r.axisId];e[n]=r.isY?t.y:t.x}}return e}get buttons(){return this[Jh].buttonsView}get hapticActuators(){return this[Jh].hapticActuators}get vibrationActuator(){var e;return null!==(e=this[Jh].hapticActuators[0])&&void 0!==e?e:null}}(Uu=Bu||(Bu={})).None="none",Uu.Left="left",Uu.Right="right",(Gu=Vu||(Vu={})).Gaze="gaze",Gu.TrackedPointer="tracked-pointer",Gu.Screen="screen",Gu.TransientPointer="transient-pointer";class Hu extends Array{}class Zu{constructor(e,t,i,n,r,s,o){this[tu]={handedness:e,targetRayMode:t,targetRaySpace:n,gripSpace:s,profiles:i,gamepad:r,hand:o}}get handedness(){return this[tu].handedness}get targetRayMode(){return this[tu].targetRayMode}get targetRaySpace(){return this[tu].targetRaySpace}get gripSpace(){return this[tu].gripSpace}get profiles(){return this[tu].profiles}get gamepad(){return this[tu].gamepad}get hand(){return this[tu].hand}}class Yu extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const Qu={[Bu.Left]:{position:new Tu(-.25,1.5,-.4),quaternion:new Su},[Bu.Right]:{position:new Tu(.25,1.5,-.4),quaternion:new Su},[Bu.None]:{position:new Tu(.25,1.5,-.4),quaternion:new Su}};class Ku{constructor(e){this[Qh]={inputSource:e,position:Qu[e.handedness].position.clone(),quaternion:Qu[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[Qh].position}get quaternion(){return this[Qh].quaternion}get inputSource(){return this[Qh].inputSource}get connected(){return this[Qh].connected}set connected(e){this[Qh].connected=e,this[Qh].inputSource.gamepad[Jh].connected=e}onFrameStart(e){Eh(this[Qh].inputSource.targetRaySpace[fu].offsetMatr
380ix,this[Qh].quaternion.quat,this[Qh].position.vec3);const t=e.session;this[Qh].inputSource.gamepad.buttons.forEach((i=>{i instanceof Wu&&(i[Jh].lastFrameValue=i[Jh].value,null!=i[Jh].pendingValue&&(i[Jh].value=i[Jh].pendingValue,i[Jh].pendingValue=null),null!=i[Jh].eventTrigger&&(0===i[Jh].lastFrameValue&&i[Jh].value>0?(t.dispatchEvent(new Yu(i[Jh].eventTrigger,{frame:e,inputSource:this[Qh].inputSource})),t.dispatchEvent(new Yu(i[Jh].eventTrigger+"start",{frame:e,inputSource:this[Qh].inputSource}))):i[Jh].lastFrameValue>0&&0===i[Jh].value&&t.dispatchEvent(new Yu(i[Jh].eventTrigger+"end",{frame:e,inputSource:this[Qh].inputSource}))))})),this[Qh].inputSourceChanged=this.connected!==this[Qh].lastFrameConnected,this[Qh].lastFrameConnected=this.connected}}class Ju extends Ku{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const n=new wu(i),r=e.layout[t].gripOffsetMatrix?new wu(n,e.layout[t].gripOffsetMatrix):void 0,s=[e.profileId,...e.fallbackProfileIds];super(new Zu(t,Vu.TrackedPointer,s,n,new Xu(e.layout[t].gamepad,"",-1,e.layout[t].numHapticActuators),r)),this[H
380h]={profileId:e.profileId,gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[Hh].gamepadConfig}get profileId(){return this[Hh].profileId}updateButtonValue(e,t){if(t>1||t<0)return;const i=this[Qh].inputSource.gamepad[Jh].buttonsMap[e];if(i){if("binary"===i[Jh].type&&1!=t&&0!=t)return;i[Jh].pendingValue=t}}setButtonValueImmediate(e,t){if(t>1||t<0)return;const i=this[Qh].inputSource.gamepad[Jh].buttonsMap[e];if(i){if("binary"===i[Jh].type&&1!=t&&0!=t)return;i[Jh].value=t,i[Jh].pendingValue=t}}updateButtonTouch(e,t){const i=this[Qh].inputSource.gamepad[Jh].buttonsMap[e];i&&(i[Jh].touched=t)}updateAxis(e,t,i){if(i>1||i<-1)return;const n=this[Qh].inputSource.gamepad[Jh].axesMap[e];n&&("x-axis"===t?n.x=i:"y-axis"===t&&(n.y=i))}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return;const n=this[Qh].inputSource.gamepad[Jh].axesMap[e];n&&(n.x=t,n.y=i)}getButtonValue(e){var t;const i=this[Qh].inputSource.gamepad[Jh].buttonsMap[e];return i?null!==(t=i[Jh].pendingValue)&&void 0!==t?t:i.value:0}getButtonTouched(e){const t=this[Qh].inputSource.gamepad[Jh].buttonsMap[e];return!!t&&t.touched}getAxes(e="thumbstick"){const t=this[Qh].inputSource.gamepad[Jh].axesMap[e];return t?{x:t.x,y:t.y}:{x:0,y:0}}}class ed{constructor(e,t,i,n,r){this[nu]={nativeMesh:e,frame:void 0,meshSpace:t,vertices:i,indices:n,lastChangedTime:performance.now(),semanticLabel:r}}get meshSpace(){return this[nu].meshSpace}get vertices(){return this[nu].vertices}get indices(){return this[nu].indices}get lastChangedTime(){return this[nu].lastChangedTime}get semanticLabel(){return this[nu].semanticLabel}}class td extends Set{}class id{constructor(e,t,i,n){this.transform=e,this.vertices=t,this.indices=i,this.semanticLabel=n}}var nd,rd,sd,od;(rd=nd||(nd={})).Desk="desk",rd.Couch="couch",rd.Floor="floor",rd.Ceiling="ceiling",rd.Wall="wall",rd.Door="door",rd.Window="window",rd.Table="table",rd.Shelf="shelf",rd.Bed="bed",rd.Screen="screen",rd.Lamp="lamp",rd.Plant="plant",rd.WallArt="wall art",rd.GlobalMesh="global mesh",rd.Other="other",(od=sd||(sd={})).Horizontal="horizontal",od.Vertical="vertical";const ad={[nd.Desk]:sd.Horizontal,[nd.Couch]:sd.Horizontal,[nd.Floor]:sd.Horizontal,[nd.Ceiling]:sd.Horizontal,[nd.Wall]:sd.Vertical,[nd.Door]:sd.Vertical,[nd.Window]:sd.Vertical,[nd.Table]:sd.Horizontal,[nd.Shelf]:sd.Horizontal,[nd.Bed]:sd.Horizontal,[nd.Screen]:sd.Horizontal,[nd.Lamp]:sd.Horizontal,[nd.Plant]:sd.Horizontal,[nd.WallArt]:sd.Vertical};class ld{constructor(e,t,i,n){this[ru]={nativePlane:e,frame:void 0,planeSpace:t,polygon:i,lastChangedTime:performance.now(),semanticLabel:n,orientation:n?ad[n]:void 0}}get planeSpace(){return this[ru].planeSpace}get polygon(){return this[ru].polygon}get orientation(){return this[ru].orientation}get lastChangedTime(){return this[ru].lastChangedTime}get semanticLabel(){return this[ru].semanticLabel}}class cd extends Set{}class hd{constructor(e,t,i){this.transform=e,this.polygon=t,this.semanticLabel=i}}class ud{constructor(e,t,i,n,r,s){this[xu]={data:e,width:t,height:i,normDepthBufferFromNormView:n,rawValueToMeters:r,dataFormat:s,view:"float32"===s?new Float32Array(e):new Uint8Array(e)}}get data(){return this[xu].data}get width(){return this[xu].width}get height(){return this[xu].height}get normDepthBufferFromNormView(){return this[xu].normDepthBufferFromNormView}get rawValueToMeters(){return this[xu].rawValueToMeters}get dataFormat(){return this[xu].dataFormat}getDepthInMeters(e,t){const{width:i,height:n,rawValueToMeters:r,dataFormat:s,view:o}=this[xu];if(e<0||e>=1||t<0||t>=1)throw new RangeError("Normalized coordinates must be in [0, 1) range.");const a=Math.floor(e*i),l=Math.floor(t*n);if("float32"===s){return o[l*i+a]*r}{const e=o,t=2*(l*i+a);return(e[t]+256*e[t+1])*r}}}class dd{constructor(e,t,i,n,r,s,o,a,l){this.texture=e,this.width=t,this.height=i,this.normDepthBufferFromNormView=n,this.rawValueToMeters=r,this.depthNear=s,this.depthFar=o,this.textureType=a,this.imageIndex=l,this.isValid=!0}}class fd{constructor(e,t){this._session=e}getDepthInformation(e){var t;const i=this._session[hu].activeFrame;if(!i||!i[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invali
380d.","InvalidStateError");if(!this._session[hu].enabledFeatures.includes("depth-sensing"))throw new DOMException("depth-sensing feature is not enabled on this session.","InvalidStateError");if("gpu-optimized"!==this._session[hu].depthSensingUsage)throw new DOMException("getDepthInformation on XRWebGLBinding requires gpu-optimized depth sensing usage.","InvalidStateError");const n=e[pu].eye;return null!==(t=i[Kh].gpuDepthDataMap.get(n))&&void 0!==t?t:null}}class pd{constructor(e,t){this[Xh]={anchorSpace:e,session:t,deleted:!1},t[hu].trackedAnchors.add(this)}get anchorSpace(){if(this[Xh].deleted)throw new DOMException("XRAnchor has already been deleted.","InvalidStateError");return this[Xh].anchorSpace}requestPersistentHandle(){return new Promise(((e,t)=>{if(this[Xh].deleted)t(new DOMException("XRAnchor has already been deleted.","InvalidStateError"));else{const t=this[Xh].session[hu].persistentAnchors;for(const[n,r]of t.entries())if(r===this)return void e(n);const i=crypto.randomUUID();xd.createPersistentAnchor(this[Xh].session,this,i),e(i)}}))}delete(){this[Xh].deleted||(this[Xh].anchorSpace=null,this[Xh].deleted=!0,this[Xh].session[hu].trackedAnchors.delete(this))}}class md extends Set{}const gd="@immersive-web-emulation-runtime/persistent-anchors";class xd{static recoverPersistentAnchorsFromStorage(e){const t=JSON.parse(localStorage.getItem(gd)||"{}"),i=e[hu].device[Zh].globalSpace;Object.entries(t).forEach((([t,n])=>{const r=new wu(i,n),s=new pd(r,e);e[hu].persistentAnchors.set(t,s)}))}static createPersistentAnchor(e,t,i){e[hu].trackedAnchors.add(t),e[hu].persistentAnchors.set(i,t);const n=JSON.parse(localStorage.getItem(gd)||"{}");n[i]=Array.from(t[Xh].anchorSpace[fu].offsetMatrix),localStorage.setItem(gd,JSON.stringify(n))}}class vd{constructor(e,t){const i=Rh(0,0,0),n=jh(),r=e?Rh(e.x,e.y,e.z):i,s=t?$h(jh(),Vh(t.x,t.y,t.z,t.w)):n;this[lu]={matrix:ph(),position:r,orientation:s,positionPoint:new DOMPointReadOnly(r[0],r[1],r[2],1),orientationPoint:new DOMPointReadOnly(s[0],s[1],s[2],s[3]),inverse:null},this.updateMatrix()}updateMatrix(){Eh(this[lu].matrix,this[lu].orientation,this[lu].position)}get matrix(){return this[lu].matrix}get position(){return this[lu].positionPoint}get orientation(){return this[lu].orientationPoint}get inverse(){if(!this[lu].inverse){const e=ph();if(!vh(e,this[lu].matrix))throw new Error("Matrix is not invertible.");let t=_h();Th(t,e);let i=jh();Mh(i,e),this[lu].inverse=new vd(new DOMPointReadOnly(t[0],t[1],t[2],1),new DOMPointReadOnly(i[0],i[1],i[2],i[3])),this[lu].inverse[lu].inverse=this}return this[lu].inverse}}let yd=class{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}};class wd{constructor(e,t){const i={x:0,y:0,z:0,w:1},n={x:0,y:0,z:-1,w:0};if(e instanceof vd){const t=e.matrix,r=Dh(Nh(),i.x,i.y,i.z,i.w),s=Dh(Nh(),n.x,n.y,n.z,n.w);Fh(r,r,t),Fh(s,s,t),i.x=r[0],i.y=r[1],i.z=r[2],i.w=r[3],n.x=s[0],n.y=s[1],n.z=s[2],n.w=s[3]}else if(e&&(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w),t){if(0===t.x&&0===t.y&&0===t.z||0!==t.w)throw new DOMException("Invalid direction value to construct XRRay","TypeError");n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w}const r=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)||1;n.x=n.x/r,n.y=n.y/r,n.z=n.z/r,this[gu]={origin:new yd(i.x,i.y,i.z,i.w),direction:new yd(n.x,n.y,n.z,n.w),matrix:null}}get origin(){return this[gu].origin}get direction(){return this[gu].direction}get matrix(){if(this[gu].matrix)return this[gu].matrix;const e=kh(_h(),0,0,-1),t=kh(_h(),this[gu].origin.x,this[gu].origin.y,this[gu].origin.z),i=kh(_h(),this[gu].direction.x,this[gu].direction.y,this[gu].direction.z),n=Ih(_h(),i,e),r=Lh(i,e),s=ph();r>-1&&r<1?bh(s,Math.acos(r),n):-1===r?bh(s,Math.acos(r),kh(_h(),1,0,0)):xh(s);const o=wh(ph(),t),a=yh(ph(),o,s);return this[gu].matrix=new Float32Array(a),this[gu].matrix}}class bd{constructor(e,t){var i;this[vu]={session:e,space:t.space,offsetRay:null!==(i=t.offsetRay)&&void 0!==i?i:new wd,entityTypes:t.entityTypes}}cancel(){this[vu].session[hu].hitTestSources.delete(this)}}class Ed{constructor(e,t){this[vu]={frame:e,offsetSpace:t}}getPose(e){return this[vu].frame.getPose(this[vu].offsetSpace,e)}createAnchor(){return this[vu].frame.createAnchor(new vd,this[vu].offsetSpace)}}
380class Td extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var Sd,Md,Ad,_d,Rd;(Ad=Md||(Md={})).Viewer="viewer",Ad.Local="local",Ad.LocalFloor="local-floor",Ad.BoundedFloor="bounded-floor",Ad.Unbounded="unbounded";class Pd extends wu{constructor(e,t,i){super(t,i),this[Sd]={type:null,onreset:null},this[du].type=e}get onreset(){return this[du].onreset}set onreset(e){this[du].onreset&&this.removeEventListener("reset",this[du].onreset),this[du].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new Pd(this[du].type,this,e)}}Sd=du;class kd{constructor(e={},t){var i,n,r,s,o,a,l,c;this[cu]={depthNear:null!==(n=null!==(i=e.depthNear)&&void 0!==i?i:null==t?void 0:t.depthNear)&&void 0!==n?n:.1,depthFar:null!==(s=null!==(r=e.depthFar)&&void 0!==r?r:null==t?void 0:t.depthFar)&&void 0!==s?s:1e3,inlineVerticalFieldOfView:null!==(a=null!==(o=e.inlineVerticalFieldOfView)&&void 0!==o?o:null==t?void 0:t.inlineVerticalFieldOfView)&&void 0!==a?a:null,baseLayer:null!==(c=null!==(l=e.baseLayer)&&void 0!==l?l:null==t?void 0:t.baseLayer)&&void 0!==c?c:null}}get depthNear(){return this[cu].depthNear}get depthFar(){return this[cu].depthFar}get inlineVerticalFieldOfView(){return this[cu].inlineVerticalFieldOfView}get baseLayer(){return this[cu].baseLayer}}class Od extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}(Rd=_d||(_d={})).None="none",Rd.Left="left",Rd.Right="right";class Ld{constructor(e,t,i,n){this[pu]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:n}}get eye(){return this[pu].eye}get projectionMatrix(){return this[pu].projectionMatrix}get transform(){return this[pu].transform}get recommendedViewportScale(){return this[pu].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1||(this[pu].requestedViewportScale=e)}}class Id{constructor(e,t=!1,i=void 0,n=void 0){this[ou]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:n}}get transform(){return this[ou].transform}get emulatedPosition(){return this[ou].emulatedPosition}get linearVelocity(){return this[ou].linearVelocity}get angularVelocity(){return this[ou].angularVelocity}}class Cd extends Id{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[su]={radius:t}}get radius(){return this[su].radius}}class Nd extends Id{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[au]={views:Object.freeze(t)}}get views(){return this[au].views}}const Dd=ph(),Fd=ph(),jd=ph(),zd=_h(),Bd=jh(),Ud=[_d.None],Vd=[_d.Left,_d.Right],Gd=(e,t,i)=>{Eu.calculateGlobalOffsetMatrix(t,Dd),Eu.calculateGlobalOffsetMatrix(i,Fd),vh(jd,Fd),yh(e,jd,Dd)};class Wd{constructor(e,t,i,n,r){this[Kh]={session:e,id:t,active:i,animationFrame:n,predictedDisplayTime:r,tempMat4:ph(),detectedPlanes:new cd,detectedMeshes:new td,trackedAnchors:e[hu].frameTrackedAnchors,hitTestResultsMap:new Map,depthDataMap:new Map,gpuDepthDataMap:new Map}}get session(){return this[Kh].session}get predictedDisplayTime(){return this[Kh].predictedDisplayTime}getPose(e,t){if(!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return Gd(this[Kh].tempMat4,e,t),Th(zd,this[Kh].tempMat4),Mh(Bd,this[Kh].tempMat4),new Id(new vd({x:zd[0],y:zd[1],z:zd[2],w:1},{x:Bd[0],y:Bd[1],z:Bd[2],w:Bd[3]}),e[fu].emulated)}getViewerPose(e){if(!this[Kh].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[Kh].session,i=t[hu].device,n=this.getPose(i.viewerSpace,e),r="inline"===t[hu].mode?Ud:Vd,s=[];return r.forEach((n=>{const r=i.viewSpaces[n],o=this.getPose(r,e),a=t[hu].getProjectionMatrix(n),l=new Ld(n,new Float32Array(a),o.transform,t);s.push(l)})),new Nd(n.transform,s,!1)}getJointPose(e,t){const i=this.getPose(e,t),n=e[uu].radius;return new Cd(i.transform,n,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invali
380d.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let n=0;n<e.length;n++)e[n][uu].radius?t[n]=e[n][uu].radius:(t[n]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,n)=>{Gd(this[Kh].tempMat4,e,t),i.set(this[Kh].tempMat4,16*n)})),!0}get detectedPlanes(){if(!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[Kh].detectedPlanes}get detectedMeshes(){if(!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[Kh].detectedMeshes}get trackedAnchors(){if(!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[Kh].trackedAnchors}createAnchor(e,t){return new Promise(((i,n)=>{if(this[Kh].active){const r=this[Kh].session[hu].device[Zh].globalSpace,s=new wu(t,e.matrix),o=Eu.calculateGlobalOffsetMatrix(s),a=new wu(r,o),l=new pd(a,this[Kh].session);this[Kh].session[hu].trackedAnchors.add(l),this[Kh].session[hu].newAnchors.set(l,{resolve:i,reject:n})}else n(new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError"))}))}getHitTestResults(e){if(this[Kh].active){if(this[Kh].hitTestResultsMap.has(e))return[...this[Kh].hitTestResultsMap.get(e)];throw new DOMException("Requested hit test results are not available for current frame.","InvalidStateError")}throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError")}getDepthInformation(e){var t;if(!this[Kh].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(!this[Kh].session[hu].enabledFeatures.includes("depth-sensing"))throw new DOMException("depth-sensing feature is not enabled on this session.","InvalidStateError");return null!==(t=this[Kh].depthDataMap.get(e[pu].eye))&&void 0!==t?t:null}}var $d,qd,Xd,Hd,Zd,Yd;(qd=$d||($d={})).Opaque="opaque",qd.AlphaBlend="alpha-blend",qd.Additive="additive",(Hd=Xd||(Xd={})).ScreenSpace="screen-space",Hd.WorldSpace="world-space";class Qd extends EventTarget{constructor(e,t,i,n){var r,s;super(),this[hu]={device:e,mode:t,renderState:new kd,pendingRenderState:null,enabledFeatures:i,hasAnchors:i.includes("anchors"),hasPlanes:i.includes("plane-detection"),hasMeshes:i.includes("mesh-detection"),hasDepth:i.includes("depth-sensing"),hasHitTest:i.includes("hit-test"),supportedFrameRates:new Float32Array(e.supportedFrameRates),isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[_d.Left]:ph(),[_d.Right]:ph(),[_d.None]:ph()},getProjectionMatrix:e=>this[hu].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[hu].enabledFeatures.includes(e))return!1;switch(e){case Md.Viewer:return!0;case Md.Local:case Md.LocalFloor:case Md.BoundedFloor:case Md.Unbounded:return"inline"!=this[hu].mode}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[hu].ended)return;this[hu].deviceFrameHandle=globalThis.requestAnimationFrame(this[hu].onDeviceFrame),null!=this[hu].pendingRenderState&&(this[hu].renderState=this[hu].pendingRenderState,this[hu].pendingRenderState=null,this[hu].device[Zh].onBaseLayerSet(this[hu].renderState.baseLayer));const e=this[hu].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if("inline"!=this[hu].mode){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),n=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(n)}const{depthNear:n,depthFar:r}=this[hu].renderState,{width:s,height:o}=i;if("inline"!==this[hu].mode){const e=s*(this[hu].device.stereoEnabled?.5:1)/o;Ah(this[hu].projectionMatrices[_d.Left],this[hu].device.fovy,e,n,r),gh(this[hu].projectionMatrices[_d.Right],this[hu].projectionMatrices[_d.Left])}else{const e=s/o;Ah(this[hu].projectionMatrices[_d.None],this[hu].renderState.inlineVerticalFieldOfView,e,n,r)}const a=performance.now(),l=new Wd(this,this[hu].frameHandle,!0,!0,a),c=this[hu].device[Zh].devui;if(c&&c.render(a),"immersive-ar"===this[hu].mode){const e=this[hu].device[Zh].sem;e&&e.render(a)}this[hu].hasAnchors&&this[hu].updateTrackedAnchors(),this[hu].hasPlanes&&this[hu].updateTrackedPlanes(l),this[hu].hasMeshes&&this[hu].updateTrackedMeshes(l),this[hu].hasDepth&&this[hu].computeDepthSensing(l),this[hu].hasHitTest&&this[hu].computeHitTestResults(l),this[hu].activeFrame=l,this[hu].device[Zh].onFrameStart(l),this[hu].updateActiveInputSources();const h=this[hu].currentFrameCallbacks=this[hu].frameCallbacks;this[hu].frameCallbacks=[];for(let d=0;d<h.length;d++)try{h[d].cancelled||h[d].callback(a,l)}catch(u){}this[hu].currentFrameCallbacks=null,l[Kh].active=!1,this[hu].activeFrame=null},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[hu].enabledFeatures.includes("hand-tracking"),t=this[hu].activeInputSources,i=this[hu].device.inputSources.filter((t=>!t.hand||e)),n=i.filter((e=>!t.includes(e))),r=t.filter((e=>!i.includes(e)));this[hu].activeInputSources=i,(n.length>0||r.length>0)&&this.dispatchEvent(new Td("inputsourceschange",{session:this,added:n,removed:r}))},trackedAnchors:new md,persistentAnchors:new Map,newAnchors:new Map,frameTrackedAnchors:new md,updateTrackedAnchors:()=>{this[hu].enabledFeatures.includes("anchors")&&(this[hu].frameTrackedAnchors.clear(),Array.from(this[hu].trackedAnchors).forEac
380h((e=>{if(e[Xh].deleted){if(this[hu].trackedAnchors.delete(e),this[hu].newAnchors.has(e)){const{reject:t}=this[hu].newAnchors.get(e);t(new DOMException("Anchor is no longer tracked","InvalidStateError"))}}else if(this[hu].frameTrackedAnchors.add(e),this[hu].newAnchors.has(e)){const{resolve:t}=this[hu].newAnchors.get(e);t(e),this[hu].newAnchors.delete(e)}})))},trackedPlanes:new Map,updateTrackedPlanes:e=>{const t=this[hu].device[Zh].sem;if(!t)return;Array.from(this[hu].trackedPlanes.keys()).forEach((e=>{t.trackedPlanes.has(e)||this[hu].trackedPlanes.delete(e)})),t.trackedPlanes.forEach((t=>{let i=this[hu].trackedPlanes.get(t);if(!i){const e=new wu(this[hu].device[Zh].globalSpace,t.transform.matrix);i=new ld(t,e,t.polygon,t.semanticLabel),this[hu].trackedPlanes.set(t,i)}i[ru].lastChangedTime=e.predictedDisplayTime,i[ru].frame=e,e[Kh].detectedPlanes.add(i)}))},trackedMeshes:new Map,updateTrackedMeshes:e=>{const t=this[hu].device[Zh].sem;if(!t)return;Array.from(this[hu].trackedMeshes.keys()).forEach((e=>{t.trackedMeshes.has(e)||this[hu].trackedMeshes.delete(e)})),t.trackedMeshes.forEach((t=>{let i=this[hu].trackedMeshes.get(t);if(!i){const e=new wu(this[hu].device[Zh].globalSpace,t.transform.matrix);i=new ed(t,e,t.vertices,t.indices,t.semanticLabel),this[hu].trackedMeshes.set(t,i)}i[nu].lastChangedTime=e.predictedDisplayTime,i[nu].frame=e,e[Kh].detectedMeshes.add(i)}))},depthSensingUsage:null!==(s=null===(r=null==n?void 0:n.usagePreference)||void 0===r?void 0:r[0])&&void 0!==s?s:"cpu-optimized",depthSensingDataFormat:"float32",depthTexture:null,depthTextureWidth:0,depthTextureHeight:0,depthFlipScratch:null,depthFlipScratchSize:0,activeFrame:null,computeDepthSensing:e=>{const t=this[hu].device[Zh].sem;if(!t)return;const{depthNear:i,depthFar:n}=this[hu].renderState,r=this[hu].renderState.baseLayer;if(!r)return;const s=r.context.canvas,o=Math.max(1,Math.floor(s.width/4)),a=Math.max(1,Math.floor(s.height/4)),l="inline"===this[hu].mode?[_d.None]:[_d.Left,_d.Right],c="gpu-optimized"===this[hu].depthSensingUsage;for(const h of l){const s=this[hu].getProjectionMatrix(h),l=this[hu].device.viewSpaces[h],u=Eu.calculateGlobalOffsetMatrix(l),d=ph();vh(d,u);const f=t.computeDepthBuffer(d,s,o,a,i,n);if(f)if(c){const t=r.context,{width:s,height:o}=f,a=2;this[hu].depthTexture&&this[hu].depthTextureWidth===s&&this[hu].depthTextureHeight===o?t.bindTexture(t.TEXTURE_2D_ARRAY,this[hu].depthTexture):(this[hu].depthTexture&&t.deleteTexture(this[hu].depthTexture),this[hu].depthTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D_ARRAY,this[hu].depthTexture),t.texStorage3D(t.TEXTURE_2D_ARRAY,1,t.R32F,s,o,a),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this[hu].depthTextureWidth=s,this[hu].depthTextureHeight=o);const l=new Float32Array(f.data),c=s*o;this[hu].depthFlipScratch&&this[hu].depthFlipScratchSize===c||(this[hu].depthFlipScratch=new Float32Array(c),this[hu].depthFlipScratchSize=c);const u=this[hu].depthFlipScratch;for(let e=0;e<o;e++){const t=o-1-e;for(let n=0;n<s;n++){const r=l[t*s+n];u[e*s+n]=r>0?1-i/r:0}}const d=t.getParameter(t.UNPACK_FLIP_Y_WEBGL),p=t.getParameter(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const m=h===_d.Right?1:0;t.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,m,s,o,1,t.RED,t.FLOAT,u),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,d),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p);const g=new dd(this[hu].depthTexture,s,o,new vd,f.rawValueToMeters,i,n,"texture-array",m);e[Kh].gpuDepthDataMap.set(h,g)}else{const t=new ud(f.data,f.width,f.height,new vd,f.rawValueToMeters,this[hu].depthSensingDataFormat);e[Kh].depthDataMap.set(h,t)}}},hitTestSources:new Set,computeHitTestResults:e=>{const t=this[hu].device[Zh].sem;if(!t)return;const i=this[hu].device[Zh].globalSpace;this[hu].hitTestSources.forEach((n=>
380{const r=n[vu].space,s=Eu.calculateGlobalOffsetMatrix(r),o=n[vu].offsetRay.matrix,a=ph();yh(a,s,o);const l=[];t.computeHitTestResults(a).forEach((t=>{const n=new wu(i,t),r=new Ed(e,n);l.push(r)})),e[Kh].hitTestResultsMap.set(n,l)}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},xd.recoverPersistentAnchorsFromStorage(this),this[hu].onDeviceFrame()}get visibilityState(){return this[hu].device.visibilityState}get frameRate(){return this[hu].nominalFrameRate}get supportedFrameRates(){return this[hu].supportedFrameRates}get renderState(){return this[hu].renderState}get inputSources(){return this[hu].inputSourceArray.length=0,this[hu].ended||"inline"===this[hu].mode||this[hu].inputSourceArray.push(...this[hu].activeInputSources),this[hu].inputSourceArray}get enabledFeatures(){return this[hu].enabledFeatures}get isSystemKeyboardSupported(){return this[hu].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[hu].device[Zh].environmentBlendModes[this[hu].mode])&&void 0!==e?e:$d.Opaque}get interactionMode(){return this[hu].device[Zh].interactionMode}get depthUsage(){return this[hu].depthSensingUsage}get depthDataFormat(){return this[hu].depthSensingDataFormat}updateRenderState(e={}){var t,i,n,r,s,o,a,l,c,h,u,d;if(this[hu].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[iu].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&"inline"!==this[hu].mode)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const f={baseLayer:null!==(n=null!==(t=e.baseLayer)&&void 0!==t?t:null===(i=this[hu].pendingRenderState)||void 0===i?void 0:i.baseLayer)&&void 0!==n?n:void 0,depthFar:null!==(o=null!==(r=e.depthFar)&&void 0!==r?r:null===(s=this[hu].pendingRenderState)||void 0===s?void 0:s.depthFar)&&void 0!==o?o:void 0,depthNear:null!==(c=null!==(a=e.depthNear)&&void 0!==a?a:null===(l=this[hu].pendingRenderState)||void 0===l?void 0:l.depthNear)&&void 0!==c?c:void 0,inlineVerticalFieldOfView:null!==(d=null!==(h=e.inlineVerticalFieldOfView)&&void 0!==h?h:null===(u=this[hu].pendingRenderState)||void 0===u?void 0:u.inlineVerticalFieldOfView)&&void 0!==d?d:void 0};this[hu].pendingRenderState=new kd(f,this[hu].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[hu].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[hu].device.supportedFrameRates.includes(e)?(this[hu].nominalFrameRate===e||(this[hu].nominalFrameRate=e,this.dispatchEvent(new Od("frameratechange",{session:this}))),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[hu].ended||!this[hu].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let n;switch(e){case Md.Viewer:n=this[hu].device.viewerSpace;break;case Md.Local:n=new Pd(e,this[hu].device[Zh].globalSpace,this[hu].device.viewerSpace[fu].offsetMatrix);break;case Md.LocalFloor:case Md.BoundedFloor:case Md.Unbounded:n=new Pd(e,this[hu].device[Zh].globalSpace)}this[hu].referenceSpaces.push(n),t(n)}))}requestAnimationFrame(e){if(this[hu].ended)return 0;const t=++this[hu].frameHandle;return this[hu].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[hu].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[hu].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{var i;if(this[hu].ended)t(new DOMException("XRSession has already ended.","InvalidStateError"));else{if(this[hu].ended=!0,globalThis.cancelAnimationFrame(this[hu].deviceFrameHandle),this[hu].deviceFrameHandle=void 0,this[hu].device[Zh].onSessionEnd(),this[hu].frameCallbacks.length=0,this[hu].currentFrameCallbacks=null,this[hu].referenceSpaces.length=0,this[hu].hitTestSources.clear(),this[hu].trackedPlanes.clear(),this[hu].trackedMeshes.clear(),this[hu].trackedAnchors.clear(),this[hu].frameTrackedAnchors.clear(),this[hu].newAnchors.forEac
380h((({reject:e})=>{e(new DOMException("XRSession has ended before the anchor was resolved.","InvalidStateError"))})),this[hu].newAnchors.clear(),this[hu].depthTexture){const e=null===(i=this[hu].renderState.baseLayer)||void 0===i?void 0:i.context;null==e||e.deleteTexture(this[hu].depthTexture),this[hu].depthTexture=null}this.dispatchEvent(new Od("end",{session:this})),e()}}))}get persistentAnchors(){return Array.from(this[hu].persistentAnchors.keys())}restorePersistentAnchor(e){return new Promise(((t,i)=>{if(this[hu].persistentAnchors.has(e))if(this[hu].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else{const n=this[hu].persistentAnchors.get(e);this[hu].newAnchors.has(n)?i(new DOMException(`Multiple concurrent attempts detected to restore the anchor with UUID: ${e}.`,"InvalidStateError")):(this[hu].trackedAnchors.add(n),this[hu].newAnchors.set(n,{resolve:t,reject:i}))}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}deletePersistentAnchor(e){return new Promise(((t,i)=>{if(this[hu].persistentAnchors.has(e)){const i=this[hu].persistentAnchors.get(e);this[hu].persistentAnchors.delete(e),i.delete(),t(void 0)}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}requestHitTestSource(e){return new Promise(((t,i)=>{if(this[hu].enabledFeatures.includes("hit-test"))if(this[hu].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else if(this[hu].device[Zh].sem){const i=new bd(this,e);this[hu].hitTestSources.add(i),t(i)}else i(new DOMException("Synthethic Environment Module required for emulating hit-test","OperationError"));else i(new DOMException('WebXR feature "hit-test" is not supported by current session',"NotSupportedError"))}))}get onend(){return this[hu].onend}set onend(e){this[hu].onend&&this.removeEventListener("end",this[hu].onend),this[hu].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){return this[hu].oninputsourceschange}set oninputsourceschange(e){this[hu].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[hu].oninputsourceschange),this[hu].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){return this[hu].onselect}set onselect(e){this[hu].onselect&&this.removeEventListener("select",this[hu].onselect),this[hu].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){return this[hu].onselectstart}set onselectstart(e){this[hu].onselectstart&&this.removeEventListener("selectstart",this[hu].onselectstart),this[hu].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){return this[hu].onselectend}set onselectend(e){this[hu].onselectend&&this.removeEventListener("selectend",this[hu].onselectend),this[hu].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){return this[hu].onsqueeze}set onsqueeze(e){this[hu].onsqueeze&&this.removeEventListener("squeeze",this[hu].onsqueeze),this[hu].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){return this[hu].onsqueezestart}set onsqueezestart(e){this[hu].onsqueezestart&&this.removeEventListener("squeezestart",this[hu].onsqueezestart),this[hu].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){return this[hu].onsqueezeend}set onsqueezeend(e){this[hu].onsqueezeend&&this.removeEventListener("squeezeend",this[hu].onsqueezeend),this[hu].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){return this[hu].onvisibilitychange}set onvisibilitychange(e){this[hu].onvisibilitychange&&this.removeEventListener("visibilitychange",this[hu].onvisibilitychange),this[hu].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){return this[hu].onframeratechange}set onframeratechange(e){this[hu].onframeratechange&&this.removeEventListener("frameratechange",this[hu].onframeratechange),this[hu].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}(Yd=Zd||(Zd={})).Wrist="wrist",Yd.ThumbMetacarpal="thumb-metacarpal",Yd.ThumbPhalanxProximal="thumb-phalanx-proximal",Yd.ThumbPhalanxDistal="thumb-phalanx-distal",Yd.ThumbTip="thumb-tip",Yd.IndexFingerMetacarpal="index-finger-metacarpal",Yd.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",Yd.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",Yd.IndexFingerPhalanxDistal="index-finger-phalanx-distal",Yd.IndexFingerTip="index-finger-tip",Yd.MiddleFingerMetacarpal="middle-finger-metacarpal",Yd.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",Yd.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",Yd.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",Yd.MiddleFingerTip="middle-finger-tip",Yd.RingFingerMetacarpal="ring-finger-metacarpal",Yd.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",Yd.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",Yd.RingFingerPhalanxDistal="ring-finger-phalanx-distal",Yd.RingFingerTip="ring-finger-tip",Yd.PinkyFingerMetacarpal="pinky-finger-metacarpal",Yd.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",Yd.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",Yd.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",Yd.PinkyFingerTip="pinky-finger-tip";class Kd extends Map{}class Jd extends wu{constructor(e,t,i){super(t,i),this[uu]={jointName:e,radius:0}}get jointName(){return this[uu].jointName}}const ef={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatr
380ix:[.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,-.152
3806455283164978,-.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]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064}
380,"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,-.354594856
3805006256,.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,-.450604
3806175956726,.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]},point:{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}
380,"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,.7
380538246512413025,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}}
380,gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},tf={mapping:ju.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},nf=_h(),rf=jh(),sf=_h(),of=_h(),af=jh(),lf=_h(),cf=_h(),hf=jh(),uf=_h(),df=(e,t,i,n)=>(Th(nf,t),Mh(rf,t),Sh(sf,t),Th(of,i),Mh(af,i),Sh(lf,i),Ch(cf,nf,of,n),Bh(hf,rf,af,n),Ch(uf,sf,lf,n),function(e,t,i,n){var r=t[0],s=t[1],o=t[2],a=t[3],l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,f=r*h,p=s*c,m=s*h,g=o*h,x=a*l,v=a*c,y=a*h,w=n[0],b=n[1],E=n[2];e[0]=(1-(p+g))*w,e[1]=(d+y)*w,e[2]=(f-v)*w,e[3]=0,e[4]=(d-y)*b,e[5]=(1-(u+g))*b,e[6]=(m+x)*b,e[7]=0,e[8]=(f+v)*E,e[9]=(m-x)*E,e[10]=(1-(u+p))*E,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,hf,cf,uf),e),ff=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1];class pf extends Ku{constructor(e,t,i){if(t!==Bu.Left&&t!==Bu.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const n=new wu(i),r=new wu(n),s=[e.profileId,...e.fallbackProfileIds],o=new Kd;Object.values(Zd).forEach((e=>{o.set(e,new Jd(e,n))}));super(new Zu(t,Vu.TrackedPointer,s,n,new Xu(tf),r,o)),this[Yh]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[Yh].poseId}set poseId(e){this[Yh].poses[e]&&(this[Yh].poseId=e)}updateHandPose(){const e=this[Yh].poses[this[Yh].poseId],t=this[Yh].poses.pinch;Object.values(Zd).forEach((i=>{const n=e.jointTransforms[i].offsetMatrix,r=t.jointTransforms[i].offsetMatrix,s=this.inputSource.hand.get(i);df(s[fu].offsetMatrix,n,r,this.pinchValue),this.inputSource.handedness===Bu.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=ff[t]})(s[fu].offsetMatrix),s[uu].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&df(this.inputSource.gripSpace[fu].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[Qh].inputSource.gamepad[Jh].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return;this[Qh].inputSource.gamepad[Jh].buttonsMap.pinch[Jh].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}class mf extends EventTarget{}const gf={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class xf extends mf{constructor(e,t,i={}){if(super(),e[hu].ended)throw new DOMException("Session has ended","InvalidStateError");const n={...gf,...i};this[iu]={session:e,context:t,antialias:n.antialias}}get context(){return this[iu].context}get antialias(){return this[iu].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[iu].context.drawingBufferWidth}get framebufferHeight(){return this[iu].context.drawingBufferHeight}getViewport(e){if(e[pu].session!==this[iu].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[iu].session[hu].device[Zh].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof Qd))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[hu].ended?0:1}}class vf{constructor(e,t,i,n={}){var r;const{schema:s,frames:o}=t;if(!o||!s||0===o.length)throw new DOMException("wrong recording format","NotSupportedError");const a=new Pd(Md.Viewer,e),l={[_d.Left]:new wu(a),[_d.Right]:new wu(a),[_d.None]:new wu(a)};this[qh]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:o,recordedFramePointer:0,startingTimeStamp:o[0][0],endingTimeStamp:o[o.length-1][0],playbackTime:o[0][0],playing:!1,viewerSpace:a,viewSpaces:l,vec3:_h(),quat:jh(),f1p:_h(),f1q:jh(),f2p:_h(),f2q:jh(),lastFrameInputs:new Map,nextFrameInputs:new Map,loop:null!==(r=n.loop)&&void 0!==r&&r,playbackRate:null!=n.playbackRate&&n.playbackRate>0?n.playbackRate:1,eventContext:n.eventContext,lastEventFramePointer:-1}
380,wh(this[qh].viewSpaces[_d.Left][fu].offsetMatrix,Rh(-i/2,0,0)),wh(this[qh].viewSpaces[_d.Right][fu].offsetMatrix,Rh(i/2,0,0)),s.forEach((t=>{const i=t[0],n=t[1];let r;if(n.hasGamepad){const e=[];for(let i=0;i<n.numButtons;i++)e.push({id:i.toString(),type:"manual"});const t=[];for(let i=0;i<n.numAxes;i++)t.push({id:i.toString(),type:"manual"});r=new Xu({mapping:n.mapping,buttons:e,axes:t})}const s=new wu(e);let o;n.hasHand&&(o=new Kd,Object.values(Zd).forEach((e=>{o.set(e,new Jd(e,s))})));const a=new Zu(n.handedness,n.targetRayMode,n.profiles,s,r,n.hasGrip?new wu(e):void 0,n.hasHand?o:void 0);this[qh].inputSources.set(i,{active:!1,source:a}),this[qh].inputSchemas.set(i,n)})),o.forEach(((e,t)=>{for(let i=8;i<e.length;i++){const n=e[i],r=n[0],s=this[qh].inputSchemas.get(r);if(!s)throw new DOMException(`recording frame ${t} references unknown input source ${r}`,"NotSupportedError");if(s.hasGamepad){let e=8;s.hasGrip&&e++,s.hasHand&&e++;const i=n[e],o=s.numButtons+s.numAxes;if(!Array.isArray(i)||i.length!==o){const e=Array.isArray(i)?i.length:"no";throw new DOMException(`recording frame ${t} input source ${r} has ${e} gamepad entries, expected ${o} (${s.numButtons} buttons + ${s.numAxes} axes)`,"NotSupportedError")}}}}))}play(){this[qh].recordedFramePointer=0,this[qh].playbackTime=this[qh].startingTimeStamp,this[qh].playing=!0,this[qh].actualTimeStamp=performance.now(),this[qh].lastEventFramePointer=-1}stop(){this[qh].playing=!1}get playing(){return this[qh].playing}get viewerSpace(){return this[qh].viewerSpace}get viewSpaces(){return this[qh].viewSpaces}get inputSources(){return Array.from(this[qh].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}get loop(){return this[qh].loop}set loop(e){this[qh].loop=e}get playbackRate(){return this[qh].playbackRate}set playbackRate(e){e>0&&(this[qh].playbackRate=e)}setEventContext(e){this[qh].eventContext=e}get duration(){return this[qh].endingTimeStamp-this[qh].startingTimeStamp}get currentTime(){return this[qh].playbackTime-this[qh].startingTimeStamp}seek(e){const t=this[qh],i=Math.max(0,Math.min(e,this.duration)),n=t.startingTimeStamp+i;t.playbackTime=n,t.recordedFramePointer=this.findFramePointer(n),t.lastEventFramePointer=-1,t.actualTimeStamp=performance.now()}findFramePointer(e){const t=this[qh].frames;let i=0,n=t.length-1,r=0;for(;i<=n;){const s=i+n>>1;t[s][0]<=e?(r=s,i=s+1):n=s-1}return r}stepFrames(e=1){const t=this[qh],i=t.frames;t.playing=!0;for(let n=0;n<e;n++){if(t.recordedFramePointer+1>=i.length){if(!t.loop)return t.playbackTime=t.endingTimeStamp,this.applyFrameAtPointer(0),void this.stop();t.recordedFramePointer=0,t.playbackTime=t.startingTimeStamp,t.lastEventFramePointer=-1}else t.recordedFramePointer++,t.playbackTime=i[t.recordedFramePointer][0];this.applyFrameAtPointer(0)}t.actualTimeStamp=performance.now()}playFrame(){const e=performance.now(),t=(e-this[qh].actualTimeStamp)*this[qh].playbackRate;this[qh].actualTimeStamp=e,this[qh].playbackTime+=t;const i=this[qh].frames;if(this[qh].playbackTime>this[qh].endingTimeStamp)if(this[qh].loop){const e=this[qh].playbackTime-this[qh].endingTimeStamp,t=this.duration>0?this[qh].startingTimeStamp+e%this.duration:this[qh].startingTimeStamp;this[qh].playbackTime=t,this[qh].recordedFramePointer=this.findFramePointer(t),this[qh].lastEventFramePointer=-1}else this[qh].playbackTime=this[qh].endingTimeStamp,this.stop();for(;this[qh].recordedFramePointer+1<i.length&&i[this[qh].recordedFramePointer+1][0]<this[qh].playbackTime;)this[qh].recordedFramePointer++;const n=this[qh].recordedFramePointer+1<i.length,r=i[this[qh].recordedFramePointer],s=n?i[this[qh].recordedFramePointer+1]:r,o=n?(this[qh].playbackTime-r[0])/(s[0]-r[0]):0;this.applyFrameAtPointer(o)}applyFrameAtPointer(e){const t=this[qh].frames,i=this[qh].recordedFramePointer+1<t.length,n=t[this[qh].recordedFramePointer],r=i?t[this[qh].recordedFramePointer+1]:n;this.updateXRSpaceFromMergedFrames(this[qh].viewerSpace,n.slice(1,8),r.slice(1,8),e);const s=this[qh].lastFrameInputs;s.clear();for(let a=8;a<n.length;a++){const{index:e,inputData:t}=this.processRawInputData(n[a]);s.set(e,t)}const o=this[qh].nextFrameInputs;o.clear();for(let a=8;a<r.length;a++){const{index:e,inputData:t}=this.processRawInputData(r[a]);o.set(e,t)}
380this[qh].inputSources.forEach((e=>{e.active=!1})),o.forEach(((t,i)=>{this[qh].inputSources.get(i).active=!0;const n=this[qh].inputSources.get(i).source,r=this[qh].inputSchemas.get(i);this.updateInputSource(n,r,s.has(i)?s.get(i):t,t,e)})),this.dispatchSelectSqueezeEdges()}dispatchSelectSqueezeEdges(){const e=this[qh],t=e.eventContext,i=e.recordedFramePointer;if(!t)return void(e.lastEventFramePointer=i);const n=e.lastEventFramePointer;if(n<0||n===i)return void(e.lastEventFramePointer=i);const r=t.getFrame();if(!r)return void(e.lastEventFramePointer=i);const s=e.frames,o=i>n?1:-1;for(let a=n;a!==i;a+=o){const e=o>0?a:a-1,i=e+1;this.dispatchEdgesBetweenFrames(s[e],s[i],t,r)}e.lastEventFramePointer=i}dispatchEdgesBetweenFrames(e,t,i,n){var r;const s=new Map;for(let o=8;o<e.length;o++){const{index:t,inputData:i}=this.processRawInputData(e[o]);s.set(t,i)}for(let o=8;o<t.length;o++){const{index:e,inputData:a}=this.processRawInputData(t[o]),l=this[qh].inputSchemas.get(e);if(!l||!l.hasGamepad||!a.buttons)continue;const c=s.get(e);if(!c||!c.buttons)continue;const h=null===(r=this[qh].inputSources.get(e))||void 0===r?void 0:r.source;h&&a.buttons.forEach(((e,t)=>{var r,s;const o=this.eventTriggerForButton(l,t);if(null==o)return;const a=null!==(s=null===(r=c.buttons[t])||void 0===r?void 0:r[2])&&void 0!==s?s:0,u=e[2];0===a&&u>0?(i.session.dispatchEvent(new Yu(o,{frame:n,inputSource:h})),i.session.dispatchEvent(new Yu(o+"start",{frame:n,inputSource:h}))):a>0&&0===u&&i.session.dispatchEvent(new Yu(o+"end",{frame:n,inputSource:h}))}))}}eventTriggerForButton(e,t){return e.mapping!==ju.XRStandard?null:0===t?"select":1===t?"squeeze":null}updateInputSource(e,t,i,n,r){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,n.targetRayTransform,r),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,n.gripTransform,r),t.hasHand)for(let s=0;s<25;s++){const o=i.handTransforms.slice(8*s,8*s+7),a=n.handTransforms.slice(8*s,8*s+7),l=i.handTransforms[8*s+7],c=n.handTransforms[8*s+7],h=e.hand.get(t.jointSequence[s]);this.updateXRSpaceFromMergedFrames(h,o,a,r),h[uu].radius=(c-l)*r+l}if(t.hasGamepad){const t=e.gamepad;n.buttons.forEach(((e,n)=>{const s=t.buttons[n];s[Jh].pressed=1===e[0],s[Jh].touched=1===e[1];const o=i.buttons[n][2],a=e[2];s[Jh].value=(a-o)*r+o})),n.axes.forEach(((e,n)=>{const s=i.axes[n];t[Jh].axesMap[n.toString()].x=(e-s)*r+s}))}}updateXRSpaceFromMergedFrames(e,t,i,n){const r=kh(this[qh].f1p,t[0],t[1],t[2]),s=Wh(this[qh].f1q,t[3],t[4],t[5],t[6]),o=kh(this[qh].f2p,i[0],i[1],i[2]),a=Wh(this[qh].f2q,i[3],i[4],i[5],i[6]);Ch(this[qh].vec3,r,o,n),Bh(this[qh].quat,s,a,n),Eh(e[fu].offsetMatrix,this[qh].quat,this[qh].vec3)}processRawInputData(e){const t=e[0],i=this[qh].inputSchemas.get(t),n={targetRayTransform:e.slice(1,8)};let r=8;if(i.hasGrip&&(n.gripTransform=e[r++]),i.hasHand&&(n.handTransforms=e[r++]),i.hasGamepad){const t=e[r];n.buttons=t.slice(0,i.numButtons),n.axes=t.slice(i.numButtons)}return{index:t,inputData:n}}}const yf="2.3.0";class wf extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}class bf extends EventTarget{constructor(e){super(),this[eu]={device:e,grantSession:({resolve:e,reject:t,mode:i,options:n})=>{if(this[eu].activeSession)return void t(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:r=[],optionalFeatures:s=[]}=n,{supportedFeatures:o}=this[eu].device;if(!r.every((e=>o.includes(e))))return void t(new Error("One or more required features are not supported by the device."));const a=s.filter((e=>o.includes(e))),l=Array.from(new Set([...r,...a,"viewer","local"])),c=new Qd(this[eu].device,i,l,n.depthSensing);this[eu].activeSession=c,c.addEventListener("end",(()=>{this[eu].activeSession=void 0}),{once:!0}),e(c)}}}isSessionSupported(e){return new Promise(((t,i)=>{t("inline"===e||this[eu].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,n)=>{this.isSessionSupported(e).then((r=>{if(!r)return void n(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));const s={resolve:i,reject:n,mode:e,options:t};this[eu].grantSession(s)})).catch(n)}))}offerSession(e,t={}){return new Promise(((i,n)=>{this.isSessionSupported(e).then((r=>{var s;r?(null===(s=this[eu].offeredSessionConfig)||void 0===s||s.reject(new Error("Offer superseded by a new offerSession call.")),this[eu].offeredSessionConfig={resolve:i,reject:n,mode:e,options:t}):n(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"))})).catch(n)}))}}class Ef{constructor(e,t,i,n){this[mu]={x:e,y:t,width:i,height:n}}get x(){return this[mu].x}get y(){return this[mu].y}get width(){return this[mu].width}get height(){return this[mu].height}}
381/**
382 * @license
383 * webxr-layers-polyfill
384 * Version 1.1.0
385 * Copyright (c) 2021 Facebook, Inc. and its affiliates.
386 * Licensed under the Apache License, Version 2.0 (the "License");
387 * you may not use this file except in compliance with the License.
388 * You may obtain a copy of the License at
389 * 
390 * http://www.apache.org/licenses/LICENSE-2.0
391 * 
392 * Unless required by applicable law or agreed to in writing, software
393 * distributed under the License is distributed on an "AS IS" BASIS,
394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395 * See the License for the specific language governing permissions and
396 * limitations under the License.
397*/
398/**
399 * @license
400 * gl-matrix 
401 * Version 3.4.3
402 * Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
403 * 
404 * Permission is hereby granted, free of charge, to any person obtaining a copy
405 * of this software and associated documentation files (the "Software"), to deal
406 * in the Software without restriction, including without limitation the rights
407 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
408 * copies of the Software, and to permit persons to whom the Software is
409 * furnished to do so, subject to the following conditions:
410 * 
411 * The above copyright notice and this permission notice shall be included in
412 * all copies or substantial portions of the Software.
413 * 
414 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
415 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
416 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
417 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
418 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
419 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
420 * THE SOFTWARE.
421*/var Tf,Sf,Mf,Af;(Sf=Tf||(Tf={})).texture="texture",Sf["texture-array"]="texture-array",(Af=Mf||(Mf={})).default="default",Af.mono="mono",Af.stereo="stereo",Af["stereo-left-right"]="stereo-left-right",Af["stereo-top-bottom"]="stereo-top-bottom";const _f=e=>e&&"function"==typeof e.getOffsetReferenceSpace,Rf=()=>"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Pf=(e,t)=>{switch(t){case e.RGBA8:case e.RGB5_A1:case e.RGBA4:case e.SRGB8_ALPHA8:return{internalFormat:t,textureFormat:e.RGBA,type:e.UNSIGNED_BYTE};case e.RGBA8_SNORM:return{internalFormat:t,textureFormat:e.RGBA,type:e.BYTE};case e.RGB10_A2:return{internalFormat:t,textureFormat:e.RGBA,type:e.UNSIGNED_INT_2_10_10_10_REV};case e.RGBA16F:return{internalFormat:t,textureFormat:e.RGBA,type:e.HALF_FLOAT};case e.RGBA32F:return{internalFormat:t,textureFormat:e.RGBA,type:e.FLOAT};case e.RGBA8UI:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.UNSIGNED_BYTE};case e.RGBA8I:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.BYTE};case e.RGBA16UI:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.UNSIGNED_SHORT};case e.RGBA16I:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.SHORT};case e.RGBA32UI:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.UNSIGNED_INT};case e.RGBA32I:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.INT};case e.RGB10_A2UI:return{internalFormat:t,textureFormat:e.RGBA_INTEGER,type:e.UNSIGNED_INT_2_10_10_10_REV};case e.RGB8:case e.RGB565:case e.SRGB8:return{internalFormat:t,textureFormat:e.RGB,type:e.UNSIGNED_BYTE};case e.RGB8_SNORM:return{internalFormat:t,textureFormat:e.RGB,type:e.BYTE};case e.RGB16F:case e.R11F_G11F_B10F:case e.RGB9_E5:return{internalFormat:t,textureFormat:e.RGB,type:e.HALF_FLOAT};case e.RGB32F:return{internalFormat:t,textureFormat:e.RGB,type:e.FLOAT};case e.RGB8UI:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.UNSIGNED_BYTE};case e.RGB8I:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.BYTE};case e.RGB16UI:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.UNSIGNED_SHORT};case e.RGB16I:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.SHORT};case e.RGB32UI:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.UNSIGNED_INT};case e.RGB32I:return{internalFormat:t,textureFormat:e.RGB_INTEGER,type:e.INT};case e.DEPTH_COMPONENT16:return{internalFormat:t,textureFormat:e.DEPTH_COMPONENT,type:e.UNSIGNED_SHORT};case e.DEPTH_COMPONENT24:return{internalFormat:t,textureFormat:e.DEPTH_COMPONENT,type:e.UNSIGNED_INT};case e.DEPTH_COMPONENT32F:return{internalFormat:t,textureFormat:e.DEPTH_COMPONENT,type:e.FLOAT};case e.DEPTH24_STENCIL8:return{internalFormat:t,textureFormat:e.DEPTH_STENCIL,type:e.UNSIGNED_INT_24_8};case e.DEPTH32F_STENCIL8:return{internalFormat:t,textureFormat:e.DEPTH_STENCIL,type:e.FLOAT_32_UNSIGNED_INT_24_8_REV};case e.DEPTH_COMPONENT:return Pf(e,e.DEPTH_COMPONENT24);case e.DEPTH_STENCIL:return Pf(e,e.DEPTH24_STENCIL8);case e.RGBA:case e.RGB:case e.LUMINANCE_ALPHA:case e.LUMINANCE:case e.ALPHA:return{internalFormat:t,textureFormat:t,type:e.UNSIGNED_BYTE};default:throw new Error("Attempted to create polyfill with unsupported format.")}};class kf{constructor(){this._hasRunDeferredInitialize=!1,this._media=null}initialize(e,t){this.session=e,t&&(this.context=t),this.blendTextureSourceAlpha=!0}destroy(){this._colorTextures=[],this._depthStencilTextures=[]}addEventListener(e,t,i){}dispatchEvent(e){return!1}removeEventListener(e,t,i){}getContext(){return this.context}getTextureType(){throw new Error("Unimplemented")}get colorTextures(){return this._colorTextures}get depthStencilTextures(){return this._depthStencilTextures}get colorTexturesMeta(){return this._texturesMeta}get media(){return this.isMediaLayer(),this._media}determineLayoutAttribute(e,t,i){if(!(t instanceof WebGL2RenderingContext)&&e===Tf["texture-array"])throw new TypeError;if(i===Mf.mono)return i;if(i===Mf.default){if(this.session.internalViews&&1===this.session.internalViews.length)return Mf.mono;if(e===Tf["texture-array"])return i}return i===Mf.default||i===Mf.stereo?Mf["stereo-left-right"]:i}isMediaLayer(){return null!==this._media}_deferredInitialize(){}initializeIfNeeded(){this._hasRunDeferredInitialize||(this._hasRunDeferredInitialize=!0,this._deferredInitialize())}_allocateColorTexturesInternal(e,t){let i=this.session.internalViews;if(i&&0!==i.length){if(this.initializeIfNeeded(),this.layout===Mf.mono){if(e===Tf["texture-array"]){const i=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat);return this._texturesMeta=[i],void(this._colorTextures=[i.texture])}{const i=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat);return this._texturesMeta=[i],void(this._colorTextures=[i.texture])}}if(this.layout===Mf.stereo){if(e===Tf["texture-array"]){const i=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat,2);return this._texturesMeta=[i],void(this._colorTextures=[i.texture])}{const i=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat),n=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat);return this._texturesMeta=[i,n],void(this._colorTextures=[i.texture,n.texture])}}if(this.layout===Mf["stereo-left-right"]){const i=this._createNewColorTexture(2*t.viewPixelWidth,t.viewPixelHeight,e,t.colorFormat);return this._texturesMeta=[i],void(this._colorTextures=[i.texture])}if(this.layout===Mf["stereo-top-bottom"]){const i=this._createNewColorTexture(t.viewPixelWidth,2*t.viewPixelHeight,e,t.colorFormat);return this._texturesMeta=[i],void(this._colorTextures=[i.texture])}}}_allocateDepthStencilTexturesInternal(e,t){if(t.depthFormat){if(this._getSupportedDepthF
421ormats().indexOf(t.depthFormat)<0)throw new Error("Depth format provided is not supported in non-projection layers.");if(t.mipLevels<1)throw new Error("Invalid miplevel. Miplevel needs to be >= 1");if(this.layout===Mf.mono){if(e===Tf["texture-array"]){const i=this._createNewDepthStencilTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat);return void(this._depthStencilTextures=[i.texture])}{const i=this._createNewColorTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat);return void(this._depthStencilTextures=[i.texture])}}if(this.layout===Mf.stereo){if(e===Tf["texture-array"]){const i=this._createNewDepthStencilTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat,2);return void(this._depthStencilTextures=[i.texture])}{const i=this._createNewDepthStencilTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat),n=this._createNewDepthStencilTexture(t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat);return void(this._depthStencilTextures=[i.texture,n.texture])}}if(this.layout!==Mf["stereo-left-right"])if(this.layout!==Mf["stereo-top-bottom"]);else{const i=this._createNewDepthStencilTexture(t.viewPixelWidth,2*t.viewPixelHeight,e,t.depthFormat);this._depthStencilTextures=[i.texture]}else{const i=this._createNewDepthStencilTexture(2*t.viewPixelWidth,t.viewPixelHeight,e,t.depthFormat);this._depthStencilTextures=[i.texture]}}else this._depthStencilTextures=[]}_createNewColorTexture(e,t,i,n,r=1){return this._createGenericPolyfillTexture(i,e,t,n,0,r)}_createNewDepthStencilTexture(e,t,i,n,r=1){return this._createGenericPolyfillTexture(i,e,t,n,0,r)}_createGenericPolyfillTexture(e,t,i,n,r=0,s=1){if(Tf["texture-array"],e===Tf["texture-array"]&&this.context instanceof WebGLRenderingContext)throw new Error("WebGL 1 does not support texture array");let o=this.context.createTexture(),a={width:t,height:i,layers:s,type:e,textureFormat:n,texture:o},l=n,c=this.context.UNSIGNED_BYTE;if(this.context instanceof WebGL2RenderingContext){const e=Pf(this.context,n);l=e.internalFormat,n=e.textureFormat,c=e.type}else n===this.context.DEPTH_COMPONENT&&(c=this.context.UNSIGNED_INT),n===this.context.DEPTH_STENCIL&&(c=this.context.UNSIGNED_INT_24_8_WEBGL);if(e===Tf["texture-array"]&&this.context instanceof WebGL2RenderingContext){const e=this.context.getParameter(this.context.TEXTURE_BINDING_2D_ARRAY);this.context.bindTexture(this.context.TEXTURE_2D_ARRAY,o),this._getSupportedDepthFormats().indexOf(n)>=0?this.context.texStorage3D(this.context.TEXTURE_2D_ARRAY,1,l,t,i,s):this.context.texImage3D(this.context.TEXTURE_2D_ARRAY,0,l,t,i,s,0,n,c,null),this.context.bindTexture(this.context.TEXTURE_2D_ARRAY,e)}else{const e=this.context.getParameter(this.context.TEXTURE_BINDING_2D);this.context.bindTexture(this.context.TEXTURE_2D,o),this.context.texImage2D(this.context.TEXTURE_2D,0,l,t,i,0,n,c,null),this.context.bindTexture(this.context.TEXTURE_2D,e)}return a}_getSupportedDepthFormats(){const e=[];return this.context instanceof WebGLRenderingContext&&!this.context.getExtension("WEBGL_depth_texture")||(e.push(this.context.DEPTH_COMPONENT,this.context.DEPTH_STENCIL),this.context instanceof WebGL2RenderingContext&&e.push(this.context.DEPTH_COMPONENT24,this.context.DEPTH24_STENCIL8)),e}}const Of={colorFormat:6408,mipLevels:1,layout:Mf.mono,isStatic:!1,space:null,viewPixelHeight:0,viewPixelWidth:0,textureType:Tf.texture,radius:2,centralAngle:.78539,aspectRatio:2},Lf={layout:Mf.mono,invertStereo:!1,space:null,radius:2,centralAngle:.78539};class If extends kf{constructor(e,t){super(),this._media=null!=t?t:null,this.isMediaLayer()?this.init=Object.assign(Object.assign({},Lf),e):this.init=Object.assign(Object.assign({},Of),e),this.radius=this.init.radius,this.centralAngle=this.init.centralAngle,this.aspectRatio=this.init.aspectRatio,this.space=this.init.space,this.layout=this.init.layout;const i=Rf();this.init.transform?this.transform=new i.XRRigidTransform(e.transform.position,e.transform.orientation):this.transform=new i.XRRigidTransform({x:0,y:0,z:0,w:1}),this.isMediaLayer()||(this.isStatic=e.isStatic)}getTextureType(){return this.isMediaLayer()?Tf.texture:this.init.textureType}_deferredInitialize(){let e=this.determineLayoutAttribute(this.init.textureType,this.context,this.init.layout);this.layout=e,this.needsRedraw=!0}get colorTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._colorTextures}get depthStencilTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._depthStencilTextures&&this._depthStencilTextures.length||this._allocateDepthStencilTexturesInternal(this.getTextureType(),this.init),this._depthStencilTextures}get colorTexturesMeta(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._texturesMeta}get width(){return 2*this.radius*Math.PI*(this.centralAngle/(2*Math.PI))}get height(){return this.width/this.aspectRatio}}const Cf={colorFormat:6408,mipLevels:1,layout:Mf.mono,isStatic:!1,space:null,viewPixelHeight:0,viewPixelWidth:0,textureType:Tf.texture,radius:0,centralHorizontalAngle:6.28318,upperVerticalAngle:1.570795,lowerVerticalAngle:-1.570795},Nf={space:null,layout:Mf.mono,invertStereo:!1,radius:0,centralHorizontalAngle:6.28318,upperVerticalAngle:1.570795,lowerVerticalAngle:-1.570795};class Df extends kf{constructor(e,t){if(super(),this._media=null!=t?t:null,this.isMediaLayer()?this.init=Object.assign(Object.assign({},Nf),e):this.init=Object.assign(Object.assign({},Cf),e),!_f(this.init.space))throw new TypeError("Equirect layer's space needs to be an XRReferenceSpace");this.radius=this.init.radius,this.centralHorizontalAngle=this.init.centralHorizontalAngle,this.up
421perVerticalAngle=this.init.upperVerticalAngle,this.lowerVerticalAngle=this.init.lowerVerticalAngle,this.space=this.init.space,this.layout=this.init.layout;const i=Rf();e.transform?this.transform=new i.XRRigidTransform(e.transform.position,e.transform.orientation):this.transform=new i.XRRigidTransform({x:0,y:0,z:0,w:1}),this.isMediaLayer()||(this.isStatic=e.isStatic)}getTextureType(){return this.isMediaLayer()?Tf.texture:this.init.textureType}_deferredInitialize(){let e=this.determineLayoutAttribute(this.init.textureType,this.context,this.init.layout);this.layout=e,this.needsRedraw=!0}get colorTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._colorTextures}get depthStencilTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._depthStencilTextures&&this._depthStencilTextures.length||this._allocateDepthStencilTexturesInternal(this.getTextureType(),this.init),this._depthStencilTextures}get colorTexturesMeta(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._texturesMeta}}const Ff={colorFormat:6408,mipLevels:1,layout:Mf.mono,isStatic:!1,space:null,viewPixelHeight:0,viewPixelWidth:0,textureType:Tf.texture,width:1,height:1},jf={space:null,layout:Mf.mono,invertStereo:!1};class zf extends kf{constructor(e,t){super(),this._media=null!=t?t:null,this.isMediaLayer()?this.init=Object.assign(Object.assign({},jf),e):this.init=Object.assign(Object.assign({},Ff),e),this.width=this.init.width,this.height=this.init.height,this.space=this.init.space,this.layout=this.init.layout;const i=Rf();this.init.transform?this.transform=new i.XRRigidTransform(e.transform.position,e.transform.orientation):this.transform=new i.XRRigidTransform({x:0,y:0,z:0,w:1}),this.isMediaLayer()||(this.isStatic=e.isStatic)}getTextureType(){return this.isMediaLayer()?Tf.texture:this.init.textureType}_deferredInitialize(){let e=this.determineLayoutAttribute(this.init.textureType,this.context,this.init.layout);this.layout=e,this.needsRedraw=!0}get colorTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._colorTextures}get depthStencilTextures(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._depthStencilTextures&&this._depthStencilTextures.length||this._allocateDepthStencilTexturesInternal(this.getTextureType(),this.init),this._depthStencilTextures}get colorTexturesMeta(){if(this.isMediaLayer())throw new Error("Media layers do not have associated textures");return this._colorTextures&&this._colorTextures.length||this._allocateColorTexturesInternal(this.getTextureType(),this.init),this._texturesMeta}}class Bf{constructor(e){if(this.session=e,this.session.ended)throw new Error("Session has ended")}createQuadLayer(e,t){if(this.session.ended)throw new Error("Session has ended");if(t.layout===Mf.default)throw new TypeError("Media Quad layer cannot be created with layout of default");let i=this.calculateAspectRatio(e,t.layout);void 0===t.width&&void 0===t.height&&(t.width=1),void 0===t.height&&(t.height=t.width/i),void 0===t.width&&(t.width=t.height/i);let n=new zf(t,e);return n.needsRedraw=!1,n.initialize(this.session),n}createCylinderLayer(e,t){if(this.session.ended)throw new Error("Session has ended");if(t.layout===Mf.default)throw new TypeError("Media Cylinder layer cannot be created with layout of default");let i=this.calculateAspectRatio(e,t.layout);void 0===t.aspectRatio&&(t.aspectRatio=i);let n=new If(t,e);return n.needsRedraw=!1,n.initialize(this.session),n}createEquirectLayer(e,t){if(this.session.ended)throw new Error("Session has ended");if(t.layout===Mf.default)throw new TypeError("Media Equirect layer cannot be created with layout of default");if(!_f(t.space))throw new Error("Media Equirect layer's space must be of type XRReferenceSpace");let i=new Df(t,e);return i.needsRedraw=!1,i.initialize(this.session),i}calculateAspectRatio(e,t){let i=e.videoWidth,n=e.videoHeight;return t===Mf["stereo-left-right"]&&(i/=2),t===Mf["stereo-top-bottom"]&&(n/=2),i/n}}const Uf={textureType:Tf.texture,colorFormat:6408,depthFormat:6402,scaleFactor:1};class Vf extends kf{constructor(e=Uf){super(),this.init=Object.assign(Object.assign({},Uf),e)}initialize(e,t){super.initialize(e,t),this.initializeIfNeeded();let i=e.getBaseLayer();this.textureWidth=i.framebufferWidth*this.init.scaleFactor,this.textureHeight=i.framebufferHeight*this.init.scaleFactor}_allocateProjectionColorTextures(){let e=[],t=[];const i=()=>{e=[];for(let i of t)e.push(i.texture)};let n=this.session,r=n.internalViews;if(!r||0===r.length)return;let s=n.getBaseLayer(),o=r.length,a=s.framebufferWidth*this.init.scaleFactor/r.length,l=s.framebufferHeight*this.init.scaleFactor;if(this.layout===Mf.mono||this.layout===Mf.default){if(this.init.textureType===Tf["texture-array"]){let e=this._createNewColorTexture(a,l,Tf["texture-array"],this.init.colorFormat,o);t=[e]}else for(let e of r){let e=this._createNewColorTexture(a,l,Tf.texture,this.init.colorFormat);t.push(e)}return i(),this._colorTexturesMeta=t,void(this._colorTextures=e)}if(this.layout===Mf["stereo-left-right"]){let e=this._createNewColorTexture(a*o,l,this.init.textureType,this.init.colorFormat);t=[e]}else if(this.layout===Mf["stereo-top-bottom"]){let e=this._createNewColorTexture(a,l*o,this.init.textureType,this.init.colorFormat);t=[e]}i(),this._colorTexturesMeta=t,this._colorTextures=e}_allocateProjectionDepthStencilTextures(){let e=this.session,t=e.internalViews;if(!t||0===t.length)return;if(0===this.init.depthFormat)return void(this._depthStencilTextures=[]);if(this.context instanceof WebGLRenderingContext){if(!this.context.getExtension("WEBGL_depth_texture"))return void(this._depthStencilTextures=[])}let i=[],n=[];const r=()=>{i=[];for(let e of n)i.push(e.texture)};this.initializeIfNeeded();let s=e.getBaseLayer(),o=t.length,a=s.framebufferWidth*this.init.scaleFactor/t.length,l=s.framebufferHeight*this.init.scaleFactor;if(this.layout===Mf.mono||this.layout===Mf.default){if(this.init.textureType===Tf["texture-array"]){let e=this._createNewDepthStencilTexture(a,l,this.init.textureType,this.init.depthFormat,o);n=[e]}else for(let e of t){let e=this._createNewDepthStencilTexture(a,l,this.init.textureType,this.init.depthFormat);n.push(e)}return r(),void(this._depthStencilTextures=i)}if(this.layout===Mf["stereo-left-right"]){let e=this._createNewDepthStencilTexture(a*o,l,this.init.textureType,this.init.depthFormat);n=[e]}else if(this.layout===Mf["stereo-top-bottom"]){let e=this._createNewDepthStencilTexture(a,l*o,this.init.textureType,this.init.depthFormat);n=[e]}r(),this._depthStencilTextures=i}get colorTextures(){return this._colorTextures&&this._colorTextures.length||this._allocateProjectionColorTextures(),this._colorTextures}get depthStencilTextures(){return void 0===this._depthStencilTextures&&this._allocateProjectionDepthStencilTextures(),this._depthStencilTextures||[]}get colorTexturesMeta(){return this._colorTextures&&this._colorTextures.length||this._allocateProjectionColorTextures(),this._colorTexturesMeta}getTextureType(){return this.init.textureType}_deferredInitialize(){this.isStatic=!1,this.ignoreDepthValues=!1,this.fixedFoveation=0;let e=this.determineLayoutAttribute(this.init.textureType,this.context,Mf.default);this.layout=e,this.needsRedraw=!0;let t=this.determineMaximumScaleFactor(),i=Math.min(this.init.scaleFactor,t);this.init.scaleFactor=i}determineMaximumScaleFactor(){let e=this.session.getBaseLayer(this.context),t=e.framebufferWidth,i=e.framebufferHeight;this.layout===Mf["stereo-left-right"]&&(t*=2),this.layout===Mf["stereo-top-bottom"]&&(i*=2);let n=Math.max(t,i);return this.context.getParameter(this.context.MAX_TEXTURE_SIZE)/n}}const Gf=(e,t,i,n,r)=>{let s=0,o=0,a=t.width,l=t.height;i===Mf["stereo-left-right"]?(s=t.width*n/r,a=t.width/r):i===Mf["stereo-top-bottom"]&&(o=t.height*n/r,l=t.height/r),e.x=s,e.y=o,e.
421width=a,e.height=l},Wf=(e,t,i)=>{var n=e.createShader(i);if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw"could not compile shader:"+e.getShaderInfoLog(n);return n},$f=(e,t,i)=>{const n=e.createProgram(),r=Wf(e,t,e.VERTEX_SHADER),s=Wf(e,i,e.FRAGMENT_SHADER);if(e.attachShader(n,r),e.attachShader(n,s),e.deleteShader(r),e.deleteShader(s),e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS))throw"program failed to link:"+e.getProgramInfoLog(n);return n},qf=e=>{if(e instanceof WebGL2RenderingContext)return e;const t=e.getExtension("OES_vertex_array_object");if(!t)throw new Error("Cannot use VAOs.");return{VERTEX_ARRAY_BINDING:t.VERTEX_ARRAY_BINDING_OES,bindVertexArray:t.bindVertexArrayOES.bind(t),createVertexArray:t.createVertexArrayOES.bind(t),deleteVertexArray:t.deleteVertexArrayOES.bind(t),isVertexArray:t.isVertexArrayOES.bind(t)}},Xf=e=>e,Hf=Xf`
422attribute vec2 a_position;
423attribute vec2 a_texCoord;
424
425varying vec2 v_texCoord;
426
427void main() {
428   // convert the rectangle from pixels to 0.0 to 1.0
429   vec2 zeroToOne = a_position;
430
431   // convert from 0->1 to 0->2
432   vec2 zeroToTwo = zeroToOne * 2.0;
433
434   // convert from 0->2 to -1->+1 (clipspace)
435   vec2 clipSpace = zeroToTwo - 1.0;
436
437   gl_Position = vec4(clipSpace * vec2(1, 1), 0, 1);
438
439   // pass the texCoord to the fragment shader
440   // The GPU will interpolate this value between points.
441   v_texCoord = a_texCoord;
442}
443`,Zf=Xf`
444precision mediump float;
445
446// our texture
447uniform sampler2D u_image;
448
449// the texCoords passed in from the vertex shader.
450varying vec2 v_texCoord;
451
452void main() {
453   	vec4 tex = texture2D(u_image, v_texCoord);
454	gl_FragColor = vec4(tex.rgb, tex.a);
455}
456`;class Yf{constructor(e,t){this.gl=t,this.layer=e,this.program=$f(this.gl,Hf,Zf),this.programInfo={attribLocations:{a_position:this.gl.getAttribLocation(this.program,"a_position"),a_texCoord:this.gl.getAttribLocation(this.program,"a_texCoord")}},this._createVAOs()}render(e){let t=this.gl,i=e.getBaseLayer();t.viewport(0,0,i.framebufferWidth,i.framebufferHeight);const n=this.layer.getTextureType(),r=t.getParameter(t.TEXTURE_BINDING_2D),s=t.getParameter(t.ACTIVE_TEXTURE);if(n!==Tf.texture)throw new Error("Created a texture projection renderer instead of a texture-array projection renderer for a texture-array layer.\nThis is probably an error with the polyfill itself; please file an issue on Github if you run into this.");t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.layer.colorTextures[0]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let o of e.internalViews){let e=i.getViewport(o);t.viewport(e.x,e.y,e.width,e.height),this._shouldUseStereoTexturePoints()?this._renderInternalStereo(o):this._renderInternal()}t.activeTexture(s),t.bindTexture(t.TEXTURE_2D,r)}_renderInternal(){let e=this.gl;const t=e.getParameter(e.CURRENT_PROGRAM);e.useProgram(this.program),this.vaoGl.bindVertexArray(this.vao);var i=e.TRIANGLES;e.drawArrays(i,0,6),this.vaoGl.bindVertexArray(null),e.useProgram(t)}_renderInternalStereo(e){if("none"===e.eye)return this._renderInternal();let t=this.gl;this.vaoGl.bindVertexArray(this.vao);const i=t.getParameter(t.CURRENT_PROGRAM);t.useProgram(this.program),this._setStereoTextureBuffer("right"===e.eye?1:0);var n=t.TRIANGLES;t.drawArrays(n,0,6),this.vaoGl.bindVertexArray(null),t.useProgram(i)}_createVAOs(){this._createTextureUVs();let e=this.gl;this.vaoGl=qf(e);let t=e.createBuffer();this.vao=this.vaoGl.createVertexArray(),this.vaoGl.bindVertexArray(this.vao),e.enableVertexAttribArray(this.programInfo.attribLocations.a_position),e.bindBuffer(e.ARRAY_BUFFER,t),((e,t,i,n,r)=>{var s=t,o=t+n,a=i,l=i+r;e.bufferData(e.ARRAY_BUFFER,new Float32Array([s,a,o,a,s,l,s,l,o,a,o,l]),e.DYNAMIC_DRAW)})(e,0,0,1,1);let i=e.FLOAT,n=!1;e.vertexAttribPointer(this.programInfo.attribLocations.a_position,2,i,n,0,0),this.texcoordBuffer=e.createBuffer(),e.enableVertexAttribArray(this.programInfo.attribLocations.a_texCoord),e.bindBuffer(e.ARRAY_BUFFER,this.texcoordBuffer),e.bufferData(e.ARRAY_BUFFER,this.texturePoints,e.DYNAMIC_DRAW),e.vertexAttribPointer(this.programInfo.attribLocations.a_texCoord,2,i,n,0,0),this.vaoGl.bindVertexArray(null),e.bindBuffer(e.ARRAY_BUFFER,null)}_setStereoTextureBuffer(e){let t=this.gl;t.enableVertexAttribArray(this.programInfo.attribLocations.a_texCoord),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),t.bufferData(t.ARRAY_BUFFER,this.stereoTexturePoints[e],t.STATIC_DRAW);var i=t.FLOAT;t.vertexAttribPointer(this.programInfo.attribLocations.a_texCoord,2,i,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,null)}_createTextureUVs(){this.texturePoints=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);const e={x:0,y:0,width:1,height:1};this._shouldUseStereoTexturePoints()&&(this.stereoTexturePoints=[],Gf(e,this.layer.colorTexturesMeta[0],this.layer.layout,0,2),this.stereoTexturePoints[0]=this._offsetTextureUVsByRect(this.layer.colorTexturesMeta[0],this.texturePoints,e),Gf(e,this.layer.colorTexturesMeta[0],this.layer.layout,1,2),this.stereoTexturePoints[1]=this._offsetTextureUVsByRect(this.layer.colorTexturesMeta[0],this.texturePoints,e))}_offsetTextureUVsByRect(e,t,i){const n=(i=null!=i?i:{x:0,y:0,width:e.width,height:e.height}
456).x/e.width,r=i.y/e.height,s=i.width/e.width,o=i.height/e.height,a=[];for(let l=0;l<t.length;l+=2){let e=t[l]*s+n,i=t[l+1]*o+r;a[l]=e,a[l+1]=i}return new Float32Array(a)}_shouldUseStereoTexturePoints(){return this.layer.layout===Mf["stereo-left-right"]||this.layer.layout===Mf["stereo-top-bottom"]}}const Qf=Xf`#version 300 es
457
458in vec2 a_position;
459in vec2 a_texCoord;
460
461out vec2 v_texCoord;
462
463void main() {
464	// convert the rectangle from pixels to 0.0 to 1.0
465	vec2 zeroToOne = a_position;
466
467	// convert from 0->1 to 0->2
468	vec2 zeroToTwo = zeroToOne * 2.0;
469
470	// convert from 0->2 to -1->+1 (clipspace)
471	vec2 clipSpace = zeroToTwo - 1.0;
472
473	gl_Position = vec4(clipSpace * vec2(1, 1), 0, 1);
474
475	// pass the texCoord to the fragment shader
476	// The GPU will interpolate this value between points.
477	v_texCoord = a_texCoord;
478}
479`,Kf=Xf`#version 300 es
480precision mediump float;
481precision mediump int;
482precision mediump sampler2DArray;
483
484uniform sampler2DArray u_image;
485uniform int u_layer;
486
487in vec2 v_texCoord;
488
489out vec4 fragColor;
490
491void main() {
492	vec4 tex = texture(u_image, vec3(v_texCoord.x, v_texCoord.y, u_layer));
493 	fragColor = vec4(tex.rgb, tex.a);
494}
495
496`;class Jf extends Yf{constructor(e,t){super(e,t),this.program=$f(this.gl,Qf,Kf),this._createVAOs(),this.u_layerInfo=this.gl.getUniformLocation(this.program,"u_layer")}render(e){let t=this.gl;if(this.layer.getTextureType()===Tf.texture)throw new Error("Using texture array projection renderer on a layer without texture array.");let i=e.getBaseLayer();const n=t.getParameter(t.TEXTURE_BINDING_2D_ARRAY);t.bindTexture(t.TEXTURE_2D_ARRAY,this.layer.colorTextures[0]),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D_ARRAY,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let r of e.internalViews){let n=e.getViewIndex(r),s=i.getViewport(r);t.viewport(s.x,s.y,s.width,s.height),this._renderInternal(n)}t.bindTexture(t.TEXTURE_2D_ARRAY,n)}_renderInternal(e=0){let t=this.gl;const i=t.getParameter(t.CURRENT_PROGRAM);t.useProgram(this.program),t.bindVertexArray(this.vao),t.uniform1i(this.u_layerInfo,e);var n=t.TRIANGLES;t.drawArrays(n,0,6),t.bindVertexArray(null),t.useProgram(i)}}const ep=(e,t)=>e.getTextureType()===Tf["texture-array"]&&t instanceof WebGL2RenderingContext?new Jf(e,t):new Yf(e,t);var tp="undefined"!=typeof Float32Array?Float32Array:Array;function ip(){var e=new tp(16);return tp!=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 np(e,t,i){var n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],x=t[14],v=t[15],y=i[0],w=i[1],b=i[2],E=i[3];return e[0]=y*n+w*a+b*u+E*m,e[1]=y*r+w*l+b*d+E*g,e[2]=y*s+w*c+b*f+E*x,e[3]=y*o+w*h+b*p+E*v,y=i[4],w=i[5],b=i[6],E=i[7],e[4]=y*n+w*a+b*u+E*m,e[5]=y*r+w*l+b*d+E*g,e[6]=y*s+w*c+b*f+E*x,e[7]=y*o+w*h+b*p+E*v,y=i[8],w=i[9],b=i[10],E=i[11],e[8]=y*n+w*a+b*u+E*m,e[9]=y*r+w*l+b*d+E*g,e[10]=y*s+w*c+b*f+E*x,e[11]=y*o+w*h+b*p+E*v,y=i[12],w=i[13],b=i[14],E=i[15],e[12]=y*n+w*a+b*u+E*m,e[13]=y*r+w*l+b*d+E*g,e[14]=y*s+w*c+b*f+E*x,e[15]=y*o+w*h+b*p+E*v,e}function rp(e,t){var i=t[0],n=t[1],r=t[2],s=t[3],o=i+i,a=n+n,l=r+r,c=i*o,h=n*o,u=n*a,d=r*o,f=r*a,p=r*l,m=s*o,g=s*a,x=s*l;return e[0]=1-u-p,e[1]=h+x,e[2]=d-g,e[3]=0,e[4]=h-x,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-c-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sp(){var e=new tp(2);return tp!=Float32Array&&(e[0]=0,e[1]=0),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),function(){var e=sp()}();const op=e=>e,ap=op`
497attribute vec4 a_position;
498attribute vec2 a_texCoord;
499
500uniform mat4 u_matrix;
501uniform mat4 u_projectionMatrix;
502
503varying vec2 v_texCoord;
504
505void main() {
506  // Multiply the position by the matrix.
507  gl_Position = u_projectionMatrix * u_matrix * a_position;
508
509   // pass the texCoord to the fragment shader
510   // The GPU will interpolate this value between points.
511   v_texCoord = a_texCoord;
512}
513`,lp=op`
514precision mediump float;
515
516// our texture
517uniform sampler2D u_image;
518
519// the texCoords passed in from the vertex shader.
520varying vec2 v_texCoord;
521
522void main() {
523   	vec4 tex = texture2D(u_image, v_texCoord);
524	gl_FragColor = vec4(tex.rgb, tex.a);
525	// gl_FragColor = vec4(1.0, 0, 0, 1.0);
526}
527`,cp=op`#version 300 es
528
529in vec4 a_position;
530in vec2 a_texCoord;
531
532uniform mat4 u_matrix;
533uniform mat4 u_projectionMatrix;
534
535out vec2 v_texCoord;
536
537void main() {
538	// Multiply the position by the matrix.
539    gl_Position = u_projectionMatrix * u_matrix * a_position;
540
541	// pass the texCoord to the fragment shader
542	// The GPU will interpolate this value between points.
543	v_texCoord = a_texCoord;
544}
545`,hp=op`#version 300 es
546precision mediump float;
547precision mediump int;
548precision mediump sampler2DArray;
549
550uniform sampler2DArray u_image;
551uniform int u_layer;
552
553in vec2 v_texCoord;
554
555out vec4 fragColor;
556
557void main() {
558	vec4 tex = texture(u_image, vec3(v_texCoord.x, v_texCoord.y, u_layer));
559 	fragColor = vec4(tex.rgb, tex.a);
560}
561
562`;class up{constructor(e,t){this.usesTextureArrayShaders=!1,this.savedVaoState={vao:null,arrayBuffer:null},this.hasMipmap=!1,this.gl=t,this.layer=e;let i=this.gl;this.transformMatrix=ip(),t instanceof WebGL2RenderingContext&&this.layer.getTextureType()===Tf["texture-array"]&&(this.usesTextureArrayShaders=!0),this.usesTextureArrayShaders?this.program=$f(i,cp,hp):this.program=$f(i,ap,lp),this.programInfo={attribLocations:{a_position:i.getAttribLocation(this.program,"a_position"),a_texCoord:i.getAttribLocation(this.program,"a_texCoord")},uniformLocations:{u_matrix:i.getUniformLocation(this.program,"u_matrix"),u_projectionMatrix:i.getUniformLocation(this.program,"u_projectionMatrix")}},this.usesTextureArrayShaders&&(this.programInfo.uniformLocations.u_layer=i.getUniformLocation(this.program,"u_layer"))}saveVaoState(){this.savedVaoState.vao=this.gl.getParameter(this.vaoGl.VERTEX_ARRAY_BINDING),this.savedVaoState.arrayBuffer=this.gl.getParameter(this.gl.ARRAY_BUFFER_BINDING)}
562restoreVaoState(){this.vaoGl.bindVertexArray(this.savedVaoState.vao),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.savedVaoState.arrayBuffer),this.savedVaoState.vao=this.savedVaoState.arrayBuffer=null}initialize(){let e=this.gl;if(this.layer.isMediaLayer()){this.mediaTexture=e.createTexture(),this.mediaTexturePolyfill={texture:this.mediaTexture,textureFormat:e.RGBA,width:this.layer.media.videoWidth,height:this.layer.media.videoHeight,type:Tf.texture};const t=e.getParameter(e.TEXTURE_BINDING_2D);e.bindTexture(e.TEXTURE_2D,this.mediaTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.layer.media.videoWidth,this.layer.media.videoHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),e.bindTexture(e.TEXTURE_2D,t)}this._createVAOs()}render(e,t){this.saveVaoState();let i=this.gl,n=e.getBaseLayer(),r=t.getViewerPose(e.getReferenceSpace());const s=i.getParameter(i.ACTIVE_TEXTURE);for(let o of r.views){let r=n.getViewport(o);if(i.viewport(r.x,r.y,r.width,r.height),i.activeTexture(i.TEXTURE0),this.usesTextureArrayShaders){if(i instanceof WebGLRenderingContext)throw new Error("This should never happen; texture-arrays only supported on WebGL2.");if(this.layer.isMediaLayer())throw new Error("This should never happen. Media layers should never be created with texture-array");const n=i.getParameter(i.TEXTURE_BINDING_2D_ARRAY);i.bindTexture(i.TEXTURE_2D_ARRAY,this.layer.colorTextures[0]),this.layer.isStatic?(!0===this.layer.needsRedraw&&i.generateMipmap(i.TEXTURE_2D_ARRAY),this.hasMipmap=!0):this.hasMipmap=this.layer.mipLevels>0,i.texParameteri(i.TEXTURE_2D_ARRAY,i.TEXTURE_MAG_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_2D_ARRAY,i.TEXTURE_MIN_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR);let r=0;if(this.layer.layout===Mf.stereo&&"right"===o.eye)r=1;this._shouldUseStereoTexturePoints()?this._renderInternalStereo(e,t,o,r):this._renderInternal(e,t,o,r),i.activeTexture(s),i.bindTexture(i.TEXTURE_2D_ARRAY,n)}else{const n=i.getParameter(i.TEXTURE_BINDING_2D);if(this.layer.isMediaLayer())i.bindTexture(i.TEXTURE_2D,this.mediaTexture),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texSubImage2D(i.TEXTURE_2D,0,0,0,this.layer.media.videoWidth,this.layer.media.videoHeight,i.RGBA,i.UNSIGNED_BYTE,this.layer.media);else if(this.layer.layout===Mf.stereo)if("right"===o.eye)i.bindTexture(i.TEXTURE_2D,this.layer.colorTextures[1]);else i.bindTexture(i.TEXTURE_2D,this.layer.colorTextures[0]);else i.bindTexture(i.TEXTURE_2D,this.layer.colorTextures[0]);this.layer.isStatic?(!0===this.layer.needsRedraw&&i.generateMipmap(i.TEXTURE_2D),this.hasMipmap=!0):this.hasMipmap=this.layer.mipLevels>0,i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),this._shouldUseStereoTexturePoints()?this._renderInternalStereo(e,t,o):this._renderInternal(e,t,o),i.activeTexture(s),i.bindTexture(i.TEXTURE_2D,n)}}this.restoreVaoState()}createPositionPoints(){return new Float32Array([])}createTextureUVs(){return new Float32Array([])}_offsetTextureUVsByRect(e,t,i){const n=(i=null!=i?i:{x:0,y:0,width:e.width,height:e.height}).x/e.width,r=i.y/e.height,s=i.width/e.width,o=i.height/e.height,a=[];for(let l=0;l<t.length;l+=2){let e=t[l]*s+n,i=t[l+1]*o+r;a[l]=e,a[l+1]=i}return new Float32Array(a)}_shouldUseStereoTexturePoints(){return this.layer.layout===Mf["stereo-left-right"]||this.layer.layout===Mf["stereo-top-bottom"]}_setStereoTextureBuffer(e){let t=this.gl;t.enableVertexAttribArray(this.programInfo.attribLocations.a_texCoord),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),t.bufferData(t.ARRAY_BUFFER,this.stereoTexturePoints[e],t.STATIC_DRAW);var i=t.FLOAT;t.vertexAttribPointer(this.programInfo.attribLocations.a_texCoord,2,i,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,null)}_recalculateVertices(){this.positionPoints=this.createPositionPoints(),this.texturePoints=this.createTextureUVs();const e={x:0,y:0,width:1,height:1};if(this._shouldUseStereoTexturePoints()){if(this.stereoTexturePoints=[],this.layer.isMediaLayer())return Gf(e,this.mediaTexturePolyfill,this.layer.layout,0,2),this.stereoTexturePoints[0]=this._offsetTextureUVsByRect(this.mediaTexturePolyfill,this.texturePoints,e),Gf(e,this.mediaTexturePolyfill,this.layer.layout,1,2),this.stereoTexturePoints[1]=this._offsetTextureUVsByRect(this.mediaTexturePolyfill,this.texturePoints,e),void(this.layer.layout===Mf["stereo-top-bottom"]&&([this.stereoTexturePoints[0],this.stereoTexturePoints[1]]=[this.stereoTexturePoints[1],this.stereoTexturePoints[0]]));Gf(e,this.layer.colorTexturesMeta[0],this.layer.layout,0,2),this.stereoTexturePoints[0]=this._offsetTextureUVsByRect(this.layer.colorTexturesMeta[0],this.texturePoints,e),Gf(e,this.layer.colorTexturesMeta[0],this.layer.layout,1,2),this.stereoTexturePoints[1]=this._offsetTextureUVsByRect(this.layer.colorTexturesMeta[0],this.texturePoints,e),this.layer.layout===Mf["stereo-top-bottom"]&&([this.stereoTexturePoints[0],this.stereoTexturePoints[1]]=[this.stereoTexturePoints[1],this.stereoTexturePoints[0]])}}_createVAOs(){this._recalculateVertices();let e=this.gl;this.vaoGl=qf(e),this.saveVaoState();let t=e.createBuffer();this.vao=this.vaoGl.createVertexArray(),this.vaoGl.bindVertexArray(this.vao),e.enableVertexAttribArray(this.programInfo.attribLocations.a_position),e.bindBuffer(e.ARRAY_BUFFER,t);const i=this.positionPoints;e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW);
562var n=3,r=e.FLOAT,s=!1,o=0,a=0;e.vertexAttribPointer(this.programInfo.attribLocations.a_position,n,r,s,o,a),e.enableVertexAttribArray(this.programInfo.attribLocations.a_texCoord),this.texcoordBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.texcoordBuffer),e.bufferData(e.ARRAY_BUFFER,this.texturePoints,e.STATIC_DRAW);n=2,r=e.FLOAT,s=!1,o=0,a=0;e.vertexAttribPointer(this.programInfo.attribLocations.a_texCoord,n,r,s,o,a),this.restoreVaoState()}_renderInternal(e,t,i,n){let r=this.gl;const s=r.getParameter(r.CURRENT_PROGRAM);r.useProgram(this.program),this.vaoGl.bindVertexArray(this.vao),this.usesTextureArrayShaders&&r.uniform1i(this.programInfo.uniformLocations.u_layer,n),this._setTransformMatrix(e,t,i),r.uniformMatrix4fv(this.programInfo.uniformLocations.u_matrix,!1,this.transformMatrix),r.uniformMatrix4fv(this.programInfo.uniformLocations.u_projectionMatrix,!1,i.projectionMatrix);var o=r.TRIANGLES,a=this.positionPoints.length/3;r.drawArrays(o,0,a),this.vaoGl.bindVertexArray(null),r.useProgram(s)}_renderInternalStereo(e,t,i,n){if("none"===i.eye)return this._renderInternal(e,t,i);let r=this.gl;this.vaoGl.bindVertexArray(this.vao);const s=r.getParameter(r.CURRENT_PROGRAM);r.useProgram(this.program),this._setStereoTextureBuffer("right"===i.eye?1:0),this.usesTextureArrayShaders&&r.uniform1i(this.programInfo.uniformLocations.u_layer,n),this._setTransformMatrix(e,t,i),r.uniformMatrix4fv(this.programInfo.uniformLocations.u_matrix,!1,this.transformMatrix),r.uniformMatrix4fv(this.programInfo.uniformLocations.u_projectionMatrix,!1,i.projectionMatrix);var o=r.TRIANGLES,a=this.positionPoints.length/3;r.drawArrays(o,0,a),this.vaoGl.bindVertexArray(null),r.useProgram(s)}_setTransformMatrix(e,t,i){let n=t.getPose(this.layer.space,e.getReferenceSpace());np(this.transformMatrix,n.transform.matrix,this.layer.transform.matrix),np(this.transformMatrix,i.transform.inverse.matrix,this.transformMatrix)}}class dp extends up{constructor(e,t){super(e,t),this.initialize()}createPositionPoints(){const e=this.layer.width,t=this.layer.height;return new Float32Array([-e,-t,0,e,-t,0,-e,t,0,-e,t,0,e,-t,0,e,t,0])}createTextureUVs(){return new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])}}class fp extends up{constructor(e,t){super(e,t),this.segments=16,this.initialize()}createPositionPoints(){const e=[],t=this.layer.centralAngle,i=this.layer.height,n=this.layer.radius,r=t/this.segments,s=Math.PI/2-t/2,o=[],a=sp();a[0]=n*Math.cos(s),a[1]=-n*Math.sin(s),o.push(a);for(let l=0;l<this.segments;l++){const e=sp();e[0]=n*Math.cos(s+r*(l+1)),e[1]=-n*Math.sin(s+r*(l+1)),o.push(e)}o.reverse();for(let l=0;l<this.segments;l++){const t=o[l],n=o[l+1];e.push(t[0],-i/2,t[1]),e.push(n[0],-i/2,n[1]),e.push(t[0],i/2,t[1]),e.push(t[0],i/2,t[1]),e.push(n[0],-i/2,n[1]),e.push(n[0],i/2,n[1])}return new Float32Array(e)}createTextureUVs(){let e=[];const t=1/this.segments;for(let i=0;i<this.segments;i++){let n=t*i,r=t*(i+1);e.push(n,0),e.push(r,0),e.push(n,1),e.push(n,1),e.push(r,0),e.push(r,1)}return new Float32Array(e)}}class pp extends up{constructor(e,t){super(e,t),this.segmentsPerAxis=40,this.initialize()}createPositionPoints(){const e=[];let t=this.layer.radius;0===t&&(t=25),t>25&&(t=25);const i=this.layer.centralHorizontalAngle,n=this.layer.upperVerticalAngle+Math.PI/2,r=this.layer.lowerVerticalAngle+Math.PI/2,s=Math.PI/2-i/2,o=s+i,a=r-n,l=o-s,c=[];for(let u=0;u<=this.segmentsPerAxis;u++)for(let e=0;e<=this.segmentsPerAxis;e++){let i=t,r=o-l*(e/this.segmentsPerAxis),s=a*(u/this.segmentsPerAxis)+n;const h=Math.cos(r)*Math.sin(s),d=Math.cos(s),f=-Math.sin(r)*Math.sin(s);c.push([i*h,i*d,i*f])}const h=this.segmentsPerAxis+1;for(let u=0;u<this.segmentsPerAxis;u++)for(let t=0;t<this.segmentsPerAxis;t++)e.push(...c[t*h+u]),e.push(...c[t*h+u+1]),e.push(...c[(t+1)*h+u]),e.push(...c[(t+1)*h+u]),e.push(...c[t*h+u+1]),e.push(...c[(t+1)*h+u+1]);return new Float32Array(e)}createTextureUVs(){const e=[],t=[];for(let n=0;n<=this.segmentsPerAxis;n++)for(let e=0;e<=this.segmentsPerAxis;e++){const i=e/this.segmentsPerAxis,r=n/this.segmentsPerAxis;t.push([i,r])}const i=this.segmentsPerAxis+1;for(let n=0;n<this.segmentsPerAxis;n++)for(let r=0;r<this.segmentsPerAxis;r++)e.push(...t[r*i+n]),e.push(...t[r*i+n+1]),e.push(...t[(r+1)*i+n]),e.push(...t[(r+1)*i+n]),e.push(...t[r*i+n+1]),e.push(...t[(r+1)*i+n+1]);return new Float32Array(e)}}const mp={colorFormat:6408,mipLevels:1,layout:Mf.mono,isStatic:!1,space:null,viewPixelHeight:0,viewPixelWidth:0};class gp extends kf{constructor(e=mp){if(super(),!_f(e.space))throw new TypeError("XRCubeLayer's space needs to be an XRReferenceSpace");switch(this.init=Object.assign(Object.assign({},mp),e),this.space=this.init.space,this.isStatic=this.init.isStatic,this.init.orientation?this.orientation=DOMPointReadOnly.fromPoint(this.init.orientation):this.orientation=new DOMPointReadOnly,this.init.layout){case Mf.default:case Mf["stereo-left-right"]:case Mf["stereo-top-bottom"]:throw new TypeError("Invalid layout format for XRCubeLayer")}this.layout=this.init.layout,this.needsRedraw=!0}initialize(e,t){super.initialize(e,t),this._allocateColorTexturesInternal(),this._allocateDepthStencilTexturesInternal()}_allocateColorTexturesInternal(){if(this._colorTextures=[],this._texturesMeta=[],this.layout===Mf.mono){const e=this._createCubeColorTexture();return this._texturesMeta.push(e),void this._colorTextures.push(e.texture)}{const e=this._createCubeColorTexture(),t=this._createCubeColorTexture();return this._texturesMeta.push(e,t),void this._colorTextures.push(e.texture,t.texture)}}_allocateDepthStencilTexturesInternal(){if(this._depthStencilTextures=[],this.init.depthFormat){if(this.context instanceof WebGLRenderingContext){if(!this.context.getExtension("WEBGL_depth_texture"))throw new TypeError("Depth textures not supported in the current context")}if(this.layout!==Mf.mono){const e=this._createCubeDepthTexture(),t=this._createCubeDepthTexture();return void this._depthStencilTextures.push(e.texture,t.texture)}{const e=this._createCubeDepthTexture();this._depthStencilTextures.push(e.texture)}}}_createCubeColorTexture(){let e=this.context.createTexture(),t={width:this.init.viewPixelWidth,height:this.init.viewPixelHeight,layers:1,t
562ype:Tf.texture,textureFormat:this.init.colorFormat,texture:e};const i=this.context.getParameter(this.context.TEXTURE_BINDING_CUBE_MAP);this.context.bindTexture(this.context.TEXTURE_CUBE_MAP,e);for(let n=0;n<6;n++)this.context.texImage2D(this.context.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t.textureFormat,t.width,t.height,0,t.textureFormat,this.context.UNSIGNED_BYTE,null);return this.context.bindTexture(this.context.TEXTURE_CUBE_MAP,i),t}_createCubeDepthTexture(){let e=this.context.createTexture(),t={width:this.init.viewPixelWidth,height:this.init.viewPixelHeight,layers:1,type:Tf.texture,textureFormat:this.init.depthFormat,texture:e};const i=this.context.getParameter(this.context.TEXTURE_BINDING_CUBE_MAP);this.context.bindTexture(this.context.TEXTURE_CUBE_MAP,e);let n=this.init.depthFormat;this.context instanceof WebGL2RenderingContext&&(n===this.context.DEPTH_COMPONENT&&(n=this.context.DEPTH_COMPONENT24),n===this.context.DEPTH_STENCIL&&(n=this.context.DEPTH24_STENCIL8));for(let r=0;r<6;r++)this.context.texImage2D(this.context.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,n,t.width,t.height,0,t.textureFormat,this.context.UNSIGNED_INT,null);return this.context.bindTexture(this.context.TEXTURE_CUBE_MAP,i),t}getTextureType(){return Tf.texture}}const xp=e=>e,vp=xp`
563attribute vec4 a_position;
564uniform mat4 u_projectionMatrix;
565uniform mat4 u_matrix;
566varying vec3 v_normal;
567
568void main() {
569   gl_Position = u_projectionMatrix * u_matrix * a_position;
570
571   v_normal = normalize(a_position.xyz);
572}
573`,yp=xp`
574precision mediump float;
575
576varying vec3 v_normal;
577
578uniform samplerCube u_texture;
579
580void main() {
581   gl_FragColor = textureCube(u_texture, normalize(v_normal));
582}
583`;class wp{constructor(e,t){this.savedVaoState={vao:null,arrayBuffer:null},this.hasMipmap=!1,this.layer=e,this.gl=t,this.transformMatrix=ip(),this.program=$f(t,vp,yp),this.programInfo={attribLocations:{a_position:t.getAttribLocation(this.program,"a_position")},uniformLocations:{u_matrix:t.getUniformLocation(this.program,"u_matrix"),u_texture:t.getUniformLocation(this.program,"u_texture"),u_projectionMatrix:t.getUniformLocation(this.program,"u_projectionMatrix")}},this._createVAOs()}saveVaoState(){this.savedVaoState.vao=this.gl.getParameter(this.vaoGl.VERTEX_ARRAY_BINDING),this.savedVaoState.arrayBuffer=this.gl.getParameter(this.gl.ARRAY_BUFFER_BINDING)}restoreVaoState(){this.vaoGl.bindVertexArray(this.savedVaoState.vao),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.savedVaoState.arrayBuffer),this.savedVaoState.vao=this.savedVaoState.arrayBuffer=null}render(e,t){this.saveVaoState();let i=this.gl,n=e.getBaseLayer(),r=t.getViewerPose(e.getReferenceSpace());const s=i.getParameter(i.ACTIVE_TEXTURE);for(let o of r.views){let e=n.getViewport(o);i.viewport(e.x,e.y,e.width,e.height),i.activeTexture(i.TEXTURE0);const t=i.getParameter(i.TEXTURE_BINDING_CUBE_MAP);if(this.layer.layout===Mf.stereo){const e="right"===o.eye?1:0;i.bindTexture(i.TEXTURE_CUBE_MAP,this.layer.colorTextures[e])}else i.bindTexture(i.TEXTURE_CUBE_MAP,this.layer.colorTextures[0]);this.layer.isStatic?(!0===this.layer.needsRedraw&&i.generateMipmap(i.TEXTURE_CUBE_MAP),this.hasMipmap=!0):this.hasMipmap=this.layer.mipLevels>0,i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,this.hasMipmap?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),this._renderInternal(this.layer.orientation,o),i.activeTexture(s),i.bindTexture(i.TEXTURE_CUBE_MAP,t)}this.restoreVaoState()}createPositionPoints(){const e=.5;return new Float32Array([-e,-e,-e,-e,e,-e,e,-e,-e,-e,e,-e,e,e,-e,e,-e,-e,-e,-e,e,e,-e,e,-e,e,e,-e,e,e,e,-e,e,e,e,e,-e,e,-e,-e,e,e,e,e,-e,-e,e,e,e,e,e,e,e,-e,-e,-e,-e,e,-e,-e,-e,-e,e,-e,-e,e,e,-e,-e,e,-e,e,-e,-e,-e,-e,-e,e,-e,e,-e,-e,-e,e,-e,e,e,-e,e,-e,e,-e,-e,e,e,-e,e,-e,e,e,-e,e,e,e,-e,e,e,e])}_renderInternal(e,t){let i=this.gl;const n=i.getParameter(i.CURRENT_PROGRAM);i.useProgram(this.program),this.vaoGl.bindVertexArray(this.vao),rp(this.transformMatrix,[e.x,e.y,e.z,e.w]),this._poseOrientationMatrix||(this._poseOrientationMatrix=ip()),rp(this._poseOrientationMatrix,[t.transform.inverse.orientation.x,t.transform.inverse.orientation.y,t.transform.inverse.orientation.z,t.transform.inverse.orientation.w]),np(this.transformMatrix,this.transformMatrix,this._poseOrientationMatrix),i.uniformMatrix4fv(this.programInfo.uniformLocations.u_matrix,!1,this.transformMatrix),i.uniformMatrix4fv(this.programInfo.uniformLocations.u_projectionMatrix,!1,t.projectionMatrix),i.uniform1i(this.programInfo.uniformLocations.u_texture,0);var r=i.TRIANGLES,s=this.positionPoints.length/3;i.drawArrays(r,0,s),this.vaoGl.bindVertexArray(null),i.useProgram(n)}_recalculateVertices(){this.positionPoints=this.createPositionPoints()}_createVAOs(){this._recalculateVertices();let e=this.gl;this.vaoGl=qf(e),this.saveVaoState();let t=e.createBuffer();this.vao=this.vaoGl.createVertexArray(),this.vaoGl.bindVertexArray(this.vao),e.enableVertexAttribArray(this.programInfo.attribLocations.a_position),e.bindBuffer(e.ARRAY_BUFFER,t);const i=this.positionPoints;e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW);var n=e.FLOAT;e.vertexAttribPointer(this.programInfo.attribLocations.a_position,3,
583n,!1,0,0),this.restoreVaoState()}}class bp{constructor(){this.mode="inline",this.layers=[],this.views=[],this.initializedViews=!1,this.isPolyfillActive=!1,this.taskQueue=[]}requestAnimationFrame(e){this.injectedFrameCallback||(this.injectedFrameCallback=(t,i)=>{let n=this.context;if(!this.initializedViews&&this.referenceSpace){let e=i.getViewerPose(this.referenceSpace);e&&(this.views=e.views,this.initializedViews=!0)}if(this.isPolyfillActive&&this.initializedViews){this.tempFramebuffer||(this.tempFramebuffer=n.createFramebuffer()),n.bindFramebuffer(n.FRAMEBUFFER,this.tempFramebuffer);const e=n.getParameter(n.COLOR_CLEAR_VALUE),t=n.getParameter(n.FRAMEBUFFER_BINDING);n.clearColor(0,0,0,0);for(let i of this.layers)if(i instanceof Vf)for(let e=0;e<i.colorTextures.length;e++){i.colorTexturesMeta[e].type===Tf["texture-array"]||(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i.colorTextures[e],0),i.depthStencilTextures&&e<i.depthStencilTextures.length?n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,i.depthStencilTextures[e],0):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,null,0),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT))}n.bindFramebuffer(n.FRAMEBUFFER,t),n.clearColor(e[0],e[1],e[2],e[3])}if(e(t,i),this.isPolyfillActive&&this.initializedViews){let e=n.isEnabled(n.BLEND),t=n.isEnabled(n.DEPTH_TEST),r=n.isEnabled(n.CULL_FACE);const s=n.getParameter(n.FRAMEBUFFER_BINDING),o=n.getParameter(n.COLOR_CLEAR_VALUE);n.bindFramebuffer(n.FRAMEBUFFER,this.getBaseLayer().framebuffer),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.clearColor(o[0],o[1],o[2],o[3]),n.enable(n.BLEND),n.disable(n.DEPTH_TEST),n.disable(n.CULL_FACE);let a=n.getParameter(n.BLEND_SRC_RGB),l=n.getParameter(n.BLEND_SRC_ALPHA),c=n.getParameter(n.BLEND_DST_RGB),h=n.getParameter(n.BLEND_DST_ALPHA);n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);for(let u of this.layers)if(this.renderers||(this.renderers=new WeakMap),u instanceof Vf){this.renderers.has(u)||this.renderers.set(u,ep(u,this.context));this.renderers.get(u).render(this)}else if(u instanceof zf){this.renderers.has(u)||this.renderers.set(u,new dp(u,this.context));this.renderers.get(u).render(this,i)}else if(u instanceof If){this.renderers.has(u)||this.renderers.set(u,new fp(u,this.context));this.renderers.get(u).render(this,i)}else if(u instanceof Df){this.renderers.has(u)||this.renderers.set(u,new pp(u,this.context));this.renderers.get(u).render(this,i)}else if(u instanceof gp){this.renderers.has(u)||this.renderers.set(u,new wp(u,this.context));this.renderers.get(u).render(this,i)}else{const e=u;if(null===e.framebuffer)continue;n instanceof WebGL2RenderingContext&&(n.bindFramebuffer(n.READ_FRAMEBUFFER,e.framebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,this.getBaseLayer().framebuffer),n.blitFramebuffer(0,0,e.framebufferWidth,e.framebufferHeight,0,0,this.getBaseLayer().framebufferWidth,this.getBaseLayer().framebufferHeight,n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT,n.LINEAR))}for(e||n.disable(n.BLEND),t&&n.enable(n.DEPTH_TEST),r&&n.enable(n.CULL_FACE),n.blendFuncSeparate(a,c,l,h),n.bindFramebuffer(n.FRAMEBUFFER,s);this.taskQueue.length>0;){this.taskQueue.shift()()}}}),this._requestAnimationFrame(this.injectedFrameCallback)}updateRenderState(e){if(this.existingBaseLayer=e.baseLayer,e.layers&&(this.layers=e.layers),this.activeRenderState||this.createActiveRenderState(),this.activeRenderState=Object.assign(Object.assign({},this.activeRenderState),e),!e.layers)return void this._updateRenderState(e);let t,i=Object.assign({},e);delete i.layers;for(let n of this.layers)if(n instanceof kf){t=n.getContext();break}if(!t&&!this.context){let e=function(){t.canvas.width=t.canvas.clientWidth*window.devicePixelRatio,t.canvas.height=t.canvas.clientHeight*window.devicePixelRatio};const i=document.createElement("canvas");if(t=i.getContext("webgl2",{xrCompatible:!0}),t||(t=i.getContext("webgl",{xrCompatible:!0})),!t)throw new Error("No webGL support detected.");document.body.appendChild(t.canvas),window.addEventListener("resize",e),e()}this.createInternalLayer(t),this.isPolyfillActive=!0,this._updateRenderState(Object.assign(Object.assign({},i),{baseLayer:this.internalLayer}))}initializeSession(e){this.mode=e,this.requestReferenceSpace("local").then((e=>{this.referenceSpace=e})).catch((e=>{})),this.requestReferenceSpace("viewer").then((e=>{this.viewerSpace=e}))}getBaseLayer(e){return this.internalLayer||this.existingBaseLayer||!e||this.createInternalLayer(e),this.internalLayer||this.existingBaseLayer}getReferenceSpace(){return this.referenceSpace?this.referenceSpace:this.viewerSpace}getViewerSpace(){return this.viewerSpace}queueTask(e){this.taskQueue.push(e)}get renderState(){return this.activeRenderState||this.createActiveRenderState(),this.activeRenderState}get internalViews(){return this.views}getViewIndex(e){for(let t=0;t<this.views.length;t++){let i=this.views[t];if(e.eye===i.eye&&e.recommendedViewportScale===i.recommendedViewportScale)return t}return-1}createInternalLayer(e){if(!e&&this.internalLayer)return this.internalLayer;if(e===this.context&&this.internalLayer)return this.internalLayer;const t=Rf();return this.internalLayer=new t.XRWebGLLayer(this,e),this.setContext(e),this.internalLayer}setContext(e){this.context=e,this.tempFramebuffer=e.createFramebuffer(),this.renderers=new WeakMap}createActiveRenderState(){const e=Rf();let t=Object.getOwnPropertyNames(e.XRRenderState.prototype);const i={};for(let n of t)i[n]=this._renderState[n];i.layers=[],this.activeRenderState=i}}class Ep{constructor(){this.viewport={x:0,y:0,width:0,height:0}}}class Tp{constructor(e,t){this.session=e,this.context=t,this.subImageCache=new Sp}createProjectionLayer(e=Uf){const t=new Vf(e);
583if(this.session.ended)throw new Error("Session has ended");if(this.context.isContextLost())throw new Error("context is lost");return t.initialize(this.session,this.context),t}createQuadLayer(e=Ff){if(this.session.ended)throw new Error("Session has ended");if(this.context.isContextLost())throw new Error("context is lost");if(e.layout===Mf.default)throw new TypeError("Trying to create a quad layer with default layout");const t=new zf(e);return t.initialize(this.session,this.context),t}createCylinderLayer(e=Of){if(this.session.ended)throw new Error("Session has ended");if(this.context.isContextLost())throw new Error("context is lost");if(e.layout===Mf.default)throw new TypeError("Cylinder Layer cannot have a default layout");const t=new If(e);return t.initialize(this.session,this.context),t}createEquirectLayer(e=Cf){if(this.session.ended)throw new Error("Session has ended");if(this.context.isContextLost())throw new Error("context is lost");if(e.layout===Mf.default)throw new TypeError("Equirect Layer cannot have a default layout");if(!_f(e.space))throw new TypeError("Equirect layer requires an XRReferenceSpace");let t=new Df(e);return t.initialize(this.session,this.context),t}createCubeLayer(e){if(this.session.ended)throw new Error("Session has ended");if(this.context.isContextLost())throw new Error("context is lost");if(!(this.context instanceof WebGL2RenderingContext))throw new Error("XRCubeLayer only work on WebGL2");if(!_f(e.space))throw new TypeError("XRCubeLayer requires a space of type XRReferenceSpace");let t=new gp(e);return t.initialize(this.session,this.context),t}getSubImage(e,t,i="none"){if(e.isStatic&&!1===e.needsRedraw)throw new Error("Invalid state for subimage creation");let n=this.subImageCache.tryGetCachedSubImage(this.context,e,i);if(n)return n;let r=new Ep;if(e instanceof Vf)throw new TypeError;if(e.layout===Mf.default)throw new TypeError;if(!this.validateStateofSubImageCreation(e,t))throw new Error("Invalid state for subimage creation");let s=0;if(e.layout===Mf.stereo){if("none"===i)throw new TypeError;"right"===i&&(s=1)}e.getTextureType()===Tf["texture-array"]?r.imageIndex=s:r.imageIndex=0;let o=0;e.getTextureType()===Tf.texture?(r.colorTexture=e.colorTextures[s],o=s):(r.colorTexture=e.colorTextures[0],o=0),e.depthStencilTextures&&e.depthStencilTextures.length?e.getTextureType()===Tf.texture?r.depthStencilTexture=e.depthStencilTextures[s]:r.depthStencilTexture=e.depthStencilTextures[0]:r.depthStencilTexture=null;const a=e.colorTexturesMeta[o];r.textureWidth=a.width,r.textureHeight=a.height;let l=1;return e.layout!==Mf["stereo-left-right"]&&e.layout!==Mf["stereo-top-bottom"]||(l=2),Gf(r.viewport,a,e.layout,s,l),this.session.queueTask((()=>{e.needsRedraw=!1})),this.subImageCache.cacheSubImage(r,this.context,e,i),r}getViewSubImage(e,t){let i=this.subImageCache.tryGetCachedViewSubImage(this.context,e,t);if(i)return i;let n=new Ep,r=this.session;if(!r.internalViews||!r.internalViews.length)return n;let s=r.getViewIndex(t),o=0;return e.getTextureType()===Tf["texture-array"]?n.imageIndex=s:n.imageIndex=0,e.layout===Mf.default&&e.getTextureType()===Tf.texture?(n.colorTexture=e.colorTextures[s],o=s):(n.colorTexture=e.colorTextures[0],o=0),0===e.depthStencilTextures.length?n.depthStencilTexture=null:e.layout===Mf.default&&e.getTextureType()===Tf.texture?n.depthStencilTexture=e.depthStencilTextures[s]:n.depthStencilTexture=e.depthStencilTextures[0],n.textureWidth=e.colorTexturesMeta[o].width,n.textureHeight=e.colorTexturesMeta[o].height,Gf(n.viewport,e.colorTexturesMeta[o],e.layout,s,r.internalViews.length),e.needsRedraw=!1,this.subImageCache.cacheViewSubImage(n,this.context,e,t),n}validateStateofSubImageCreation(e,t){return t.session===e.session&&(this.session===e.session&&(this.context===e.context&&(!(!e.colorTextures||!e.colorTextures.length)&&(!e.isStatic||!1!==e.needsRedraw))))}}class Sp{constructor(){this.cache=new Map,this.viewCache=new Map}cacheSubImage(e,t,i,n){let r=new Map;r.set(n,e);let s=new Map;s.set(i,r),this.cache.set(t,s)}tryGetCachedSubImage(e,t,i){var n,r;return null===(r=null===(n=this.cache.get(e))||void 0===n?void 0:n.get(t))||void 0===r?void 0:r.get(i)}cacheViewSubImage(e,t,i,n){let r=new Map;r.set(n,e);let s=new Map;s.set(i,r),this.viewCache.set(t,s)}tryGetCachedViewSubImage(e,t,i){var n,r;return null===(r=null===(n=this.viewCache.get(e))||void 0===n?void 0:n.get(t))||void 0===r?void 0:r.get(i)}}class Mp{constructor(){this.injected=!1;const e=Rf();this._injectPolyfill(e)}_injectPolyfill(e){if(!("xr"in e.navigator))throw new Error("WebXR Layers polyfill requires WebXR support.");this.injected,(e=>!!e.navigator.xr&&!(!e.XRMediaBinding||!e.XRWebGLBinding))(e)||(this._polyfillRequiredLayersFeature(e),this._polyfillXRSession(e),e.XRWebGLBinding=Tp,e.XRMediaBinding=Bf,this.injected=!0)}_polyfillXRSession(e){e.XRSession.prototype._updateRenderState=e.XRSession.prototype.updateRenderState,e.XRSession.prototype._requestAnimationFrame=e.XRSession.prototype.requestAnimationFrame;let t=Object.getOwnPropertyDescriptor(e.XRSession.prototype,"render
583State");Object.defineProperty(e.XRSession.prototype,"_renderState",t);let i=Object.getOwnPropertyDescriptor(bp.prototype,"renderState");Object.defineProperty(e.XRSession.prototype,"renderState",i);let n=Object.getOwnPropertyNames(bp.prototype);for(let r of n){let t=Object.getOwnPropertyDescriptor(bp.prototype,r);Object.defineProperty(e.XRSession.prototype,r,t)}}_polyfillRequiredLayersFeature(e){const t=e.navigator.xr.requestSession;Object.defineProperty(e.navigator.xr,"requestSessionInternal",{writable:!0}),e.navigator.xr.requestSessionInternal=t;Object.defineProperty(e.navigator.xr,"requestSession",{writable:!0}),e.navigator.xr.requestSession=(t,i)=>{const n=(i,n)=>e.navigator.xr.requestSessionInternal(i,n).then((e=>{Object.assign(e,new bp);let i=e;return i.initializeSession(t),Promise.resolve(i)}));if("immersive-vr"!==t)return n(t,i);if(!i)return n(t,i);if(i.requiredFeatures&&i.requiredFeatures.indexOf("layers")>-1){const e=Object.assign({},i),r=[...i.requiredFeatures],s=r.indexOf("layers");return r.splice(s,1),e.requiredFeatures=r,n(t,e)}return n(t,i)}}}const Ap={ipd:.063,fovy:Math.PI/2,headsetPosition:new Tu(0,1.6,0),headsetQuaternion:new Su,stereoEnabled:!1},_p=_h(),Rp=_h();class Pp{constructor(e,t={}){var i,n,r,s,o,a;this.version=yf;const l=new bu,c=new Pd(Md.Viewer,l),h={[_d.Left]:new wu(c),[_d.Right]:new wu(c),[_d.None]:new wu(c)},u=e.controllerConfig,d={};u&&Object.values(Bu).forEach((e=>{u.layout[e]&&(d[e]=new Ju(u,e,l))}));const f={[Bu.Left]:new pf(ef,Bu.Left,l),[Bu.Right]:new pf(ef,Bu.Right,l)},p=null!==(i=t.canvasContainer)&&void 0!==i?i:document.createElement("div");p.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${yf}`,p.style.position="fixed",p.style.width="100%",p.style.height="100%",p.style.top="0",p.style.left="0",p.style.display="flex",p.style.justifyContent="center",p.style.alignItems="center",p.style.overflow="hidden",p.style.zIndex="999",this[Zh]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(n=t.headsetPosition)&&void 0!==n?n:Ap.headsetPosition.clone(),quaternion:null!==(r=t.headsetQuaternion)&&void 0!==r?r:Ap.headsetQuaternion.clone(),stereoEnabled:null!==(s=t.stereoEnabled)&&void 0!==s?s:Ap.stereoEnabled,ipd:null!==(o=t.ipd)&&void 0!==o?o:Ap.ipd,fovy:null!==(a=t.fovy)&&void 0!==a?a:Ap.fovy,controllers:d,hands:f,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:"visible",pendingVisibilityState:null,xrSystem:null,installedGlobalObject:null,previousNavigatorXRDescriptor:null,previousUserAgentDescriptor:null,previousGlobals:null,previousMakeXRCompatible:null,matrix:ph(),globalSpace:l,viewerSpace:c,viewSpaces:h,canvasContainer:p,getViewport:(e,t)=>{const i=e.context.canvas,{width:n,height:r}=i,s=this[Zh].stereoEnabled,o=t.eye;let a,l,c,h;switch(o){case _d.None:a=0,l=0,c=n,h=r;break;case _d.Left:a=0,l=0,c=s?n/2:n,h=r;break;case _d.Right:a=n/2,l=0,c=s?n/2:0,h=r}const u=this[Zh].viewportCache[o];if(u&&u.x===a&&u.y===l&&u.width===c&&u.height===h)return u;const d=new Ef(a,l,c,h);return this[Zh].viewportCache[o]=d,d},viewportCache:{},updateViews:()=>{Eh(this[Zh].viewerSpace[fu].offsetMatrix,this[Zh].quaternion.quat,this[Zh].position.vec3),kh(_p,-this[Zh].ipd/2,0,0),wh(this[Zh].viewSpaces[_d.Left][fu].offsetMatrix,_p),kh(Rp,this[Zh].ipd/2,0,0),wh(this[Zh].viewSpaces[_d.Right][fu].offsetMatrix,Rp)},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;if(t.parentElement!==this[Zh].canvasContainer){const e=this[Zh].devui;if(e){const{devUICanvas:t,devUIContainer:i}=e;t.style.zIndex=3..toString(),i.style.zIndex=4..toString(),this[Zh].canvasContainer.appendChild(e.devUICanvas),this[Zh].canvasContainer.appendChild(e.devUIContainer)}const i=this[Zh].sem;i&&(i.environmentCanvas.style.zIndex=1..toString(),this[Zh].canvasContainer.appendChild(i.environmentCanvas)),this[Zh].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height,zIndex:t.style.zIndex},t.style.zIndex=2..toString(),this[Zh].canvasContainer.appendChild(t),document.body.appendChild(this[Zh].canvasContainer)}t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>
583{if(this[Zh].canvasData){const{canvas:e,parent:t,width:i,height:n,zIndex:r}=this[Zh].canvasData;e.width=i,e.height=n,e.style.zIndex=r,t?t.appendChild(e):this[Zh].canvasContainer.removeChild(e);const s=this[Zh].devui;s&&(this[Zh].canvasContainer.removeChild(s.devUICanvas),this[Zh].canvasContainer.removeChild(s.devUIContainer));const o=this[Zh].sem;o&&this[Zh].canvasContainer.removeChild(o.environmentCanvas),document.body.removeChild(this[Zh].canvasContainer),this[Zh].canvasData=void 0,window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;const i=performance.now(),n=this[Zh].lastFrameTime>0?i-this[Zh].lastFrameTime:16.67;if(this[Zh].lastFrameTime=i,this[Zh].remote&&this[Zh].remote.update(n),null===(t=this[Zh].actionPlayer)||void 0===t?void 0:t.playing)this[Zh].actionPlayer.playFrame();else{const t=e.session;this[Zh].pendingVisibilityState&&(this[Zh].visibilityState=this[Zh].pendingVisibilityState,this[Zh].pendingVisibilityState=null,t.dispatchEvent(new Od("visibilitychange",{session:t}))),"visible"===this[Zh].visibilityState&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[Zh].pendingReferenceSpaceReset&&(t[hu].referenceSpaces.forEach((e=>{switch(e[du].type){case Md.Local:case Md.LocalFloor:case Md.BoundedFloor:case Md.Unbounded:e.dispatchEvent(new wf("reset",{referenceSpace:e}))}})),this[Zh].pendingReferenceSpaceReset=!1)}this[Zh].updateViews()},controlMode:"manual",controlModeListeners:new Set,stateChangeListeners:new Set,remote:null,lastFrameTime:0},this[Zh].remote=new Fu(this),this[Zh].updateViews()}isNativeXRAvailable(){var e;const t=null===(e=globalThis.navigator)||void 0===e?void 0:e.xr;return Boolean(t)&&!(t instanceof bf)}installRuntime(e){var t,i,n,r;const s=null!==(t=null==e?void 0:e.globalObject)&&void 0!==t?t:globalThis,o=null==e?void 0:e.polyfillLayers;if(this.isNativeXRAvailable()&&!(null==e?void 0:e.forceInstall))return;const a=new Map,l=new Map;this[Zh].installedGlobalObject=s,this[Zh].previousGlobals=a,this[Zh].previousMakeXRCompatible=l;const c=e=>{e&&(l.set(e,{existed:"makeXRCompatible"in e,descriptor:Object.getOwnPropertyDescriptor(e,"makeXRCompatible")}),Object.defineProperty(e,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}))};c(WebGL2RenderingContext.prototype),c(null===(i=globalThis.WebGLRenderingContext)||void 0===i?void 0:i.prototype),this[Zh].xrSystem=new bf(this),this[Zh].previousNavigatorXRDescriptor=null!==(n=Object.getOwnPropertyDescriptor(globalThis.navigator,"xr"))&&void 0!==n?n:null,this[Zh].previousUserAgentDescriptor=null!==(r=Object.getOwnPropertyDescriptor(navigator,"userAgent"))&&void 0!==r?r:null,Object.defineProperty(globalThis.navigator,"xr",{value:this[Zh].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[Zh].userAgent,writable:!1,configurable:!0,enumerable:!0});const h=(e,t)=>{a.set(e,{existed:e in s,value:s[e]}),s[e]=t};h("XRSystem",bf),h("XRSession",Qd),h("XRRenderState",kd),h("XRFrame",Wd),h("XRSpace",wu),h("XRReferenceSpace",Pd),h("XRJointSpace",Jd),h("XRView",Ld),h("XRViewport",Ef),h("XRRigidTransform",vd),h("XRPose",Id),h("XRViewerPose",Nd),h("XRJointPose",Cd),h("XRInputSource",Zu),h("XRInputSourceArray",Hu),h("XRHand",Kd),h("XRLayer",mf),h("XRWebGLLayer",xf),h("XRSessionEvent",Od),h("XRInputSourceEvent",Yu),h("XRInputSourcesChangeEvent",Td),h("XRReferenceSpaceEvent",wf),o?new Mp:h("XRMediaBinding",void 0),h("XRWebGLBinding",fd)}uninstallRuntime(){var e,t,i;const n=this[Zh].previousGlobals,r=this[Zh].installedGlobalObject;n&&r&&n.forEach((({existed:e,value:t},i)=>{e?r[i]=t:delete r[i]}));const s=this[Zh].previousNavigatorXRDescriptor;s?Object.defineProperty(globalThis.navigator,"xr",s):(null===(e=Object.getOwnPropertyDescriptor(globalThis.navigator,"xr"))||void 0===e?void 0:e.configurable)&&delete globalThis.navigator.xr;const o=this[Zh].previousUserAgentDescriptor;o&&(null===(t=Object.getOwnPropertyDescriptor(navigator,"userAgent"))||void 0===t?void 0:t.configurable)&&Object.defineProperty(navigator,"userAgent",o),null===(i=this[Zh].previousMakeXRCompatible)||void 0===i||i.forEac
583h((({existed:e,descriptor:t},i)=>{e&&t?Object.defineProperty(i,"makeXRCompatible",t):delete i.makeXRCompatible})),this[Zh].xrSystem=null,this[Zh].installedGlobalObject=null,this[Zh].previousGlobals=null,this[Zh].previousMakeXRCompatible=null,this[Zh].previousNavigatorXRDescriptor=null,this[Zh].previousUserAgentDescriptor=null}installDevUI(e){this[Zh].devui=new e(this)}installSEM(e){this[Zh].sem=new e(this)}get supportedSessionModes(){return this[Zh].supportedSessionModes}get supportedFeatures(){return this[Zh].supportedFeatures}get supportedFrameRates(){return this[Zh].supportedFrameRates}get isSystemKeyboardSupported(){return this[Zh].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[Zh].internalNominalFrameRate}get stereoEnabled(){return this[Zh].stereoEnabled}set stereoEnabled(e){this[Zh].stereoEnabled=e}get ipd(){return this[Zh].ipd}set ipd(e){this[Zh].ipd=e}get fovy(){return this[Zh].fovy}set fovy(e){this[Zh].fovy=e}get position(){return this[Zh].position}get quaternion(){return this[Zh].quaternion}get viewerSpace(){var e;return(null===(e=this[Zh].actionPlayer)||void 0===e?void 0:e.playing)?this[Zh].actionPlayer.viewerSpace:this[Zh].viewerSpace}get viewSpaces(){var e;return(null===(e=this[Zh].actionPlayer)||void 0===e?void 0:e.playing)?this[Zh].actionPlayer.viewSpaces:this[Zh].viewSpaces}get controllers(){return this[Zh].controllers}get hands(){return this[Zh].hands}get primaryInputMode(){return this[Zh].primaryInputMode}set primaryInputMode(e){"controller"!==e&&"hand"!==e||(this[Zh].primaryInputMode=e)}get activeInputs(){if("visible"!==this[Zh].visibilityState)return[];return("controller"===this[Zh].primaryInputMode?Object.values(this[Zh].controllers):Object.values(this[Zh].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[Zh].actionPlayer)||void 0===e?void 0:e.playing)?this[Zh].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[Zh].canvasContainer}get canvasDimensions(){if(this[Zh].canvasData){const{width:e,height:t}=this[Zh].canvasData.canvas;return{width:e,height:t}}}get appCanvas(){var e;return null===(e=this[Zh].canvasData)||void 0===e?void 0:e.canvas}get activeSession(){var e;return null===(e=this[Zh].xrSystem)||void 0===e?void 0:e[eu].activeSession}get sessionOffered(){var e;return Boolean(null===(e=this[Zh].xrSystem)||void 0===e?void 0:e[eu].offeredSessionConfig)}get name(){return this[Zh].name}grantOfferedSession(){const e=this[Zh].xrSystem,t=null==e?void 0:e[eu];if(t&&t.offeredSessionConfig){const{resolve:i,reject:n,mode:r,options:s}=t.offeredSessionConfig;t.offeredSessionConfig=void 0,e.requestSession(r,s).then(i).catch(n)}}recenter(){const e=new Tu(-this.position.x,0,-this.position.z),t=new Tu(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),n=(new Su).setFromAxisAngle(new Tu(0,1,0),i);this.position.add(e),this.quaternion.multiply(n),[...Object.values(this[Zh].controllers),...Object.values(this[Zh].hands)].forEac
583h((t=>{t.position.add(e),t.quaternion.multiply(n),t.position.applyQuaternion(n)})),this[Zh].pendingReferenceSpaceReset=!0}get visibilityState(){return this[Zh].visibilityState}updateVisibilityState(e){if(!Object.values(["visible","visible-blurred","hidden"]).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[Zh].visibilityState&&(this[Zh].pendingVisibilityState=e)}createActionPlayer(e,t){return this[Zh].actionPlayer=new vf(e,t,this[Zh].ipd),this[Zh].actionPlayer}get devui(){return this[Zh].devui}get sem(){return this[Zh].sem}get remote(){return this[Zh].remote}get controlMode(){return this[Zh].controlMode}set controlMode(e){if("manual"!==e&&"programmatic"!==e)return;this[Zh].controlMode!==e&&(this[Zh].controlMode=e,this[Zh].controlModeListeners.forEach((t=>t(e))))}onControlModeChange(e){return this[Zh].controlModeListeners.add(e),()=>{this[Zh].controlModeListeners.delete(e)}}onStateChange(e){return this[Zh].stateChangeListeners.add(e),()=>{this[Zh].stateChangeListeners.delete(e)}}notifyStateChange(){this[Zh].stateChangeListeners.forEach((e=>e()))}}const kp={mapping:ju.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"}]},Op={mapping:ju.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"}]},Lp={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kp,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:Op,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},Ip={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kp,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:Op,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},Cp={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kp,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:Op,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},Np={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kp,gripOffsetMatr
583ix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:Op,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","hand-tracking"],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":$d.Opaque,"immersive-ar":$d.AlphaBlend},interactionMode:Xd.WorldSpace,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"},Dp={name:"Meta Quest 2",controllerConfig:Lp,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":$d.Opaque,"immersive-ar":$d.AlphaBlend},interactionMode:Xd.WorldSpace,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"},Fp={name:"Meta Quest Pro",controllerConfig:Ip,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":$d.Opaque,"immersive-ar":$d.AlphaBlend},interactionMode:Xd.WorldSpace,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"},jp={name:"Meta Quest 3",controllerConfig:Cp,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking","depth-sensing"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":$d.Opaque,"immersive-ar":$d.AlphaBlend},interactionMode:Xd.WorldSpace,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"};function zp(){let e=0,t=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(e|=(127&i)<<n,!(128&i))return this.assertBounds(),[e,t]}let i=this.buf[this.pos++];if(e|=(15&i)<<28,t=(112&i)>>4,!(128&i))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(t|=(127&i)<<n,!(128&i))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Bp(e,t,i){for(let s=0;s<28;s+=7){const n=e>>>s,r=!(n>>>7==0&&0==t),o=255&(r?128|n:n);if(i.push(o),!r)return}const n=e>>>28&15|(7&t)<<4,r=!!(t>>3);if(i.push(255&(r?128|n:n)),r){for(let e=3;e<31;e+=7){const n=t>>>e,r=!(n>>>7==0),s=255&(r?128|n:n);if(i.push(s),!r)return}i.push(t>>>31&1)}}const Up=4294967296;function Vp(e){const t="-"===e[0];t&&(e=e.slice(1));const i=1e6;let n=0,r=0;function s(t,s){const o=Number(e.slice(t,s));r*=i,n=n*i+o,n>=Up&&(r+=n/Up|0,n%=Up)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?$p(n,r):Wp(n,r)}function Gp(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(Up*t+e);const i=16777215&(e>>>24|t<<8),n=t>>16&65535;let r=(16777215&e)+6777216*i+6710656*n,s=i+8147497*n,o=2*n;const a=1e7;return r>=a&&(s+=Math.floor(r/a),r%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+qp(s)+qp(r)}function Wp(e,t){return{lo:0|e,hi:0|t}}function $p(e,t){return t=~t,e?e=1+~e:t+=1,Wp(e,t)}const qp=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Xp(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let i=0;i<9;i++)t.push(127&e|128),e>>=7;t.push(1)}}function Hp(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let i=5;128&e&&i<10;i++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var Zp={};const Yp=Qp();function Qp(){const e=new DataView(new ArrayBuffer(8));if(!("function"!=typeof BigInt||"function"!=typeof e.getBigInt64||"function"!=typeof e.getBigUint64||"function"!=typeof e.setBigInt64||"function"!=typeof e.setBigUint64||!globalThis.Deno&&!globalThis.Bu
583n&&"object"==typeof process&&"1"===Zp.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),n=BigInt("0"),r=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const n="bigint"==typeof e?e:BigInt(e);if(n>i||n<t)throw new Error(`invalid int64: ${e}`);return n},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>r||t<n)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,i)=>(e.setInt32(0,t,!0),e.setInt32(4,i,!0),e.getBigInt64(0,!0)),uDec:(t,i)=>(e.setInt32(0,t,!0),e.setInt32(4,i,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),Kp(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),Jp(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),Kp(e),Vp(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),Jp(e),Vp(e)),dec:(e,t)=>function(e,t){let i=Wp(e,t);const n=2147483648&i.hi;n&&(i=$p(i.lo,i.hi));const r=Gp(i.lo,i.hi);return n?"-"+r:r}(e,t),uDec:(e,t)=>Gp(e,t)}}function Kp(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Jp(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}const em=Symbol.for("@bufbuild/protobuf/text-encoding");function tm(){if(null==globalThis[em]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;let i;globalThis[em]={encodeUtf8:t=>e.encode(t),decodeUtf8:(e,n)=>n?(void 0===i&&(i=new globalThis.TextDecoder("utf-8",{fatal:!0})),i.decode(e)):t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(t){return!1}}}}return globalThis[em]}var im,nm;(nm=im||(im={}))[nm.Varint=0]="Varint",nm[nm.Bit64=1]="Bit64",nm[nm.LengthDelimited=2]="LengthDelimited",nm[nm.StartGroup=3]="StartGroup",nm[nm.EndGroup=4]="EndGroup",nm[nm.Bit32=5]="Bit32";const rm=34028234663852886e22,sm=-34028234663852886e22;class om{constructor(e=tm().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let n=0;n<this.chunks.length;n++)e+=this.chunks[n].length;let t=new Uint8Array(e),i=0;for(let n=0;n<this.chunks.length;n++)t.set(this.chunks[n],i),i+=this.chunks[n].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(cm(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return lm(e),Xp(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){!function(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>rm||e<sm))throw new Error("invalid float32: "+e)}(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){cm(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){lm(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return lm(e),Xp(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),i=new DataView(t.buffer),n=Yp.enc(e);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),i=new DataView(t.buffer),n=Yp.uEnc(e);return i.setInt32(0,n.lo,!0),i.setInt32(4,n.hi,!0),this.raw(t)}int64(e){let t=Yp.enc(e);return Bp(t.lo,t.hi,this.buf),this}sint64(e){const t=Yp.enc(e),i=t.hi>>31;return Bp(t.lo<<1^i,(t.hi<<1|t.lo>>>31)^i,this.buf),this}uint64(e){const t=Yp.uEnc(e);return Bp(t.lo,t.hi,this.buf),this}}class am{constructor(e,t=tm().decodeUtf8){this.decodeUtf8=t,this.varint64=zp,this.uint32=Hp,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){const e=this.pos,t=this.uint32(),i=this.pos-e;if(i>5||5==i&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");const n=t>>>3,r=7&t;if(n<=0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(e,t,i=100){let n=this.pos;switch(e){case im.Varint:for(;128&this.buf[this.pos++];);break;case im.Bit64:this.pos+=4;case im.Bit32:this.pos+=4;break;case im.LengthDelimited:let n=this.uint32();this.pos+=n;break;case im.StartGroup:if(i<=0)throw new Error("maximum recursion depth reached");for(;;){const[e,n]=this.tag();if(n===im.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e,i-1)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return Yp.dec(...this.varint64())}uint64(){return Yp.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),i=-(1&e);return e=(e>>>1|(1&t)<<31)^i,t=t>>>1^i,Yp.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Yp.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Yp.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){return this.decodeUtf8(this.bytes(),e)}}function lm(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int32: "+e)}function cm(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint32: "+e)}const hm={encode:(e,t=new om)=>(0!==e.x&&t.uint32(13).float(e.x),0!==e.y&&t.uint32(21).float(e.y),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={x:0,y:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(13!==e)break;r.x=i.float();continue;case 2:if(21!==e)break;r.y=i.float();continue}if(4==(7&e)||0===e)break;
583i.skip(7&e)}return r},fromJSON:e=>({x:vm(e.x)?globalThis.Number(e.x):0,y:vm(e.y)?globalThis.Number(e.y):0}),toJSON(e){const t={};return 0!==e.x&&(t.x=e.x),0!==e.y&&(t.y=e.y),t},create:e=>hm.fromPartial(null!=e?e:{}),fromPartial(e){var t,i;const n={x:0,y:0};return n.x=null!==(t=e.x)&&void 0!==t?t:0,n.y=null!==(i=e.y)&&void 0!==i?i:0,n}};const um={encode:(e,t=new om)=>(0!==e.width&&t.uint32(13).float(e.width),0!==e.height&&t.uint32(21).float(e.height),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={width:0,height:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(13!==e)break;r.width=i.float();continue;case 2:if(21!==e)break;r.height=i.float();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({width:vm(e.width)?globalThis.Number(e.width):0,height:vm(e.height)?globalThis.Number(e.height):0}),toJSON(e){const t={};return 0!==e.width&&(t.width=e.width),0!==e.height&&(t.height=e.height),t},create:e=>um.fromPartial(null!=e?e:{}),fromPartial(e){var t,i;const n={width:0,height:0};return n.width=null!==(t=e.width)&&void 0!==t?t:0,n.height=null!==(i=e.height)&&void 0!==i?i:0,n}};const dm={encode:(e,t=new om)=>(0!==e.x&&t.uint32(13).float(e.x),0!==e.y&&t.uint32(21).float(e.y),0!==e.z&&t.uint32(29).float(e.z),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={x:0,y:0,z:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(13!==e)break;r.x=i.float();continue;case 2:if(21!==e)break;r.y=i.float();continue;case 3:if(29!==e)break;r.z=i.float();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({x:vm(e.x)?globalThis.Number(e.x):0,y:vm(e.y)?globalThis.Number(e.y):0,z:vm(e.z)?globalThis.Number(e.z):0}),toJSON(e){const t={};return 0!==e.x&&(t.x=e.x),0!==e.y&&(t.y=e.y),0!==e.z&&(t.z=e.z),t},create:e=>dm.fromPartial(null!=e?e:{}),fromPartial(e){var t,i,n;const r={x:0,y:0,z:0};return r.x=null!==(t=e.x)&&void 0!==t?t:0,r.y=null!==(i=e.y)&&void 0!==i?i:0,r.z=null!==(n=e.z)&&void 0!==n?n:0,r}};const fm={encode:(e,t=new om)=>(0!==e.width&&t.uint32(13).float(e.width),0!==e.height&&t.uint32(21).float(e.height),0!==e.depth&&t.uint32(29).float(e.depth),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={width:0,height:0,depth:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(13!==e)break;r.width=i.float();continue;case 2:if(21!==e)break;r.height=i.float();continue;case 3:if(29!==e)break;r.depth=i.float();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({width:vm(e.width)?globalThis.Number(e.width):0,height:vm(e.height)?globalThis.Number(e.height):0,depth:vm(e.depth)?globalThis.Number(e.depth):0}),toJSON(e){const t={};return 0!==e.width&&(t.width=e.width),0!==e.height&&(t.height=e.height),0!==e.depth&&(t.depth=e.depth),t},create:e=>fm.fromPartial(null!=e?e:{}),fromPartial(e){var t,i,n;const r={width:0,height:0,depth:0};return r.width=null!==(t=e.width)&&void 0!==t?t:0,r.height=null!==(i=e.height)&&void 0!==i?i:0,r.depth=null!==(n=e.depth)&&void 0!==n?n:0,r}};const pm={encode:(e,t=new om)=>(0!==e.x&&t.uint32(13).float(e.x),0!==e.y&&t.uint32(21).float(e.y),0!==e.z&&t.uint32(29).float(e.z),0!==e.w&&t.uint32(37).float(e.w),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={x:0,y:0,z:0,w:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(13!==e)break;r.x=i.float();continue;case 2:if(21!==e)break;r.y=i.float();continue;case 3:if(29!==e)break;r.z=i.float();continue;case 4:if(37!==e)break;r.w=i.float();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({x:vm(e.x)?globalThis.Number(e.x):0,y:vm(e.y)?globalThis.Number(e.y):0,z:vm(e.z)?globalThis.Number(e.z):0,w:vm(e.w)?globalThis.Number(e.w):0}),toJSON(e){const t={};return 0!==e.x&&(t.x=e.x),0!==e.y&&(t.y=e.y),0!==e.z&&(t.z=e.z),0!==e.w&&(t.w=e.w),t},create:e=>pm.fromPartial(null!=e?e:{}),fromPartial(e){var t,i,n,r;const s={x:0,y:0,z:0,w:0};return s.x=null!==(t=e.x)&&void 0!==t?t:0,s.y=null!==(i=e.y)&&void 0!==i?i:0,s.z=null!==(n=e.z)&&void 0!==n?n:0,s.w=null!==(r=e.w)&&void 0!==r?r:0,s}};const mm={encode:(e,t=new om)=>(void 0!==e.offset&&hm.encode(e.offset,t.uint32(10).fork()).join(),void 0!==e.extent&&um.encode(e.extent,t.uint32(18).fork()).join(),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={offset:void 0,extent:void 0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.offset=hm.decode(i,i.uint32());continue;case 2:if(18!==e)break;r.extent=um.decode(i,i.uint32());continue}if(4==(7&e)||0===e)break;
583i.skip(7&e)}return r},fromJSON:e=>({offset:vm(e.offset)?hm.fromJSON(e.offset):void 0,extent:vm(e.extent)?um.fromJSON(e.extent):void 0}),toJSON(e){const t={};return void 0!==e.offset&&(t.offset=hm.toJSON(e.offset)),void 0!==e.extent&&(t.extent=um.toJSON(e.extent)),t},create:e=>mm.fromPartial(null!=e?e:{}),fromPartial(e){const t={offset:void 0,extent:void 0};return t.offset=void 0!==e.offset&&null!==e.offset?hm.fromPartial(e.offset):void 0,t.extent=void 0!==e.extent&&null!==e.extent?um.fromPartial(e.extent):void 0,t}};const gm={encode:(e,t=new om)=>(void 0!==e.offset&&dm.encode(e.offset,t.uint32(10).fork()).join(),void 0!==e.extent&&fm.encode(e.extent,t.uint32(18).fork()).join(),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={offset:void 0,extent:void 0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.offset=dm.decode(i,i.uint32());continue;case 2:if(18!==e)break;r.extent=fm.decode(i,i.uint32());continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({offset:vm(e.offset)?dm.fromJSON(e.offset):void 0,extent:vm(e.extent)?fm.fromJSON(e.extent):void 0}),toJSON(e){const t={};return void 0!==e.offset&&(t.offset=dm.toJSON(e.offset)),void 0!==e.extent&&(t.extent=fm.toJSON(e.extent)),t},create:e=>gm.fromPartial(null!=e?e:{}),fromPartial(e){const t={offset:void 0,extent:void 0};return t.offset=void 0!==e.offset&&null!==e.offset?dm.fromPartial(e.offset):void 0,t.extent=void 0!==e.extent&&null!==e.extent?fm.fromPartial(e.extent):void 0,t}};const xm={encode:(e,t=new om)=>(void 0!==e.orientation&&pm.encode(e.orientation,t.uint32(10).fork()).join(),void 0!==e.position&&dm.encode(e.position,t.uint32(18).fork()).join(),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={orientation:void 0,position:void 0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.orientation=pm.decode(i,i.uint32());continue;case 2:if(18!==e)break;r.position=dm.decode(i,i.uint32());continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({orientation:vm(e.orientation)?pm.fromJSON(e.orientation):void 0,position:vm(e.position)?dm.fromJSON(e.position):void 0}),toJSON(e){const t={};return void 0!==e.orientation&&(t.orientation=pm.toJSON(e.orientation)),void 0!==e.position&&(t.position=dm.toJSON(e.position)),t},create:e=>xm.fromPartial(null!=e?e:{}),fromPartial(e){const t={orientation:void 0,position:void 0};return t.orientation=void 0!==e.orientation&&null!==e.orientation?pm.fromPartial(e.orientation):void 0,t.position=void 0!==e.position&&null!==e.position?dm.fromPartial(e.position):void 0,t}};function vm(e){return null!=e}var ym,wm,bm,Em;function Tm(e){switch(e){case 0:case"Keyboard":return ym.Keyboard;default:return ym.UNRECOGNIZED}}function Sm(e){switch(e){case 0:case"UNKNOWN":return bm.UNKNOWN;case 1:case"FLOOR":return bm.FLOOR;case 2:case"CEILING":return bm.CEILING;case 3:case"WALL_FACE":return bm.WALL_FACE;case 4:case"TABLE":return bm.TABLE;case 5:case"COUCH":return bm.COUCH;case 6:case"DOOR_FRAME":return bm.DOOR_FRAME;case 7:case"WINDOW_FRAME":return bm.WINDOW_FRAME;case 8:case"OTHER":return bm.OTHER;case 9:case"STORAGE":return bm.STORAGE;case 10:case"BED":return bm.BED;case 11:case"SCREEN":return bm.SCREEN;case 12:case"LAMP":return bm.LAMP;case 13:case"PLANT":return bm.PLANT;case 14:case"WALL_ART":return bm.WALL_ART;case 15:case"GLOBAL_MESH":return bm.GLOBAL_MESH;case 16:case"INVISIBLE_WALL_FACE":return bm.INVISIBLE_WALL_FACE;case 17:case"CHAIR":return bm.CHAIR;case 18:case"INNER_WALL_FACE":return bm.INNER_WALL_FACE;case 19:case"OTHER_ROOM_FACE":return bm.OTHER_ROOM_FACE;case 20:case"OPENING":return bm.OPENING;default:return bm.UNRECOGNIZED}}function Mm(e){switch(e){case bm.UNKNOWN:return"UNKNOWN";case bm.FLOOR:return"FLOOR";case bm.CEILING:return"CEILING";case bm.WALL_FACE:return"WALL_FACE";case bm.TABLE:return"TABLE";case bm.COUCH:return"COUCH";case bm.DOOR_FRAME:return"DOOR_FRAME";case bm.WINDOW_FRAME:return"WINDOW_FRAME";case bm.OTHER:return"OTHER";case bm.STORAGE:return"STORAGE";case bm.BED:return"BED";case bm.SCREEN:return"SCREEN";
583case bm.LAMP:return"LAMP";case bm.PLANT:return"PLANT";case bm.WALL_ART:return"WALL_ART";case bm.GLOBAL_MESH:return"GLOBAL_MESH";case bm.INVISIBLE_WALL_FACE:return"INVISIBLE_WALL_FACE";case bm.CHAIR:return"CHAIR";case bm.INNER_WALL_FACE:return"INNER_WALL_FACE";case bm.OTHER_ROOM_FACE:return"OTHER_ROOM_FACE";case bm.OPENING:return"OPENING";case bm.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(wm=ym||(ym={}))[wm.Keyboard=0]="Keyboard",wm[wm.UNRECOGNIZED=-1]="UNRECOGNIZED",(Em=bm||(bm={}))[Em.UNKNOWN=0]="UNKNOWN",Em[Em.FLOOR=1]="FLOOR",Em[Em.CEILING=2]="CEILING",Em[Em.WALL_FACE=3]="WALL_FACE",Em[Em.TABLE=4]="TABLE",Em[Em.COUCH=5]="COUCH",Em[Em.DOOR_FRAME=6]="DOOR_FRAME",Em[Em.WINDOW_FRAME=7]="WINDOW_FRAME",Em[Em.OTHER=8]="OTHER",Em[Em.STORAGE=9]="STORAGE",Em[Em.BED=10]="BED",Em[Em.SCREEN=11]="SCREEN",Em[Em.LAMP=12]="LAMP",Em[Em.PLANT=13]="PLANT",Em[Em.WALL_ART=14]="WALL_ART",Em[Em.GLOBAL_MESH=15]="GLOBAL_MESH",Em[Em.INVISIBLE_WALL_FACE=16]="INVISIBLE_WALL_FACE",Em[Em.CHAIR=17]="CHAIR",Em[Em.INNER_WALL_FACE=18]="INNER_WALL_FACE",Em[Em.OTHER_ROOM_FACE=19]="OTHER_ROOM_FACE",Em[Em.OPENING=20]="OPENING",Em[Em.UNRECOGNIZED=-1]="UNRECOGNIZED";const Am={encode(e,t=new om){""!==e.floorUuid&&t.uint32(10).string(e.floorUuid),""!==e.ceilingUuid&&t.uint32(18).string(e.ceilingUuid);for(const i of e.wallUuids)t.uint32(26).string(i);return t},decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={floorUuid:"",ceilingUuid:"",wallUuids:[]};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.floorUuid=i.string();continue;case 2:if(18!==e)break;r.ceilingUuid=i.string();continue;case 3:if(26!==e)break;r.wallUuids.push(i.string());continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({floorUuid:Dm(e.floorUuid)?globalThis.String(e.floorUuid):"",ceilingUuid:Dm(e.ceilingUuid)?globalThis.String(e.ceilingUuid):"",wallUuids:globalThis.Array.isArray(null==e?void 0:e.wallUuids)?e.wallUuids.map((e=>globalThis.String(e))):[]}),toJSON(e){var t;const i={};return""!==e.floorUuid&&(i.floorUuid=e.floorUuid),""!==e.ceilingUuid&&(i.ceilingUuid=e.ceilingUuid),(null===(t=e.wallUuids)||void 0===t?void 0:t.length)&&(i.wallUuids=e.wallUuids),i},create:e=>Am.fromPartial(null!=e?e:{}),fromPartial(e){var t,i,n;const r={floorUuid:"",ceilingUuid:"",wallUuids:[]};return r.floorUuid=null!==(t=e.floorUuid)&&void 0!==t?t:"",r.ceilingUuid=null!==(i=e.ceilingUuid)&&void 0!==i?i:"",r.wallUuids=(null===(n=e.wallUuids)||void 0===n?void 0:n.map((e=>e)))||[],r}};const _m={encode(e,t=new om){for(const i of e.uuids)t.uint32(10).string(i);return t},decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={uuids:[]};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.uuids.push(i.string());continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({uuids:globalThis.Array.isArray(null==e?void 0:e.uuids)?e.uuids.map((e=>globalThis.String(e))):[]}),toJSON(e){var t;const i={};return(null===(t=e.uuids)||void 0===t?void 0:t.length)&&(i.uuids=e.uuids),i},create:e=>_m.fromPartial(null!=e?e:{}),fromPartial(e){var t;const i={uuids:[]};return i.uuids=(null===(t=e.uuids)||void 0===t?void 0:t.map((e=>e)))||[],i}};function Rm(){return{vertices:new Uint8Array(0)}}const Pm={encode:(e,t=new om)=>(0!==e.vertices.length&&t.uint32(10).bytes(e.vertices),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r=Rm();for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.vertices=i.bytes();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({vertices:Dm(e.vertices)?Cm(e.vertices):new Uint8Array(0)}),toJSON(e){const t={};return 0!==e.vertices.length&&(t.vertices=Nm(e.vertices)),t},create:e=>Pm.fromPartial(null!=e?e:{}),fromPartial(e){var t;const i=Rm();return i.vertices=null!==(t=e.vertices)&&void 0!==t?t:new Uint8Array(0),i}};function km(){return{vertices:new Uint8Array(0),indices:new Uint8Array(0)}}const Om={encode:(e,t=new om)=>(0!==e.vertices.length&&t.uint32(10).bytes(e.vertices),0!==e.indices.length&&t.uint32(18).bytes(e.indices),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r=km();for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.vertices=i.bytes();continue;case 2:if(18!==e)break;r.indices=i.bytes();continue}if(4==(7&e)||0===e)break;
583i.skip(7&e)}return r},fromJSON:e=>({vertices:Dm(e.vertices)?Cm(e.vertices):new Uint8Array(0),indices:Dm(e.indices)?Cm(e.indices):new Uint8Array(0)}),toJSON(e){const t={};return 0!==e.vertices.length&&(t.vertices=Nm(e.vertices)),0!==e.indices.length&&(t.indices=Nm(e.indices)),t},create:e=>Om.fromPartial(null!=e?e:{}),fromPartial(e){var t,i;const n=km();return n.vertices=null!==(t=e.vertices)&&void 0!==t?t:new Uint8Array(0),n.indices=null!==(i=e.indices)&&void 0!==i?i:new Uint8Array(0),n}};const Lm={encode:(e,t=new om)=>(0!==e.classType&&t.uint32(8).int32(e.classType),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={classType:0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(8!==e)break;r.classType=i.int32();continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({classType:Dm(e.classType)?Tm(e.classType):0}),toJSON(e){const t={};return 0!==e.classType&&(t.classType=function(e){switch(e){case ym.Keyboard:return"Keyboard";case ym.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.classType)),t},create:e=>Lm.fromPartial(null!=e?e:{}),fromPartial(e){var t;const i={classType:0};return i.classType=null!==(t=e.classType)&&void 0!==t?t:0,i}};const Im={encode:(e,t=new om)=>(""!==e.uuid&&t.uint32(10).string(e.uuid),void 0!==e.semanticLabel_META&&t.uint32(16).int32(e.semanticLabel_META),void 0!==e.locatable_META&&xm.encode(e.locatable_META,t.uint32(26).fork()).join(),void 0!==e.boundary2D_META&&Pm.encode(e.boundary2D_META,t.uint32(34).fork()).join(),void 0!==e.bounded2D_META&&mm.encode(e.bounded2D_META,t.uint32(42).fork()).join(),void 0!==e.bounded3D_META&&gm.encode(e.bounded3D_META,t.uint32(50).fork()).join(),void 0!==e.roomLayout_META&&Am.encode(e.roomLayout_META,t.uint32(58).fork()).join(),void 0!==e.spaceContainer_META&&_m.encode(e.spaceContainer_META,t.uint32(66).fork()).join(),void 0!==e.triangleMesh_META&&Om.encode(e.triangleMesh_META,t.uint32(74).fork()).join(),void 0!==e.dynamicObject_META&&Lm.encode(e.dynamicObject_META,t.uint32(82).fork()).join(),t),decode(e,t){const i=e instanceof am?e:new am(e);let n=void 0===t?i.len:i.pos+t;const r={uuid:"",semanticLabel_META:void 0,locatable_META:void 0,boundary2D_META:void 0,bounded2D_META:void 0,bounded3D_META:void 0,roomLayout_META:void 0,spaceContainer_META:void 0,triangleMesh_META:void 0,dynamicObject_META:void 0};for(;i.pos<n;){const e=i.uint32();switch(e>>>3){case 1:if(10!==e)break;r.uuid=i.string();continue;case 2:if(16!==e)break;r.semanticLabel_META=i.int32();continue;case 3:if(26!==e)break;r.locatable_META=xm.decode(i,i.uint32());continue;case 4:if(34!==e)break;r.boundary2D_META=Pm.decode(i,i.uint32());continue;case 5:if(42!==e)break;r.bounded2D_META=mm.decode(i,i.uint32());continue;case 6:if(50!==e)break;r.bounded3D_META=gm.decode(i,i.uint32());continue;case 7:if(58!==e)break;r.roomLayout_META=Am.decode(i,i.uint32());continue;case 8:if(66!==e)break;r.spaceContainer_META=_m.decode(i,i.uint32());continue;case 9:if(74!==e)break;r.triangleMesh_META=Om.decode(i,i.uint32());continue;case 10:if(82!==e)break;r.dynamicObject_META=Lm.decode(i,i.uint32());continue}if(4==(7&e)||0===e)break;i.skip(7&e)}return r},fromJSON:e=>({uuid:Dm(e.uuid)?globalThis.String(e.uuid):"",semanticLabel_META:Dm(e.semanticLabel_META)?Sm(e.semanticLabel_META):void 0,locatable_META:Dm(e.locatable_META)?xm.fromJSON(e.locatable_META):void 0,boundary2D_META:Dm(e.boundary2D_META)?Pm.fromJSON(e.boundary2D_META):void 0,bounded2D_META:Dm(e.bounded2D_META)?mm.fromJSON(e.bounded2D_META):void 0,bounded3D_META:Dm(e.bounded3D_META)?gm.fromJSON(e.bounded3D_META):void 0,roomLayout_META:Dm(e.roomLayout_META)?Am.fromJSON(e.roomLayout_META):void 0,spaceContainer_META:Dm(e.spaceContainer_META)?_m.fromJSON(e.spaceContainer_META):void 0,triangleMesh_META:Dm(e.triangleMesh_META)?Om.fromJSON(e.triangleMesh_META):void 0,dynamicObject_META:Dm(e.dynamicObject_META)?Lm.fromJSON(e.dynamicObject_META):void 0}),toJSON(e){const t={};return""!==e.uuid&&(t.uuid=e.uuid),void 0!==e.semanticLabel_META&&(t.semanticLabel_META=Mm(e.semanticLabel_META)),void 0!==e.locatable_META&&(t.locatable_META=xm.toJSON(e.locatable_META)),void 0!==e.boundary2D_META&&(t.boun
583dary2D_META=Pm.toJSON(e.boundary2D_META)),void 0!==e.bounded2D_META&&(t.bounded2D_META=mm.toJSON(e.bounded2D_META)),void 0!==e.bounded3D_META&&(t.bounded3D_META=gm.toJSON(e.bounded3D_META)),void 0!==e.roomLayout_META&&(t.roomLayout_META=Am.toJSON(e.roomLayout_META)),void 0!==e.spaceContainer_META&&(t.spaceContainer_META=_m.toJSON(e.spaceContainer_META)),void 0!==e.triangleMesh_META&&(t.triangleMesh_META=Om.toJSON(e.triangleMesh_META)),void 0!==e.dynamicObject_META&&(t.dynamicObject_META=Lm.toJSON(e.dynamicObject_META)),t},create:e=>Im.fromPartial(null!=e?e:{}),fromPartial(e){var t,i;const n={uuid:"",semanticLabel_META:void 0,locatable_META:void 0,boundary2D_META:void 0,bounded2D_META:void 0,bounded3D_META:void 0,roomLayout_META:void 0,spaceContainer_META:void 0,triangleMesh_META:void 0,dynamicObject_META:void 0};return n.uuid=null!==(t=e.uuid)&&void 0!==t?t:"",n.semanticLabel_META=null!==(i=e.semanticLabel_META)&&void 0!==i?i:void 0,n.locatable_META=void 0!==e.locatable_META&&null!==e.locatable_META?xm.fromPartial(e.locatable_META):void 0,n.boundary2D_META=void 0!==e.boundary2D_META&&null!==e.boundary2D_META?Pm.fromPartial(e.boundary2D_META):void 0,n.bounded2D_META=void 0!==e.bounded2D_META&&null!==e.bounded2D_META?mm.fromPartial(e.bounded2D_META):void 0,n.bounded3D_META=void 0!==e.bounded3D_META&&null!==e.bounded3D_META?gm.fromPartial(e.bounded3D_META):void 0,n.roomLayout_META=void 0!==e.roomLayout_META&&null!==e.roomLayout_META?Am.fromPartial(e.roomLayout_META):void 0,n.spaceContainer_META=void 0!==e.spaceContainer_META&&null!==e.spaceContainer_META?_m.fromPartial(e.spaceContainer_META):void 0,n.triangleMesh_META=void 0!==e.triangleMesh_META&&null!==e.triangleMesh_META?Om.fromPartial(e.triangleMesh_META):void 0,n.dynamicObject_META=void 0!==e.dynamicObject_META&&null!==e.dynamicObject_META?Lm.fromPartial(e.dynamicObject_META):void 0,n}};function Cm(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const t=globalThis.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;++e)i[e]=t.charCodeAt(e);return i}}function Nm(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const t=[];return e.forEach((e=>{t.push(globalThis.String.fromCharCode(e))})),globalThis.btoa(t.join(""))}}function Dm(e){return null!=e}var Fm,jm,zm,Bm;(jm=Fm||(Fm={})).Locatable="locatable",jm.Bounded3D="bounded3D",jm.Bounded2D="bounded2D",jm.TriangleMesh="triangleMesh",jm.SemanticLabel="semanticLabel";class Um extends EventTarget{constructor(e){super(),this._spatialEntity=e}}class Vm extends Um{constructor(e,t){super(e),this._offset=new R,this._extent=new R,this.type=Fm.Bounded2D;const{offset:i,extent:n}=t;this._offset.set(i.x,i.y),this._extent.set(n.width,n.height),this.buildGeometry()}buildGeometry(){var e;const t=new C(this._extent.x,this._extent.y);t.translate(this._offset.x+this._extent.x/2,this._offset.y+this._extent.y/2,0),t.rotateX(Math.PI/2),null===(e=this._spatialEntity.geometry)||void 0===e||e.dispose(),this._spatialEntity.geometry=t}get offset(){return this._offset}get extent(){return this._extent}get initData(){return{offset:this.offset,extent:this.extent}}get pbData(){return{offset:{x:this._offset.x,y:this._offset.y},extent:{width:this._extent.x,height:this._extent.y}}}}class Gm extends Um{constructor(e,t){super(e),this._offset=new l,this._extent=new l,this.type=Fm.Bounded3D;const{offset:i,extent:n}=t;this._offset.set(i.x,i.y,i.z),this._extent.set(n.width,n.height,n.depth),this.buildGeometry()}buildGeometry(){var e;const t=new S(this._extent.x,this._extent.y,this._extent.z);t.translate(this._offset.x+this._extent.x/2,this._offset.y+this._extent.y/2,this._offset.z+this._extent.z/2),null===(e=this._spatialEntity.geometry)||void 0===e||e.dispose(),this._spatialEntity.geometry=t}get offset(){return this._offset}get extent(){return this._extent}get initData(){return{offset:this.offset,extent:this.extent}}get pbData(){return{offset:{x:this._offset.x,y:this._offset.y,z:this._offset.z},extent:{width:this._extent.x,height:this._extent.y,depth:this._extent.z}}}}class Wm extends Um{constructor(e,t){super(e),this.type=Fm.Locatable,t.position&&this.position.copy(t.position),t.orientation&&this.orientation.copy(t.orientation)}get position(){return this._spatialEntity.position}get rotation(){return this._spatialEntity.rotation}get orientation(){return this._spatialEntity.quaternion}get initData(){return{position:{x:this.position.x,y:this.position.y,z:this.position.z},orientation:{x:this.orientation.x,y:this.orientation.y,z:this.orientation.z,w:this.orientation.w}}}get pbData(){return{position:{x:this._spatialEntity.position.x,y:this._spatialEntity.position.y,z:this._spatialEntity.position.z},orientation:{x:this._spatialEntity.quaternion.x,y:this._spatialEntity.quaternion.y,z:this._spatialEntity.quaternion.z,w:this._spatialEntity.quaternion.w}}}}function $m(e){return e.toLowerCase().replace(/_/g," ").trim()}class qm extends Um{constructor(e,t){super(e),this._semanticLabel=t,this.type=Fm.SemanticLabel,this._spatialEntity.name=$m(Mm(t))}get semanticLabel(){return this._semanticLabel}set semanticLabel(e){Object.values(bm).includes(e)?this._semanticLabel=e:this._semanticLabel=bm.UNRECOGNIZED,this._spatialEntity.name=$m(Mm(this._semanticLabel))}get initData(){return this._semanticLabel}get pbData(){return this._semanticLabel}}function Xm(e){const t=new Float32Array(3*e.length);let i=0;for(const n of e)t[i++]=n.x,t[i++]=n.y,t[i++]=n.z;return t}class Hm extends Um{constructor(e,t){super(e),this._polygonCount=0,this._vertexCount=0,this._dimensions={x:0,y:0,z:0},this.type=Fm.TriangleMesh;const{vertices:i,indices:n}=t,r=new Float32Array(i.buffer),s=new Uint32Array(n.buffer),o=[];for(let l=0;l<r.length/3;l++)o.push({x:r[3*l],y:r[3*l+1],z:r[3*l+2]});this._vertices=o,this._indices=[...s],this.buildGeometry();const a=e.material;a.polygonOffset=!0,a.polygonOffsetFactor=1,a.polygonOffsetUnits=.005,a.color.setHex(13948116),e.renderOrder=999}buildGeometry(){var e;const t=new g,i=Xm(this._vertices);t.setAttribute("position",new N(i,3)),t.setIndex(new N(new Uint16Array(this._indices),1)),null===(e=this._spatialEntity.geometry)||void 0===e||e.dispose(),this._spatialEntity.geometry=t,t.computeVertexNormals(),this._vertexCount=t.attributes.position.count,this._polygonCount=t.index?t.index.count/3:this._vertexCount/3,t.computeBoundingBox();const n=t.boundingBox;this._dimensions={x:n.max.x-n.min.x,y:n.max.y-n.min.y,z:n.max.z-n.min.z}}get vertexCount(){return this._vertexCount}get polygonCount(){return this._polygonCount}get dimensions(){return this._dimensions}get initData(){return{vertices:this._vertices,indices:this._indices}}get pbData(){const e=Xm(this._vertices),t=new Uint32Array(this._indices);return{vertices:new Uint8Array(e.buffer),indices:new Uint8Array(t.buffer)}}}(Bm=zm||(zm={})).Plane="plane",Bm.Box="box",Bm.Mesh="mesh";const Zm={[bm.OTHER]:nd.Other,[bm.TABLE]:nd.Table,[bm.COUCH]:nd.Couch,[bm.FLOOR]:nd.Floor,[bm.CEILING]:nd.Ceiling,[bm.WALL_FACE]:nd.Wall,[bm.INVISIBLE_WALL_FACE]:nd.Window,[bm.INNER_WALL_FACE]:nd.Wall,[bm.DOOR_FRAME]:nd.Door,[bm.WINDOW_FRAME]:nd.Window,[bm.WALL_ART]:nd.WallArt,[bm.STORAGE]:nd.Shelf,[bm.BED]:nd.Bed,[bm.LAMP]:nd.Lamp,[bm.SCREEN]:nd.Screen,[bm.PLANT]:nd.Plant,[bm.GLOBAL_MESH]:nd.GlobalMesh,[bm.CHAIR]:nd.Couch,[bm.UNKNOWN]:nd.Other,[bm.OTHER_ROOM_FACE]:nd.Other,[bm.OPENING]:nd.Other,[bm.UNRECOGNIZED]:nd.Other};
583class Ym extends E{constructor(e=U()){super(void 0,new D({color:16777215*Math.random(),flatShading:!0})),this.name="generic spatial entity",this.isSpatialEntity=!0,this._componentMap=new Map,this._spatialUUID=e}get spatialUUID(){return this._spatialUUID}updateMatrixWorld(e){super.updateMatrixWorld(e)}addComponent(e,t){let i=null;switch(e){case Fm.Locatable:i=new Wm(this,t);break;case Fm.Bounded3D:i=new Gm(this,t);break;case Fm.Bounded2D:i=new Vm(this,t);break;case Fm.TriangleMesh:i=new Hm(this,t);break;case Fm.SemanticLabel:i=new qm(this,t)}i&&this._componentMap.set(e,i)}getComponent(e){return this._componentMap.get(e)}duplicate(){const e=new Ym;return this._componentMap.forEach(((t,i,n)=>{e.addComponent(t.type,t.initData)})),e}get nativeEntity(){if(!this._nativeEntity){const e=new vd({x:this.position.x,y:this.position.y,z:this.position.z,w:1},{x:this.quaternion.x,y:this.quaternion.y,z:this.quaternion.z,w:this.quaternion.w}),t=Zm[this.getComponent(Fm.SemanticLabel).semanticLabel];if(this.entityType===zm.Plane){const{offset:i,extent:n}=this.getComponent(Fm.Bounded2D),r=[new DOMPointReadOnly(i.x,0,i.y),new DOMPointReadOnly(i.x+n.x,0,i.y),new DOMPointReadOnly(i.x+n.x,0,i.y+n.y),new DOMPointReadOnly(i.x,0,i.y+n.y),new DOMPointReadOnly(i.x,0,i.y)];this._nativeEntity=new hd(e,r,t)}else if(this.entityType===zm.Box||this.entityType===zm.Mesh){const i=this.geometry.getAttribute("position").array,n=new Uint32Array(this.geometry.index.array);this._nativeEntity=new id(e,i,n,t)}}return this._nativeEntity}static fromPBJSON(e){const t=Im.fromJSON(e);if(t.locatable_META){const e=new Ym(t.uuid);return e.addComponent(Fm.Locatable,t.locatable_META),t.semanticLabel_META&&e.addComponent(Fm.SemanticLabel,t.semanticLabel_META),t.bounded2D_META?e.addComponent(Fm.Bounded2D,t.bounded2D_META):t.bounded3D_META?e.addComponent(Fm.Bounded3D,t.bounded3D_META):t.triangleMesh_META&&e.addComponent(Fm.TriangleMesh,t.triangleMesh_META),e}}get entityType(){return this.getComponent(Fm.Bounded2D)?zm.Plane:this.getComponent(Fm.Bounded3D)?zm.Box:this.getComponent(Fm.TriangleMesh)?zm.Mesh:void 0}static toPBJSON(e){var t,i,n,r,s;return{uuid:e.spatialUUID,locatable_META:null===(t=e.getComponent(Fm.Locatable))||void 0===t?void 0:t.pbData,boundary2D_META:void 0,bounded2D_META:null===(i=e.getComponent(Fm.Bounded2D))||void 0===i?void 0:i.pbData,bounded3D_META:null===(n=e.getComponent(Fm.Bounded3D))||void 0===n?void 0:n.pbData,semanticLabel_META:null===(r=e.getComponent(Fm.SemanticLabel))||void 0===r?void 0:r.pbData,roomLayout_META:void 0,spaceContainer_META:void 0,triangleMesh_META:null===(s=e.getComponent(Fm.TriangleMesh))||void 0===s?void 0:s.pbData,dynamicObject_META:void 0}}}const Qm={living_room:()=>r((()=>import("./living_room-C28_EfJp.js")),[]),meeting_room:()=>r((()=>import("./meeting_room-DgNiX7SI.js")),[]),music_room:()=>r((()=>import("./music_room-BKOUd__g.js")),[]),office_large:()=>r((()=>import("./office_large-DtWkgiV7.js")),[]),office_small:()=>r((()=>import("./office_small-DGRG9aO9.js")),[])},Km="0.2.4",Jm=new l(0,0,-1);class eg extends EventTarget{constructor(e){super(),this.xrDevice=e,this.trackedPlanes=new Set,this.trackedMeshes=new Set,this.version=Km,this.objectMap=new Map,this.planes=new y,this.boxes=new y,this.meshes=new y,this.tempPosition=new l,this.tempQuaternion=new h,this.tempDirection=new l,this.tempScale=new l,this.tempMatrix=new c,this.raycaster=new F,this.hitTestTarget=new y,this.hitTestMarker=new f,this.worldNormal=new l,this.normalMatrix=new j,this.scene=new P,this.scene.background=new p(4079166),this.camera=new k(50,window.innerWidth/window.innerHeight,.1,40),this.camera.position.set(0,1.6,5);const t=new z(50,50);this.scene.add(t),this.scene.add(this.planes,this.boxes,this.meshes),this.planes.renderOrder=1,this.boxes.renderOrder=2,this.meshes.renderOrder=3,this.planes.visible=!1,this.boxes.visible=!1,this.renderer=new I({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.domElement.style.position="fixed",this.renderer.domElement.style.top="50vh",this.renderer.domElement.style.left="50vw",this.renderer.domElement.style.transform="translate(-50%, -50%)",this.hitTestTarget.add(this.hitTestMarker),this.hitTestMarker.rotateX(Math.PI/2)}get environmentCanvas(){return this.renderer.domElement}get planesVisible(){return this.planes.visible}set planesVisible(e){this.planes.visible=e}get boundingBoxesVisible(){return this.boxes.visible}set boundingBoxesVisible(e){this.boxes.visible=e}get meshesVisible(){return this.meshes.visible}set meshesVisible(e){this.meshes.visible=e}render(){this.camera.position.copy(this.xrDevice.position),this.camera.quaternion.copy(this.xrDevice.quaternion);const e=this.xrDevice.fovy/Math.PI*180;let t=!1;this.camera.fov!==e&&(this.camera.fov=e,t=!0);const i=this.xrDevice.canvasDimensions;
583if(i){const e=this.renderer.domElement;(e.width!==i.width||e.height!==i.height)&&(this.camera.aspect=i.width/i.height,this.renderer.setSize(i.width,i.height),t=!0)}t&&this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)}deleteAll(){[...this.objectMap.values()].forEach((e=>{e.removeFromParent()})),this.objectMap.clear(),this.trackedMeshes.clear(),this.trackedPlanes.clear()}loadEnvironment(e){this.deleteAll(),e.spatialEntities.forEach((e=>{const t=Ym.fromPBJSON(e);if(t){switch(t.entityType){case zm.Box:this.boxes.add(t),this.trackedMeshes.add(t.nativeEntity);break;case zm.Plane:this.planes.add(t),this.trackedPlanes.add(t.nativeEntity);break;case zm.Mesh:this.meshes.add(t),this.trackedMeshes.add(t.nativeEntity)}const i=this.objectMap.get(e.uuid);i&&i.removeFromParent(),this.objectMap.set(e.uuid,t)}}))}loadDefaultEnvironment(e){if("undefined"!=typeof __IS_UMD__&&__IS_UMD__){fetch(`https://www.unpkg.com/@iwer/sem@${Km}/captures/${e}.json`).then((e=>{if(!e.ok)throw new Error(`Network response was not ok: ${e.statusText}`);return e.json()})).then((e=>{this.loadEnvironment(e)})).catch((e=>{}))}else{const t=Qm[e];if(!t)return;t().then((e=>{const t=e.default;this.loadEnvironment(t)})).catch((e=>{}))}}computeHitTestResults(e){this.tempMatrix.fromArray(e),this.tempMatrix.decompose(this.tempPosition,this.tempQuaternion,this.tempScale),this.tempDirection.copy(Jm).applyQuaternion(this.tempQuaternion).normalize(),this.raycaster.set(this.tempPosition,this.tempDirection);return this.raycaster.intersectObject(this.meshes,!0).map((e=>{var t;const i=e.point;if(this.hitTestTarget.position.copy(i),null===(t=e.face)||void 0===t?void 0:t.normal){this.worldNormal.copy(e.face.normal);const t=e.object;this.worldNormal.applyMatrix3(this.normalMatrix.getNormalMatrix(t.matrixWorld)).normalize(),this.hitTestTarget.lookAt(this.tempPosition.addVectors(i,this.worldNormal))}else this.hitTestTarget.quaternion.set(0,0,0,1);return this.hitTestTarget.updateMatrixWorld(!0),this.hitTestMarker.matrixWorld.toArray()}))}}const tg={metaQuest3:jp,metaQuest2:Dp,metaQuestPro:Fp,oculusQuest1:Np},ig=["office_small","meeting_room","living_room","music_room","office_large"],ng=["left","none","right"];function rg(e){var t,i,n;const r="string"==typeof e?e:e.type??"metaQuest3",s=new Pp(tg[r],"string"==typeof e?void 0:e);"string"!=typeof e&&(lg(s,e.headset),ag(s.hands,e.hand),ag(s.controllers,e.controller),s.primaryInputMode=e.primaryInputMode??"controller"),s.ipd="string"==typeof e?0:e.ipd??0,s.installRuntime(),s.installDevUI(ch);const o="string"==typeof e||e.syntheticEnvironment;return!1===o?s:(s.installSEM(eg),null===o?s:"string"==typeof o&&ig.includes(o)?(null==(t=s.sem)||t.loadDefaultEnvironment(o),s):!0===o||void 0===o?(null==(i=s.sem)||i.loadDefaultEnvironment(ig[0]),s):"object"==typeof o?(null==(n=s.sem)||n.loadEnvironment(o),s):(fetch(o).then((e=>e.json())).then((e=>{var t;return null==(t=s.sem)?void 0:t.loadEnvironment(e)})).catch(console.error),s))}const sg=new u,og=new h;function ag(e,t){if(null!=t)for(const i of ng)lg(e[i],t[i])}function lg(e,t){null!=e&&null!=t&&(cg(e.position,t.position),cg(sg,t.rotation),hg(e.quaternion,og.setFromEuler(sg)),hg(e.quaternion,t.quaternion))}function cg(e,t){if(null!=t){if(t instanceof u&&e instanceof u&&e.copy(t),Array.isArray(t))return e.x=t[0],e.y=t[1],void(e.z=t[2]);e.x=t.x,e.y=t.y,e.z=t.z}}function hg(e,t){if(null!=t){if(Array.isArray(t))return e.x=t[0],e.y=t[1],e.z=t[2],void(e.w=t[3]);e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w}}export{rg as emulate};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.