@needle-tools/engine 4.14.0-next.31f837e → 4.14.0-next.b2e3b1a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/components.needle.json +1 -1
- package/dist/{generateMeshBVH.worker-DFcS3P04.js → generateMeshBVH.worker-DiCnZlf3.js} +1 -1
- package/dist/{gltf-progressive-8voIgNp_.js → gltf-progressive-Bm_6aEi4.js} +4 -4
- package/dist/{gltf-progressive-BRRBj-nY.umd.cjs → gltf-progressive-BttGBXw6.umd.cjs} +3 -3
- package/dist/{gltf-progressive-Dkh3tG4-.min.js → gltf-progressive-T5WKTux5.min.js} +1 -1
- package/dist/{loader.worker-C6cXDgR1.js → loader.worker-BqODMeeW.js} +1 -1
- package/dist/{materialx-Dx8st96L.min.js → materialx-CJyQZtjt.min.js} +1 -1
- package/dist/{materialx-D66rYPqe.js → materialx-DMs1E08Z.js} +2 -2
- package/dist/{materialx-CxlgposR.umd.cjs → materialx-DaKKOoVk.umd.cjs} +1 -1
- package/dist/{needle-engine.bundle-BQXG5qbQ.umd.cjs → needle-engine.bundle-BC1QDiuv.umd.cjs} +139 -139
- package/dist/{needle-engine.bundle-D7w0XD7M.min.js → needle-engine.bundle-Bhgt3W8p.min.js} +134 -134
- package/dist/{needle-engine.bundle-Byl5i6zJ.js → needle-engine.bundle-CeQXs7Hh.js} +5966 -5880
- package/dist/needle-engine.d.ts +552 -31
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-Ce5-UWiA.min.js → postprocessing-06AXuvdv.min.js} +2 -2
- package/dist/{postprocessing-BkSpxpYB.js → postprocessing-CI2x8Cln.js} +4 -4
- package/dist/{postprocessing-DFVElmAh.umd.cjs → postprocessing-CPDcA21P.umd.cjs} +2 -2
- package/dist/{three-Bad8p1pf.umd.cjs → three-BjYim-vL.umd.cjs} +47 -47
- package/dist/{three-DFV1-P9z.js → three-Bvk2VKbF.js} +2 -2
- package/dist/{three-CWn13_u1.min.js → three-IG2qPafA.min.js} +2 -2
- package/dist/{three-examples-CO-tx3Sp.umd.cjs → three-examples-BMmNgNCN.umd.cjs} +1 -1
- package/dist/{three-examples-43yqn3mL.js → three-examples-CMYCd5nH.js} +1 -1
- package/dist/{three-examples-DKuJVGT4.min.js → three-examples-CQl1fFZp.min.js} +1 -1
- package/dist/{three-mesh-ui-DyEA5HQF.min.js → three-mesh-ui-5HVE2RV-.min.js} +1 -1
- package/dist/{three-mesh-ui-fSAQJxdI.js → three-mesh-ui-BlakAItG.js} +1 -1
- package/dist/{three-mesh-ui-ChzVOraf.umd.cjs → three-mesh-ui-D828VbQp.umd.cjs} +1 -1
- package/dist/{vendor-pe19S9r5.min.js → vendor-BxK0WKmT.min.js} +1 -1
- package/dist/{vendor-B51YffMU.umd.cjs → vendor-CIDkyBaO.umd.cjs} +1 -1
- package/dist/{vendor-CgpZ5ivC.js → vendor-ixwD-vv2.js} +1 -1
- package/lib/engine/api.d.ts +1 -1
- package/lib/engine/api.js +1 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_components.d.ts +1 -1
- package/lib/engine/engine_components.js +7 -3
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.d.ts +12 -0
- package/lib/engine/engine_context.js +29 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +16 -1
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.d.ts +223 -11
- package/lib/engine/engine_materialpropertyblock.js +303 -33
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +32 -3
- package/lib/engine-components/ReflectionProbe.js +57 -26
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/Renderer.d.ts +2 -0
- package/lib/engine-components/Renderer.js +30 -6
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererLightmap.js +2 -3
- package/lib/engine-components/RendererLightmap.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +0 -2
- package/lib/engine-components/SeeThrough.js +114 -88
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +2 -2
- package/lib/engine-components/web/ViewBox.js +2 -2
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/WebXRPlaneTracking.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
- package/package.json +4 -4
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_components.ts +7 -3
- package/src/engine/engine_context.ts +28 -2
- package/src/engine/engine_gltf_builtin_components.ts +17 -1
- package/src/engine/engine_materialpropertyblock.ts +405 -39
- package/src/engine-components/Camera.ts +2 -2
- package/src/engine-components/DropListener.ts +1 -1
- package/src/engine-components/Duplicatable.ts +1 -1
- package/src/engine-components/GroundProjection.ts +3 -0
- package/src/engine-components/NeedleMenu.ts +3 -0
- package/src/engine-components/NestedGltf.ts +1 -1
- package/src/engine-components/ReflectionProbe.ts +61 -30
- package/src/engine-components/Renderer.ts +34 -6
- package/src/engine-components/RendererLightmap.ts +2 -3
- package/src/engine-components/SeeThrough.ts +122 -107
- package/src/engine-components/SmoothFollow.ts +2 -2
- package/src/engine-components/ui/Button.ts +1 -1
- package/src/engine-components/ui/Raycaster.ts +1 -1
- package/src/engine-components/web/ViewBox.ts +9 -2
- package/src/engine-components/webxr/WebXRPlaneTracking.ts +3 -3
- package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -1
- package/src/engine-components/webxr/controllers/XRControllerMovement.ts +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const A=require("./three-Bad8p1pf.umd.cjs"),ze={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function Qa(r){const e=await fetch(r);if(e.ok)return e.json();throw new Error(e.statusText)}async function Cl(r){return await Qa(`${r}/profilesList.json`)}async function wl(r,e,t=null,n=!0){if(!r)throw new Error("No xrInputSource supplied");const i=await Cl(e);let s;if(r.profiles.some(c=>{const l=i[c];return l&&(s={profileId:c,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!t)throw new Error("No matching profile name found");const c=i[t];if(!c)throw new Error(`No matching profile name found and default profile "${t}" missing.`);s={profileId:t,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}}const a=await Qa(s.profilePath);let o;if(n){let c;if(r.handedness==="any"?c=a.layouts[Object.keys(a.layouts)[0]]:c=a.layouts[r.handedness],!c)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);c.assetPath&&(o=s.profilePath.replace("profile.json",c.assetPath))}return{profile:a,assetPath:o}}const Pl={xAxis:0,yAxis:0,button:0,state:ze.ComponentState.DEFAULT};function El(r=0,e=0){let t=r,n=e;if(Math.sqrt(r*r+e*e)>1){const a=Math.atan2(e,r);t=Math.cos(a),n=Math.sin(a)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:n*.5+.5}}class kl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===ze.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Pl)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:i}){const{normalizedXAxis:s,normalizedYAxis:a}=El(e,t);switch(this.componentProperty){case ze.ComponentProperty.X_AXIS:this.value=this.states.includes(i)?s:.5;break;case ze.ComponentProperty.Y_AXIS:this.value=this.states.includes(i)?a:.5;break;case ze.ComponentProperty.BUTTON:this.value=this.states.includes(i)?n:0;break;case ze.ComponentProperty.STATE:this.valueNodeProperty===ze.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(i):this.value=this.states.includes(i)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class Rl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(n=>{const i=new kl(t.visualResponses[n]);this.visualResponses[n]=i}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:ze.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=ze.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=ze.ComponentState.PRESSED:(t.touched||this.values.button>ze.ButtonTouchThreshold)&&(this.values.state=ze.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===ze.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>ze.AxisTouchThreshold&&(this.values.state=ze.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===ze.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>ze.AxisTouchThreshold&&(this.values.state=ze.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Al{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(i=>{const s=this.layoutDescription.components[i];this.components[i]=new Rl(i,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const as=2,zt=4,$t=4,ec=4,Qt=new Int32Array(2),Go=new Float32Array(Qt.buffer),$o=new Float64Array(Qt.buffer),Ki=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class Ht{constructor(e,t){this.low=e|0,this.high=t|0}static create(e,t){return e==0&&t==0?Ht.ZERO:new Ht(e,t)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(e){return this.low==e.low&&this.high==e.high}}Ht.ZERO=new Ht(0,0);var Ds;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ds||(Ds={}));class li{constructor(e){this.bytes_=e,this.position_=0}static allocate(e){return new li(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return new Ht(this.readInt32(e),this.readInt32(e+4))}readUint64(e){return new Ht(this.readUint32(e),this.readUint32(e+4))}readFloat32(e){return Qt[0]=this.readInt32(e),Go[0]}readFloat64(e){return Qt[Ki?0:1]=this.readInt32(e),Qt[Ki?1:0]=this.readInt32(e+4),$o[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)}writeUint64(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)}writeFloat32(e,t){Go[0]=t,this.writeInt32(e,Qt[0])}writeFloat64(e,t){$o[0]=t,this.writeInt32(e,Qt[Ki?0:1]),this.writeInt32(e+4,Qt[Ki?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+zt+$t)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<$t;t++)e+=String.fromCharCode(this.readInt8(this.position_+zt+t));return e}__offset(e,t){const n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const n=this.readInt32(e);let i="",s=0;if(e+=zt,t===Ds.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;s<n;){let a;const o=this.readUint8(e+s++);if(o<192)a=o;else{const c=this.readUint8(e+s++);if(o<224)a=(o&31)<<6|c&63;else{const l=this.readUint8(e+s++);if(o<240)a=(o&15)<<12|(c&63)<<6|l&63;else{const u=this.readUint8(e+s++);a=(o&7)<<18|(c&63)<<12|(l&63)<<6|u&63}}}a<65536?i+=String.fromCharCode(a):(a-=65536,i+=String.fromCharCode((a>>10)+55296,(a&1023)+56320))}return i}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+zt}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=$t)throw new Error("FlatBuffers: file identifier must be length "+$t);for(let t=0;t<$t;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+zt+t))return!1;return!0}createLong(e,t){return Ht.create(e,t)}createScalarList(e,t){const n=[];for(let i=0;i<t;++i)e(i)!==null&&n.push(e(i));return n}createObjList(e,t){const n=[];for(let i=0;i<t;++i){const s=e(i);s!==null&&n.push(s.unpack())}return n}}class ao{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let t;e?t=e:t=1024,this.bb=li.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);const n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){const i=this.bb.capacity();this.bb=ao.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||!t.equals(n))&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){const t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const n=t<<1,i=li.allocate(n);return i.setPosition(n-t),i.bytes().set(e.bytes(),n-t),i}addOffset(e){this.prep(zt,0),this.writeInt32(this.offset()-e+zt)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const e=this.offset();let t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);const n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);const i=2;this.addInt16(e-this.object_start);const s=(n+i)*as;this.addInt16(s);let a=0;const o=this.space;e:for(t=0;t<this.vtables.length;t++){const c=this.bb.capacity()-this.vtables[t];if(s==this.bb.readInt16(c)){for(let l=as;l<s;l+=as)if(this.bb.readInt16(o+l)!=this.bb.readInt16(c+l))continue e;a=this.vtables[t];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){const i=n?ec:0;if(t){const s=t;if(this.prep(this.minalign,zt+$t+i),s.length!=$t)throw new Error("FlatBuffers: file identifier must be length "+$t);for(let a=$t-1;a>=0;a--)this.writeInt8(s.charCodeAt(a))}this.prep(this.minalign,zt+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){const n=this.bb.capacity()-e,i=n-this.bb.readInt32(n);if(!(this.bb.readInt16(i+t)!=0))throw new Error("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(zt,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);const t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(!e)return 0;let t;if(e instanceof Uint8Array)t=e;else{t=[];let n=0;for(;n<e.length;){let i;const s=e.charCodeAt(n++);if(s<55296||s>=56320)i=s;else{const a=e.charCodeAt(n++);i=(s<<10)+a+-56613888}i<128?t.push(i):(i<2048?t.push(i>>6&31|192):(i<65536?t.push(i>>12&15|224):t.push(i>>18&7|240,i>>12&63|128),t.push(i>>6&63|128)),t.push(i&63|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(let n=0,i=this.space,s=this.bb.bytes();n<t.length;n++)s[i++]=t[n];return this.endVector()}createLong(e,t){return Ht.create(e,t)}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){const t=[];for(let n=0;n<e.length;++n){const i=e[n];if(i!==null)t.push(this.createObjectOffset(i));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e),this.endVector()}}function Vr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var cs={exports:{}},Wo;function Ho(){return Wo||(Wo=1,(function(r){var e={};e.useBlobBuilder=(function(){try{return new Blob([]),!1}catch{return!0}})(),e.useArrayBufferView=!e.useBlobBuilder&&(function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}})(),r.exports.binaryFeatures=e;var t=r.exports.BlobBuilder;typeof window<"u"&&(t=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function n(){this._pieces=[],this._parts=[]}n.prototype.append=function(i){typeof i=="number"?this._pieces.push(i):(this.flush(),this._parts.push(i))},n.prototype.flush=function(){if(this._pieces.length>0){var i=new Uint8Array(this._pieces);e.useArrayBufferView||(i=i.buffer),this._parts.push(i),this._pieces=[]}},n.prototype.getBuffer=function(){if(this.flush(),e.useBlobBuilder){for(var i=new t,s=0,a=this._parts.length;s<a;s++)i.append(this._parts[s]);return i.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=n})(cs)),cs.exports}var ls,qo;function Ol(){if(qo)return ls;qo=1;var r=Ho().BufferBuilder,e=Ho().binaryFeatures,t={unpack:function(o){var c=new n(o);return c.unpack()},pack:function(o){var c=new i;c.pack(o);var l=c.getBuffer();return l}};ls=t;function n(o){this.index=0,this.dataBuffer=o,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}n.prototype.unpack=function(){var o=this.unpack_uint8();if(o<128)return o;if((o^224)<32)return(o^224)-32;var c;if((c=o^160)<=15)return this.unpack_raw(c);if((c=o^176)<=15)return this.unpack_string(c);if((c=o^144)<=15)return this.unpack_array(c);if((c=o^128)<=15)return this.unpack_map(c);switch(o){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return c=this.unpack_uint16(),this.unpack_string(c);case 217:return c=this.unpack_uint32(),this.unpack_string(c);case 218:return c=this.unpack_uint16(),this.unpack_raw(c);case 219:return c=this.unpack_uint32(),this.unpack_raw(c);case 220:return c=this.unpack_uint16(),this.unpack_array(c);case 221:return c=this.unpack_uint32(),this.unpack_array(c);case 222:return c=this.unpack_uint16(),this.unpack_map(c);case 223:return c=this.unpack_uint32(),this.unpack_map(c)}},n.prototype.unpack_uint8=function(){var o=this.dataView[this.index]&255;return this.index++,o},n.prototype.unpack_uint16=function(){var o=this.read(2),c=(o[0]&255)*256+(o[1]&255);return this.index+=2,c},n.prototype.unpack_uint32=function(){var o=this.read(4),c=((o[0]*256+o[1])*256+o[2])*256+o[3];return this.index+=4,c},n.prototype.unpack_uint64=function(){var o=this.read(8),c=((((((o[0]*256+o[1])*256+o[2])*256+o[3])*256+o[4])*256+o[5])*256+o[6])*256+o[7];return this.index+=8,c},n.prototype.unpack_int8=function(){var o=this.unpack_uint8();return o<128?o:o-256},n.prototype.unpack_int16=function(){var o=this.unpack_uint16();return o<32768?o:o-65536},n.prototype.unpack_int32=function(){var o=this.unpack_uint32();return o<Math.pow(2,31)?o:o-Math.pow(2,32)},n.prototype.unpack_int64=function(){var o=this.unpack_uint64();return o<Math.pow(2,63)?o:o-Math.pow(2,64)},n.prototype.unpack_raw=function(o){if(this.length<this.index+o)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+o+" "+this.length);var c=this.dataBuffer.slice(this.index,this.index+o);return this.index+=o,c},n.prototype.unpack_string=function(o){for(var c=this.read(o),l=0,u="",f,p;l<o;)f=c[l],f<128?(u+=String.fromCharCode(f),l++):(f^192)<32?(p=(f^192)<<6|c[l+1]&63,u+=String.fromCharCode(p),l+=2):(p=(f&15)<<12|(c[l+1]&63)<<6|c[l+2]&63,u+=String.fromCharCode(p),l+=3);return this.index+=o,u},n.prototype.unpack_array=function(o){for(var c=new Array(o),l=0;l<o;l++)c[l]=this.unpack();return c},n.prototype.unpack_map=function(o){for(var c={},l=0;l<o;l++){var u=this.unpack(),f=this.unpack();c[u]=f}return c},n.prototype.unpack_float=function(){var o=this.unpack_uint32(),c=o>>31,l=(o>>23&255)-127,u=o&8388607|8388608;return(c===0?1:-1)*u*Math.pow(2,l-23)},n.prototype.unpack_double=function(){var o=this.unpack_uint32(),c=this.unpack_uint32(),l=o>>31,u=(o>>20&2047)-1023,f=o&1048575|1048576,p=f*Math.pow(2,u-20)+c*Math.pow(2,u-52);return(l===0?1:-1)*p},n.prototype.read=function(o){var c=this.index;if(c+o<=this.length)return this.dataView.subarray(c,c+o);throw new Error("BinaryPackFailure: read index out of range")};function i(){this.bufferBuilder=new r}i.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()},i.prototype.pack=function(o){var c=typeof o;if(c==="string")this.pack_string(o);else if(c==="number")Math.floor(o)===o?this.pack_integer(o):this.pack_double(o);else if(c==="boolean")o===!0?this.bufferBuilder.append(195):o===!1&&this.bufferBuilder.append(194);else if(c==="undefined")this.bufferBuilder.append(192);else if(c==="object")if(o===null)this.bufferBuilder.append(192);else{var l=o.constructor;if(l==Array)this.pack_array(o);else if(l==Blob||l==File||o instanceof Blob||o instanceof File)this.pack_bin(o);else if(l==ArrayBuffer)e.useArrayBufferView?this.pack_bin(new Uint8Array(o)):this.pack_bin(o);else if("BYTES_PER_ELEMENT"in o)e.useArrayBufferView?this.pack_bin(new Uint8Array(o.buffer)):this.pack_bin(o.buffer);else if(l==Object||l.toString().startsWith("class"))this.pack_object(o);else if(l==Date)this.pack_string(o.toString());else if(typeof o.toBinaryPack=="function")this.bufferBuilder.append(o.toBinaryPack());else throw new Error('Type "'+l.toString()+'" not yet supported')}else throw new Error('Type "'+c+'" not yet supported');this.bufferBuilder.flush()},i.prototype.pack_bin=function(o){var c=o.length||o.byteLength||o.size;if(c<=15)this.pack_uint8(160+c);else if(c<=65535)this.bufferBuilder.append(218),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(c);else throw new Error("Invalid length");this.bufferBuilder.append(o)},i.prototype.pack_string=function(o){var c=a(o);if(c<=15)this.pack_uint8(176+c);else if(c<=65535)this.bufferBuilder.append(216),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(c);else throw new Error("Invalid length");this.bufferBuilder.append(o)},i.prototype.pack_array=function(o){var c=o.length;if(c<=15)this.pack_uint8(144+c);else if(c<=65535)this.bufferBuilder.append(220),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(c);else throw new Error("Invalid length");for(var l=0;l<c;l++)this.pack(o[l])},i.prototype.pack_integer=function(o){if(o>=-32&&o<=127)this.bufferBuilder.append(o&255);else if(o>=0&&o<=255)this.bufferBuilder.append(204),this.pack_uint8(o);else if(o>=-128&&o<=127)this.bufferBuilder.append(208),this.pack_int8(o);else if(o>=0&&o<=65535)this.bufferBuilder.append(205),this.pack_uint16(o);else if(o>=-32768&&o<=32767)this.bufferBuilder.append(209),this.pack_int16(o);else if(o>=0&&o<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(o);else if(o>=-2147483648&&o<=2147483647)this.bufferBuilder.append(210),this.pack_int32(o);else if(o>=-9223372036854776e3&&o<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(o);else if(o>=0&&o<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(o);else throw new Error("Invalid integer")},i.prototype.pack_double=function(o){var c=0;o<0&&(c=1,o=-o);var l=Math.floor(Math.log(o)/Math.LN2),u=o/Math.pow(2,l)-1,f=Math.floor(u*Math.pow(2,52)),p=Math.pow(2,32),m=c<<31|l+1023<<20|f/p&1048575,x=f%p;this.bufferBuilder.append(203),this.pack_int32(m),this.pack_int32(x)},i.prototype.pack_object=function(o){var c=Object.keys(o),l=c.length;if(l<=15)this.pack_uint8(128+l);else if(l<=65535)this.bufferBuilder.append(222),this.pack_uint16(l);else if(l<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(l);else throw new Error("Invalid length");for(var u in o)o.hasOwnProperty(u)&&(this.pack(u),this.pack(o[u]))},i.prototype.pack_uint8=function(o){this.bufferBuilder.append(o)},i.prototype.pack_uint16=function(o){this.bufferBuilder.append(o>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_uint32=function(o){var c=o&4294967295;this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255)},i.prototype.pack_uint64=function(o){var c=o/Math.pow(2,32),l=o%Math.pow(2,32);this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255),this.bufferBuilder.append((l&4278190080)>>>24),this.bufferBuilder.append((l&16711680)>>>16),this.bufferBuilder.append((l&65280)>>>8),this.bufferBuilder.append(l&255)},i.prototype.pack_int8=function(o){this.bufferBuilder.append(o&255)},i.prototype.pack_int16=function(o){this.bufferBuilder.append((o&65280)>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_int32=function(o){this.bufferBuilder.append(o>>>24&255),this.bufferBuilder.append((o&16711680)>>>16),this.bufferBuilder.append((o&65280)>>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_int64=function(o){var c=Math.floor(o/Math.pow(2,32)),l=o%Math.pow(2,32);this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255),this.bufferBuilder.append((l&4278190080)>>>24),this.bufferBuilder.append((l&16711680)>>>16),this.bufferBuilder.append((l&65280)>>>8),this.bufferBuilder.append(l&255)};function s(o){var c=o.charCodeAt(0);return c<=2047?"00":c<=65535?"000":c<=2097151?"0000":c<=67108863?"00000":"000000"}function a(o){return o.length>600?new Blob([o]).size:o.replace(/[^\u0000-\u007F]/g,s).length}return ls}var zl=Ol();const Xo=Vr(zl);let tc=!0,nc=!0;function ii(r,e,t){const n=r.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function Jn(r,e,t){if(!r.RTCPeerConnection)return;const n=r.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(a,o){if(a!==e)return i.apply(this,arguments);const c=l=>{const u=t(l);u&&(o.handleEvent?o.handleEvent(u):o(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,c),i.apply(this,[a,c])};const s=n.removeEventListener;n.removeEventListener=function(a,o){if(a!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(o))return s.apply(this,arguments);const c=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[a,c])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}function Il(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(tc=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Bl(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(nc=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function co(){if(typeof window=="object"){if(tc)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Jr(r,e){nc&&console.warn(r+" is deprecated, please use "+e+" instead.")}function Nl(r){const e={browser:null,version:null};if(typeof r>"u"||!r.navigator)return e.browser="Not a browser.",e;const{navigator:t}=r;if(t.mozGetUserMedia)e.browser="firefox",e.version=ii(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)e.browser="chrome",e.version=ii(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))e.browser="edge",e.version=ii(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=ii(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Yo(r){return Object.prototype.toString.call(r)==="[object Object]"}function ic(r){return Yo(r)?Object.keys(r).reduce(function(e,t){const n=Yo(r[t]),i=n?ic(r[t]):r[t],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,{[t]:i})},{}):r}function Fs(r,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?Fs(r,r.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach(i=>{Fs(r,r.get(i),t)})}))}function Zo(r,e,t){const n=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const s=[];return r.forEach(a=>{a.type==="track"&&a.trackIdentifier===e.id&&s.push(a)}),s.forEach(a=>{r.forEach(o=>{o.type===n&&o.trackId===a.id&&Fs(r,o,i)})}),i}const Ko=co;function rc(r,e){const t=r&&r.navigator;if(!t.mediaDevices)return;const n=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const c={};return Object.keys(o).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof o[l]=="object"?o[l]:{ideal:o[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const f=function(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){c.optional=c.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",l)]=u.ideal,c.optional.push(p),p={},p[f("max",l)]=u.ideal,c.optional.push(p)):(p[f("",l)]=u.ideal,c.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[f("",l)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[f(p,l)]=u[p])})}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},i=function(o,c){if(e.version>=61)return c(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const l=function(u,f,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};o=JSON.parse(JSON.stringify(o)),l(o.audio,"autoGainControl","googAutoGainControl"),l(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&typeof o.video=="object"){let l=o.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=e.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete o.video.facingMode;let f;if(l.exact==="environment"||l.ideal==="environment"?f=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(f=["front"]),f)return t.mediaDevices.enumerateDevices().then(p=>{p=p.filter(x=>x.kind==="videoinput");let m=p.find(x=>f.some(T=>x.label.toLowerCase().includes(T)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(o.video.deviceId=l.exact?{exact:m.deviceId}:{ideal:m.deviceId}),o.video=n(o.video),Ko("chrome: "+JSON.stringify(o)),c(o)})}o.video=n(o.video)}return Ko("chrome: "+JSON.stringify(o)),c(o)},s=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},a=function(o,c,l){i(o,u=>{t.webkitGetUserMedia(u,c,f=>{l&&l(s(f))})})};if(t.getUserMedia=a.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);Object.getOwnPropertyDescriptor(t.mediaDevices,"getUserMedia")?.writable&&(t.mediaDevices.getUserMedia=function(c){return i(c,l=>o(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))})}}function Ul(r,e){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof e!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(i=>{const s=n.video&&n.video.width,a=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:o||3}},s&&(n.video.mandatory.maxWidth=s),a&&(n.video.mandatory.maxHeight=a),r.navigator.mediaDevices.getUserMedia(n)})}}}function sc(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function oc(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):s={track:i.track};const a=new Event("track");a.track=i.track,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],this.dispatchEvent(a)}),n.stream.getTracks().forEach(i=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(o=>o.track&&o.track.id===i.id):s={track:i};const a=new Event("track");a.track=i,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],this.dispatchEvent(a)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Jn(r,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function ac(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const e=function(i,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=i.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:i}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){let l=i.apply(this,arguments);return l||(l=e(this,o),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){s.apply(this,arguments);const c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}const t=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],t.apply(this,[s]),s.getTracks().forEach(a=>{this._senders.push(e(this,a))})};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],n.apply(this,[s]),s.getTracks().forEach(a=>{const o=this._senders.find(c=>c.track===a);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function cc(r){if(!r.RTCPeerConnection)return;const e=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[n,i,s]=arguments;if(arguments.length>0&&typeof n=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof n!="function"))return e.apply(this,[]);const a=function(c){const l={};return c.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),l[p.id]=p}),l},o=function(c){return new Map(Object.keys(c).map(l=>[l,c[l]]))};if(arguments.length>=2){const c=function(l){i(o(a(l)))};return e.apply(this,[c,n])}return new Promise((c,l)=>{e.apply(this,[function(u){c(o(a(u)))},l])}).then(i,s)}}function lc(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;t&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=t.apply(this,[]);return s.forEach(a=>a._pc=this),s});const n=r.RTCPeerConnection.prototype.addTrack;n&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=n.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(a=>Zo(a,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const t=r.RTCPeerConnection.prototype.getReceivers;t&&(r.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(s=>s._pc=this),i}),Jn(r,"track",n=>(n.receiver._pc=n.srcElement,n)),r.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(s=>Zo(s,i.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const e=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const n=arguments[0];let i,s,a;return this.getSenders().forEach(o=>{o.track===n&&(i?a=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===n&&(s?a=!0:s=o),o.track===n)),a||i&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function uc(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(a=>this._shimmedLocalStreams[a][0])};const e=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(a,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(c)===-1&&this._shimmedLocalStreams[o.id].push(c):this._shimmedLocalStreams[o.id]=[o,c],c};const t=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(a){this._shimmedLocalStreams=this._shimmedLocalStreams||{},a.getTracks().forEach(l=>{if(this.getSenders().find(f=>f.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const c=this.getSenders().filter(l=>o.indexOf(l)===-1);this._shimmedLocalStreams[a.id]=[a].concat(c)};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(a){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[a.id],n.apply(this,arguments)};const i=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(a){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},a&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const c=this._shimmedLocalStreams[o].indexOf(a);c!==-1&&this._shimmedLocalStreams[o].splice(c,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function hc(r,e){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&e.version>=65)return uc(r);const t=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const n=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(f=>{if(this.getSenders().find(m=>m.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const f=new r.MediaStream(u.getTracks());this._streams[u.id]=f,this._reverseStreams[f.id]=u,u=f}n.apply(this,[u])};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const p=[].slice.call(arguments,1);if(p.length!==1||!p[0].getTracks().find(T=>T===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(T=>T.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const x=this._streams[f.id];if(x)x.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const T=new r.MediaStream([u]);this._streams[f.id]=T,this._reverseStreams[T.id]=f,this.addStream(T)}return this.getSenders().find(T=>T.track===u)};function s(l,u){let f=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(p=>{const m=l._reverseStreams[p],x=l._streams[m.id];f=f.replace(new RegExp(x.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:f})}function a(l,u){let f=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(p=>{const m=l._reverseStreams[p],x=l._streams[m.id];f=f.replace(new RegExp(m.id,"g"),x.id)}),new RTCSessionDescription({type:u.type,sdp:f})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],f={[l](){const p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[x=>{const T=s(this,x);p[0].apply(null,[T])},x=>{p[1]&&p[1].apply(null,x)},arguments[2]]):u.apply(this,arguments).then(x=>s(this,x))}};r.RTCPeerConnection.prototype[l]=f[l]});const o=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=a(this,arguments[0]),o.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=c.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(T=>u.track===T)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Ls(r,e){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=r.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};r.RTCPeerConnection.prototype[t]=i[t]})}function fc(r,e){Jn(r,"negotiationneeded",t=>{const n=t.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return t})}const Qo=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:fc,shimAddTrackRemoveTrack:hc,shimAddTrackRemoveTrackWithNative:uc,shimGetDisplayMedia:Ul,shimGetSendersWithDtmf:ac,shimGetStats:cc,shimGetUserMedia:rc,shimMediaStream:sc,shimOnTrack:oc,shimPeerConnection:Ls,shimSenderReceiverGetStats:lc},Symbol.toStringTag,{value:"Module"}));function Dl(r,e){let t=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(n=>{if(n&&(n.urls||n.url)){let i=n.urls||n.url;n.url&&!n.urls&&Jr("RTCIceServer.url","RTCIceServer.urls");const s=typeof i=="string";return s&&(i=[i]),i=i.filter(a=>{if(a.indexOf("stun:")===0)return!1;const o=a.startsWith("turn")&&!a.startsWith("turn:[")&&a.includes("transport=udp");return o&&!t?(t=!0,!0):o&&!t}),delete n.url,n.urls=s?i[0]:i,!!i.length}})}var us={exports:{}},ea;function dc(){return ea||(ea=1,(function(r){var e={};e.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
|
1
|
+
"use strict";const A=require("./three-BjYim-vL.umd.cjs"),ze={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function Qa(r){const e=await fetch(r);if(e.ok)return e.json();throw new Error(e.statusText)}async function Cl(r){return await Qa(`${r}/profilesList.json`)}async function wl(r,e,t=null,n=!0){if(!r)throw new Error("No xrInputSource supplied");const i=await Cl(e);let s;if(r.profiles.some(c=>{const l=i[c];return l&&(s={profileId:c,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!t)throw new Error("No matching profile name found");const c=i[t];if(!c)throw new Error(`No matching profile name found and default profile "${t}" missing.`);s={profileId:t,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}}const a=await Qa(s.profilePath);let o;if(n){let c;if(r.handedness==="any"?c=a.layouts[Object.keys(a.layouts)[0]]:c=a.layouts[r.handedness],!c)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);c.assetPath&&(o=s.profilePath.replace("profile.json",c.assetPath))}return{profile:a,assetPath:o}}const Pl={xAxis:0,yAxis:0,button:0,state:ze.ComponentState.DEFAULT};function El(r=0,e=0){let t=r,n=e;if(Math.sqrt(r*r+e*e)>1){const a=Math.atan2(e,r);t=Math.cos(a),n=Math.sin(a)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:n*.5+.5}}class kl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===ze.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Pl)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:i}){const{normalizedXAxis:s,normalizedYAxis:a}=El(e,t);switch(this.componentProperty){case ze.ComponentProperty.X_AXIS:this.value=this.states.includes(i)?s:.5;break;case ze.ComponentProperty.Y_AXIS:this.value=this.states.includes(i)?a:.5;break;case ze.ComponentProperty.BUTTON:this.value=this.states.includes(i)?n:0;break;case ze.ComponentProperty.STATE:this.valueNodeProperty===ze.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(i):this.value=this.states.includes(i)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class Rl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(n=>{const i=new kl(t.visualResponses[n]);this.visualResponses[n]=i}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:ze.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=ze.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=ze.ComponentState.PRESSED:(t.touched||this.values.button>ze.ButtonTouchThreshold)&&(this.values.state=ze.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===ze.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>ze.AxisTouchThreshold&&(this.values.state=ze.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===ze.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>ze.AxisTouchThreshold&&(this.values.state=ze.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Al{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(i=>{const s=this.layoutDescription.components[i];this.components[i]=new Rl(i,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const as=2,zt=4,$t=4,ec=4,Qt=new Int32Array(2),Go=new Float32Array(Qt.buffer),$o=new Float64Array(Qt.buffer),Ki=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class Ht{constructor(e,t){this.low=e|0,this.high=t|0}static create(e,t){return e==0&&t==0?Ht.ZERO:new Ht(e,t)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(e){return this.low==e.low&&this.high==e.high}}Ht.ZERO=new Ht(0,0);var Ds;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ds||(Ds={}));class li{constructor(e){this.bytes_=e,this.position_=0}static allocate(e){return new li(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return new Ht(this.readInt32(e),this.readInt32(e+4))}readUint64(e){return new Ht(this.readUint32(e),this.readUint32(e+4))}readFloat32(e){return Qt[0]=this.readInt32(e),Go[0]}readFloat64(e){return Qt[Ki?0:1]=this.readInt32(e),Qt[Ki?1:0]=this.readInt32(e+4),$o[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)}writeUint64(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)}writeFloat32(e,t){Go[0]=t,this.writeInt32(e,Qt[0])}writeFloat64(e,t){$o[0]=t,this.writeInt32(e,Qt[Ki?0:1]),this.writeInt32(e+4,Qt[Ki?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+zt+$t)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<$t;t++)e+=String.fromCharCode(this.readInt8(this.position_+zt+t));return e}__offset(e,t){const n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const n=this.readInt32(e);let i="",s=0;if(e+=zt,t===Ds.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;s<n;){let a;const o=this.readUint8(e+s++);if(o<192)a=o;else{const c=this.readUint8(e+s++);if(o<224)a=(o&31)<<6|c&63;else{const l=this.readUint8(e+s++);if(o<240)a=(o&15)<<12|(c&63)<<6|l&63;else{const u=this.readUint8(e+s++);a=(o&7)<<18|(c&63)<<12|(l&63)<<6|u&63}}}a<65536?i+=String.fromCharCode(a):(a-=65536,i+=String.fromCharCode((a>>10)+55296,(a&1023)+56320))}return i}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+zt}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=$t)throw new Error("FlatBuffers: file identifier must be length "+$t);for(let t=0;t<$t;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+zt+t))return!1;return!0}createLong(e,t){return Ht.create(e,t)}createScalarList(e,t){const n=[];for(let i=0;i<t;++i)e(i)!==null&&n.push(e(i));return n}createObjList(e,t){const n=[];for(let i=0;i<t;++i){const s=e(i);s!==null&&n.push(s.unpack())}return n}}class ao{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let t;e?t=e:t=1024,this.bb=li.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);const n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){const i=this.bb.capacity();this.bb=ao.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||!t.equals(n))&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){const t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const n=t<<1,i=li.allocate(n);return i.setPosition(n-t),i.bytes().set(e.bytes(),n-t),i}addOffset(e){this.prep(zt,0),this.writeInt32(this.offset()-e+zt)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const e=this.offset();let t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);const n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);const i=2;this.addInt16(e-this.object_start);const s=(n+i)*as;this.addInt16(s);let a=0;const o=this.space;e:for(t=0;t<this.vtables.length;t++){const c=this.bb.capacity()-this.vtables[t];if(s==this.bb.readInt16(c)){for(let l=as;l<s;l+=as)if(this.bb.readInt16(o+l)!=this.bb.readInt16(c+l))continue e;a=this.vtables[t];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){const i=n?ec:0;if(t){const s=t;if(this.prep(this.minalign,zt+$t+i),s.length!=$t)throw new Error("FlatBuffers: file identifier must be length "+$t);for(let a=$t-1;a>=0;a--)this.writeInt8(s.charCodeAt(a))}this.prep(this.minalign,zt+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){const n=this.bb.capacity()-e,i=n-this.bb.readInt32(n);if(!(this.bb.readInt16(i+t)!=0))throw new Error("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(zt,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);const t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(!e)return 0;let t;if(e instanceof Uint8Array)t=e;else{t=[];let n=0;for(;n<e.length;){let i;const s=e.charCodeAt(n++);if(s<55296||s>=56320)i=s;else{const a=e.charCodeAt(n++);i=(s<<10)+a+-56613888}i<128?t.push(i):(i<2048?t.push(i>>6&31|192):(i<65536?t.push(i>>12&15|224):t.push(i>>18&7|240,i>>12&63|128),t.push(i>>6&63|128)),t.push(i&63|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(let n=0,i=this.space,s=this.bb.bytes();n<t.length;n++)s[i++]=t[n];return this.endVector()}createLong(e,t){return Ht.create(e,t)}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){const t=[];for(let n=0;n<e.length;++n){const i=e[n];if(i!==null)t.push(this.createObjectOffset(i));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e),this.endVector()}}function Vr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var cs={exports:{}},Wo;function Ho(){return Wo||(Wo=1,(function(r){var e={};e.useBlobBuilder=(function(){try{return new Blob([]),!1}catch{return!0}})(),e.useArrayBufferView=!e.useBlobBuilder&&(function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}})(),r.exports.binaryFeatures=e;var t=r.exports.BlobBuilder;typeof window<"u"&&(t=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function n(){this._pieces=[],this._parts=[]}n.prototype.append=function(i){typeof i=="number"?this._pieces.push(i):(this.flush(),this._parts.push(i))},n.prototype.flush=function(){if(this._pieces.length>0){var i=new Uint8Array(this._pieces);e.useArrayBufferView||(i=i.buffer),this._parts.push(i),this._pieces=[]}},n.prototype.getBuffer=function(){if(this.flush(),e.useBlobBuilder){for(var i=new t,s=0,a=this._parts.length;s<a;s++)i.append(this._parts[s]);return i.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=n})(cs)),cs.exports}var ls,qo;function Ol(){if(qo)return ls;qo=1;var r=Ho().BufferBuilder,e=Ho().binaryFeatures,t={unpack:function(o){var c=new n(o);return c.unpack()},pack:function(o){var c=new i;c.pack(o);var l=c.getBuffer();return l}};ls=t;function n(o){this.index=0,this.dataBuffer=o,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}n.prototype.unpack=function(){var o=this.unpack_uint8();if(o<128)return o;if((o^224)<32)return(o^224)-32;var c;if((c=o^160)<=15)return this.unpack_raw(c);if((c=o^176)<=15)return this.unpack_string(c);if((c=o^144)<=15)return this.unpack_array(c);if((c=o^128)<=15)return this.unpack_map(c);switch(o){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return c=this.unpack_uint16(),this.unpack_string(c);case 217:return c=this.unpack_uint32(),this.unpack_string(c);case 218:return c=this.unpack_uint16(),this.unpack_raw(c);case 219:return c=this.unpack_uint32(),this.unpack_raw(c);case 220:return c=this.unpack_uint16(),this.unpack_array(c);case 221:return c=this.unpack_uint32(),this.unpack_array(c);case 222:return c=this.unpack_uint16(),this.unpack_map(c);case 223:return c=this.unpack_uint32(),this.unpack_map(c)}},n.prototype.unpack_uint8=function(){var o=this.dataView[this.index]&255;return this.index++,o},n.prototype.unpack_uint16=function(){var o=this.read(2),c=(o[0]&255)*256+(o[1]&255);return this.index+=2,c},n.prototype.unpack_uint32=function(){var o=this.read(4),c=((o[0]*256+o[1])*256+o[2])*256+o[3];return this.index+=4,c},n.prototype.unpack_uint64=function(){var o=this.read(8),c=((((((o[0]*256+o[1])*256+o[2])*256+o[3])*256+o[4])*256+o[5])*256+o[6])*256+o[7];return this.index+=8,c},n.prototype.unpack_int8=function(){var o=this.unpack_uint8();return o<128?o:o-256},n.prototype.unpack_int16=function(){var o=this.unpack_uint16();return o<32768?o:o-65536},n.prototype.unpack_int32=function(){var o=this.unpack_uint32();return o<Math.pow(2,31)?o:o-Math.pow(2,32)},n.prototype.unpack_int64=function(){var o=this.unpack_uint64();return o<Math.pow(2,63)?o:o-Math.pow(2,64)},n.prototype.unpack_raw=function(o){if(this.length<this.index+o)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+o+" "+this.length);var c=this.dataBuffer.slice(this.index,this.index+o);return this.index+=o,c},n.prototype.unpack_string=function(o){for(var c=this.read(o),l=0,u="",f,p;l<o;)f=c[l],f<128?(u+=String.fromCharCode(f),l++):(f^192)<32?(p=(f^192)<<6|c[l+1]&63,u+=String.fromCharCode(p),l+=2):(p=(f&15)<<12|(c[l+1]&63)<<6|c[l+2]&63,u+=String.fromCharCode(p),l+=3);return this.index+=o,u},n.prototype.unpack_array=function(o){for(var c=new Array(o),l=0;l<o;l++)c[l]=this.unpack();return c},n.prototype.unpack_map=function(o){for(var c={},l=0;l<o;l++){var u=this.unpack(),f=this.unpack();c[u]=f}return c},n.prototype.unpack_float=function(){var o=this.unpack_uint32(),c=o>>31,l=(o>>23&255)-127,u=o&8388607|8388608;return(c===0?1:-1)*u*Math.pow(2,l-23)},n.prototype.unpack_double=function(){var o=this.unpack_uint32(),c=this.unpack_uint32(),l=o>>31,u=(o>>20&2047)-1023,f=o&1048575|1048576,p=f*Math.pow(2,u-20)+c*Math.pow(2,u-52);return(l===0?1:-1)*p},n.prototype.read=function(o){var c=this.index;if(c+o<=this.length)return this.dataView.subarray(c,c+o);throw new Error("BinaryPackFailure: read index out of range")};function i(){this.bufferBuilder=new r}i.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()},i.prototype.pack=function(o){var c=typeof o;if(c==="string")this.pack_string(o);else if(c==="number")Math.floor(o)===o?this.pack_integer(o):this.pack_double(o);else if(c==="boolean")o===!0?this.bufferBuilder.append(195):o===!1&&this.bufferBuilder.append(194);else if(c==="undefined")this.bufferBuilder.append(192);else if(c==="object")if(o===null)this.bufferBuilder.append(192);else{var l=o.constructor;if(l==Array)this.pack_array(o);else if(l==Blob||l==File||o instanceof Blob||o instanceof File)this.pack_bin(o);else if(l==ArrayBuffer)e.useArrayBufferView?this.pack_bin(new Uint8Array(o)):this.pack_bin(o);else if("BYTES_PER_ELEMENT"in o)e.useArrayBufferView?this.pack_bin(new Uint8Array(o.buffer)):this.pack_bin(o.buffer);else if(l==Object||l.toString().startsWith("class"))this.pack_object(o);else if(l==Date)this.pack_string(o.toString());else if(typeof o.toBinaryPack=="function")this.bufferBuilder.append(o.toBinaryPack());else throw new Error('Type "'+l.toString()+'" not yet supported')}else throw new Error('Type "'+c+'" not yet supported');this.bufferBuilder.flush()},i.prototype.pack_bin=function(o){var c=o.length||o.byteLength||o.size;if(c<=15)this.pack_uint8(160+c);else if(c<=65535)this.bufferBuilder.append(218),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(c);else throw new Error("Invalid length");this.bufferBuilder.append(o)},i.prototype.pack_string=function(o){var c=a(o);if(c<=15)this.pack_uint8(176+c);else if(c<=65535)this.bufferBuilder.append(216),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(c);else throw new Error("Invalid length");this.bufferBuilder.append(o)},i.prototype.pack_array=function(o){var c=o.length;if(c<=15)this.pack_uint8(144+c);else if(c<=65535)this.bufferBuilder.append(220),this.pack_uint16(c);else if(c<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(c);else throw new Error("Invalid length");for(var l=0;l<c;l++)this.pack(o[l])},i.prototype.pack_integer=function(o){if(o>=-32&&o<=127)this.bufferBuilder.append(o&255);else if(o>=0&&o<=255)this.bufferBuilder.append(204),this.pack_uint8(o);else if(o>=-128&&o<=127)this.bufferBuilder.append(208),this.pack_int8(o);else if(o>=0&&o<=65535)this.bufferBuilder.append(205),this.pack_uint16(o);else if(o>=-32768&&o<=32767)this.bufferBuilder.append(209),this.pack_int16(o);else if(o>=0&&o<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(o);else if(o>=-2147483648&&o<=2147483647)this.bufferBuilder.append(210),this.pack_int32(o);else if(o>=-9223372036854776e3&&o<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(o);else if(o>=0&&o<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(o);else throw new Error("Invalid integer")},i.prototype.pack_double=function(o){var c=0;o<0&&(c=1,o=-o);var l=Math.floor(Math.log(o)/Math.LN2),u=o/Math.pow(2,l)-1,f=Math.floor(u*Math.pow(2,52)),p=Math.pow(2,32),m=c<<31|l+1023<<20|f/p&1048575,x=f%p;this.bufferBuilder.append(203),this.pack_int32(m),this.pack_int32(x)},i.prototype.pack_object=function(o){var c=Object.keys(o),l=c.length;if(l<=15)this.pack_uint8(128+l);else if(l<=65535)this.bufferBuilder.append(222),this.pack_uint16(l);else if(l<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(l);else throw new Error("Invalid length");for(var u in o)o.hasOwnProperty(u)&&(this.pack(u),this.pack(o[u]))},i.prototype.pack_uint8=function(o){this.bufferBuilder.append(o)},i.prototype.pack_uint16=function(o){this.bufferBuilder.append(o>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_uint32=function(o){var c=o&4294967295;this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255)},i.prototype.pack_uint64=function(o){var c=o/Math.pow(2,32),l=o%Math.pow(2,32);this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255),this.bufferBuilder.append((l&4278190080)>>>24),this.bufferBuilder.append((l&16711680)>>>16),this.bufferBuilder.append((l&65280)>>>8),this.bufferBuilder.append(l&255)},i.prototype.pack_int8=function(o){this.bufferBuilder.append(o&255)},i.prototype.pack_int16=function(o){this.bufferBuilder.append((o&65280)>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_int32=function(o){this.bufferBuilder.append(o>>>24&255),this.bufferBuilder.append((o&16711680)>>>16),this.bufferBuilder.append((o&65280)>>>8),this.bufferBuilder.append(o&255)},i.prototype.pack_int64=function(o){var c=Math.floor(o/Math.pow(2,32)),l=o%Math.pow(2,32);this.bufferBuilder.append((c&4278190080)>>>24),this.bufferBuilder.append((c&16711680)>>>16),this.bufferBuilder.append((c&65280)>>>8),this.bufferBuilder.append(c&255),this.bufferBuilder.append((l&4278190080)>>>24),this.bufferBuilder.append((l&16711680)>>>16),this.bufferBuilder.append((l&65280)>>>8),this.bufferBuilder.append(l&255)};function s(o){var c=o.charCodeAt(0);return c<=2047?"00":c<=65535?"000":c<=2097151?"0000":c<=67108863?"00000":"000000"}function a(o){return o.length>600?new Blob([o]).size:o.replace(/[^\u0000-\u007F]/g,s).length}return ls}var zl=Ol();const Xo=Vr(zl);let tc=!0,nc=!0;function ii(r,e,t){const n=r.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function Jn(r,e,t){if(!r.RTCPeerConnection)return;const n=r.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(a,o){if(a!==e)return i.apply(this,arguments);const c=l=>{const u=t(l);u&&(o.handleEvent?o.handleEvent(u):o(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,c),i.apply(this,[a,c])};const s=n.removeEventListener;n.removeEventListener=function(a,o){if(a!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(o))return s.apply(this,arguments);const c=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[a,c])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}function Il(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(tc=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Bl(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(nc=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function co(){if(typeof window=="object"){if(tc)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Jr(r,e){nc&&console.warn(r+" is deprecated, please use "+e+" instead.")}function Nl(r){const e={browser:null,version:null};if(typeof r>"u"||!r.navigator)return e.browser="Not a browser.",e;const{navigator:t}=r;if(t.mozGetUserMedia)e.browser="firefox",e.version=ii(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)e.browser="chrome",e.version=ii(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))e.browser="edge",e.version=ii(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=ii(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Yo(r){return Object.prototype.toString.call(r)==="[object Object]"}function ic(r){return Yo(r)?Object.keys(r).reduce(function(e,t){const n=Yo(r[t]),i=n?ic(r[t]):r[t],s=n&&!Object.keys(i).length;return i===void 0||s?e:Object.assign(e,{[t]:i})},{}):r}function Fs(r,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?Fs(r,r.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach(i=>{Fs(r,r.get(i),t)})}))}function Zo(r,e,t){const n=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const s=[];return r.forEach(a=>{a.type==="track"&&a.trackIdentifier===e.id&&s.push(a)}),s.forEach(a=>{r.forEach(o=>{o.type===n&&o.trackId===a.id&&Fs(r,o,i)})}),i}const Ko=co;function rc(r,e){const t=r&&r.navigator;if(!t.mediaDevices)return;const n=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const c={};return Object.keys(o).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof o[l]=="object"?o[l]:{ideal:o[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const f=function(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){c.optional=c.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",l)]=u.ideal,c.optional.push(p),p={},p[f("max",l)]=u.ideal,c.optional.push(p)):(p[f("",l)]=u.ideal,c.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[f("",l)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[f(p,l)]=u[p])})}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},i=function(o,c){if(e.version>=61)return c(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const l=function(u,f,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};o=JSON.parse(JSON.stringify(o)),l(o.audio,"autoGainControl","googAutoGainControl"),l(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&typeof o.video=="object"){let l=o.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=e.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete o.video.facingMode;let f;if(l.exact==="environment"||l.ideal==="environment"?f=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(f=["front"]),f)return t.mediaDevices.enumerateDevices().then(p=>{p=p.filter(x=>x.kind==="videoinput");let m=p.find(x=>f.some(T=>x.label.toLowerCase().includes(T)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(o.video.deviceId=l.exact?{exact:m.deviceId}:{ideal:m.deviceId}),o.video=n(o.video),Ko("chrome: "+JSON.stringify(o)),c(o)})}o.video=n(o.video)}return Ko("chrome: "+JSON.stringify(o)),c(o)},s=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},a=function(o,c,l){i(o,u=>{t.webkitGetUserMedia(u,c,f=>{l&&l(s(f))})})};if(t.getUserMedia=a.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);Object.getOwnPropertyDescriptor(t.mediaDevices,"getUserMedia")?.writable&&(t.mediaDevices.getUserMedia=function(c){return i(c,l=>o(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))})}}function Ul(r,e){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof e!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(i=>{const s=n.video&&n.video.width,a=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:o||3}},s&&(n.video.mandatory.maxWidth=s),a&&(n.video.mandatory.maxHeight=a),r.navigator.mediaDevices.getUserMedia(n)})}}}function sc(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function oc(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):s={track:i.track};const a=new Event("track");a.track=i.track,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],this.dispatchEvent(a)}),n.stream.getTracks().forEach(i=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(o=>o.track&&o.track.id===i.id):s={track:i};const a=new Event("track");a.track=i,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],this.dispatchEvent(a)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Jn(r,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function ac(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const e=function(i,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=i.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:i}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){let l=i.apply(this,arguments);return l||(l=e(this,o),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){s.apply(this,arguments);const c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}const t=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],t.apply(this,[s]),s.getTracks().forEach(a=>{this._senders.push(e(this,a))})};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],n.apply(this,[s]),s.getTracks().forEach(a=>{const o=this._senders.find(c=>c.track===a);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function cc(r){if(!r.RTCPeerConnection)return;const e=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[n,i,s]=arguments;if(arguments.length>0&&typeof n=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof n!="function"))return e.apply(this,[]);const a=function(c){const l={};return c.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),l[p.id]=p}),l},o=function(c){return new Map(Object.keys(c).map(l=>[l,c[l]]))};if(arguments.length>=2){const c=function(l){i(o(a(l)))};return e.apply(this,[c,n])}return new Promise((c,l)=>{e.apply(this,[function(u){c(o(a(u)))},l])}).then(i,s)}}function lc(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;t&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=t.apply(this,[]);return s.forEach(a=>a._pc=this),s});const n=r.RTCPeerConnection.prototype.addTrack;n&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=n.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(a=>Zo(a,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const t=r.RTCPeerConnection.prototype.getReceivers;t&&(r.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(s=>s._pc=this),i}),Jn(r,"track",n=>(n.receiver._pc=n.srcElement,n)),r.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(s=>Zo(s,i.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const e=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const n=arguments[0];let i,s,a;return this.getSenders().forEach(o=>{o.track===n&&(i?a=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===n&&(s?a=!0:s=o),o.track===n)),a||i&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function uc(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(a=>this._shimmedLocalStreams[a][0])};const e=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(a,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(c)===-1&&this._shimmedLocalStreams[o.id].push(c):this._shimmedLocalStreams[o.id]=[o,c],c};const t=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(a){this._shimmedLocalStreams=this._shimmedLocalStreams||{},a.getTracks().forEach(l=>{if(this.getSenders().find(f=>f.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const c=this.getSenders().filter(l=>o.indexOf(l)===-1);this._shimmedLocalStreams[a.id]=[a].concat(c)};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(a){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[a.id],n.apply(this,arguments)};const i=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(a){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},a&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const c=this._shimmedLocalStreams[o].indexOf(a);c!==-1&&this._shimmedLocalStreams[o].splice(c,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function hc(r,e){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&e.version>=65)return uc(r);const t=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const n=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(f=>{if(this.getSenders().find(m=>m.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const f=new r.MediaStream(u.getTracks());this._streams[u.id]=f,this._reverseStreams[f.id]=u,u=f}n.apply(this,[u])};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const p=[].slice.call(arguments,1);if(p.length!==1||!p[0].getTracks().find(T=>T===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(T=>T.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const x=this._streams[f.id];if(x)x.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const T=new r.MediaStream([u]);this._streams[f.id]=T,this._reverseStreams[T.id]=f,this.addStream(T)}return this.getSenders().find(T=>T.track===u)};function s(l,u){let f=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(p=>{const m=l._reverseStreams[p],x=l._streams[m.id];f=f.replace(new RegExp(x.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:f})}function a(l,u){let f=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(p=>{const m=l._reverseStreams[p],x=l._streams[m.id];f=f.replace(new RegExp(m.id,"g"),x.id)}),new RTCSessionDescription({type:u.type,sdp:f})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],f={[l](){const p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[x=>{const T=s(this,x);p[0].apply(null,[T])},x=>{p[1]&&p[1].apply(null,x)},arguments[2]]):u.apply(this,arguments).then(x=>s(this,x))}};r.RTCPeerConnection.prototype[l]=f[l]});const o=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=a(this,arguments[0]),o.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=c.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(T=>u.track===T)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Ls(r,e){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const n=r.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};r.RTCPeerConnection.prototype[t]=i[t]})}function fc(r,e){Jn(r,"negotiationneeded",t=>{const n=t.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return t})}const Qo=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:fc,shimAddTrackRemoveTrack:hc,shimAddTrackRemoveTrackWithNative:uc,shimGetDisplayMedia:Ul,shimGetSendersWithDtmf:ac,shimGetStats:cc,shimGetUserMedia:rc,shimMediaStream:sc,shimOnTrack:oc,shimPeerConnection:Ls,shimSenderReceiverGetStats:lc},Symbol.toStringTag,{value:"Module"}));function Dl(r,e){let t=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(n=>{if(n&&(n.urls||n.url)){let i=n.urls||n.url;n.url&&!n.urls&&Jr("RTCIceServer.url","RTCIceServer.urls");const s=typeof i=="string";return s&&(i=[i]),i=i.filter(a=>{if(a.indexOf("stun:")===0)return!1;const o=a.startsWith("turn")&&!a.startsWith("turn:[")&&a.includes("transport=udp");return o&&!t?(t=!0,!0):o&&!t}),delete n.url,n.urls=s?i[0]:i,!!i.length}})}var us={exports:{}},ea;function dc(){return ea||(ea=1,(function(r){var e={};e.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
|
2
2
|
`).map(function(n){return n.trim()})},e.splitSections=function(t){var n=t.split(`
|
|
3
3
|
m=`);return n.map(function(i,s){return(s>0?"m="+i:i).trim()+`\r
|
|
4
4
|
`})},e.getDescription=function(t){var n=e.splitSections(t);return n&&n[0]},e.getMediaSections=function(t){var n=e.splitSections(t);return n.shift(),n},e.matchPrefix=function(t,n){return e.splitLines(t).filter(function(i){return i.indexOf(n)===0})},e.parseCandidate=function(t){var n;t.indexOf("a=candidate:")===0?n=t.substring(12).split(" "):n=t.substring(10).split(" ");for(var i={foundation:n[0],component:parseInt(n[1],10),protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]},s=8;s<n.length;s+=2)switch(n[s]){case"raddr":i.relatedAddress=n[s+1];break;case"rport":i.relatedPort=parseInt(n[s+1],10);break;case"tcptype":i.tcpType=n[s+1];break;case"ufrag":i.ufrag=n[s+1],i.usernameFragment=n[s+1];break;default:i[n[s]]=n[s+1];break}return i},e.writeCandidate=function(t){var n=[];n.push(t.foundation),n.push(t.component),n.push(t.protocol.toUpperCase()),n.push(t.priority),n.push(t.address||t.ip),n.push(t.port);var i=t.type;return n.push("typ"),n.push(i),i!=="host"&&t.relatedAddress&&t.relatedPort&&(n.push("raddr"),n.push(t.relatedAddress),n.push("rport"),n.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(n.push("ufrag"),n.push(t.usernameFragment||t.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(t){return t.substr(14).split(" ")},e.parseRtpMap=function(t){var n=t.substr(9).split(" "),i={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),i.name=n[0],i.clockRate=parseInt(n[1],10),i.channels=n.length===3?parseInt(n[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){var n=t.payloadType;t.preferredPayloadType!==void 0&&(n=t.preferredPayloadType);var i=t.channels||t.numChannels||1;return"a=rtpmap:"+n+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlaneGeometry as gc, ShaderChunk as Kl, Object3D as vc, Layers as Br, MeshBasicMaterial as sa, DoubleSide as Xs, AdditiveBlending as Sc, InstancedBufferAttribute as mn, DynamicDrawUsage as ee, InstancedBufferGeometry as Ql, Uniform$1 as Re, ShaderMaterial as Ys, BufferGeometry as yi, BufferAttribute as he, Mesh as Zr, MeshStandardMaterial as tu, MeshPhysicalMaterial as eu, Triangle as Mn, Vector3 as H, Box3 as Le, Matrix4 as Oe, Line3 as tn, Plane as xc, Vector2 as hn, BackSide as nu, REVISION as _c, Ray as iu, FrontSide as oa, LineSegments as bc, LineLoop as Tc, Line as Cc, Points as Mc, Sphere as ru, BatchedMesh as su, Matrix3 as ou, Vector4 as To, SkinnedMesh as au, InterpolateDiscrete as cu, InterpolateLinear as wc, AnimationClip as lu, QuaternionKeyframeTrack as uu, ColorKeyframeTrack as hu, VectorKeyframeTrack as fu, BooleanKeyframeTrack as du, NumberKeyframeTrack as pu, PropertyBinding as aa } from "./three-
|
|
1
|
+
import { PlaneGeometry as gc, ShaderChunk as Kl, Object3D as vc, Layers as Br, MeshBasicMaterial as sa, DoubleSide as Xs, AdditiveBlending as Sc, InstancedBufferAttribute as mn, DynamicDrawUsage as ee, InstancedBufferGeometry as Ql, Uniform$1 as Re, ShaderMaterial as Ys, BufferGeometry as yi, BufferAttribute as he, Mesh as Zr, MeshStandardMaterial as tu, MeshPhysicalMaterial as eu, Triangle as Mn, Vector3 as H, Box3 as Le, Matrix4 as Oe, Line3 as tn, Plane as xc, Vector2 as hn, BackSide as nu, REVISION as _c, Ray as iu, FrontSide as oa, LineSegments as bc, LineLoop as Tc, Line as Cc, Points as Mc, Sphere as ru, BatchedMesh as su, Matrix3 as ou, Vector4 as To, SkinnedMesh as au, InterpolateDiscrete as cu, InterpolateLinear as wc, AnimationClip as lu, QuaternionKeyframeTrack as uu, ColorKeyframeTrack as hu, VectorKeyframeTrack as fu, BooleanKeyframeTrack as du, NumberKeyframeTrack as pu, PropertyBinding as aa } from "./three-Bvk2VKbF.js";
|
|
2
2
|
const It = {
|
|
3
3
|
ComponentState: Object.freeze({
|
|
4
4
|
DEFAULT: "default",
|
package/lib/engine/api.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export { hasCommercialLicense, hasIndieLicense, hasProLicense } from "./engine_l
|
|
|
44
44
|
export * from "./engine_lifecycle_api.js";
|
|
45
45
|
export { NeedleEngineModelLoader } from "./engine_loaders.callbacks.js";
|
|
46
46
|
export { loadAsset, loadSync, parseSync } from "./engine_loaders.js";
|
|
47
|
+
export { MaterialPropertyBlock } from "./engine_materialpropertyblock.js";
|
|
47
48
|
export * from "./engine_math.js";
|
|
48
49
|
export { MODULES as NEEDLE_ENGINE_MODULES } from "./engine_modules.js";
|
|
49
50
|
export * from "./engine_networking.js";
|
|
@@ -55,7 +56,6 @@ export * from "./engine_networking_peer.js";
|
|
|
55
56
|
export * from "./engine_networking_streams.js";
|
|
56
57
|
export * from "./engine_networking_types.js";
|
|
57
58
|
export * from "./engine_networking_utils.js";
|
|
58
|
-
export { MaterialPropertyBlock } from "./engine_materialpropertyblock.js";
|
|
59
59
|
export * from "./engine_patcher.js";
|
|
60
60
|
export * from "./engine_physics.js";
|
|
61
61
|
export * from "./engine_physics.types.js";
|
package/lib/engine/api.js
CHANGED
|
@@ -44,6 +44,7 @@ export { hasCommercialLicense, hasIndieLicense, hasProLicense } from "./engine_l
|
|
|
44
44
|
export * from "./engine_lifecycle_api.js";
|
|
45
45
|
export { NeedleEngineModelLoader } from "./engine_loaders.callbacks.js";
|
|
46
46
|
export { loadAsset, loadSync, parseSync } from "./engine_loaders.js";
|
|
47
|
+
export { MaterialPropertyBlock } from "./engine_materialpropertyblock.js";
|
|
47
48
|
export * from "./engine_math.js";
|
|
48
49
|
export { MODULES as NEEDLE_ENGINE_MODULES } from "./engine_modules.js";
|
|
49
50
|
export * from "./engine_networking.js";
|
|
@@ -55,7 +56,6 @@ export * from "./engine_networking_peer.js";
|
|
|
55
56
|
export * from "./engine_networking_streams.js";
|
|
56
57
|
export * from "./engine_networking_types.js";
|
|
57
58
|
export * from "./engine_networking_utils.js";
|
|
58
|
-
export { MaterialPropertyBlock } from "./engine_materialpropertyblock.js";
|
|
59
59
|
export * from "./engine_patcher.js";
|
|
60
60
|
export * from "./engine_physics.js";
|
|
61
61
|
export * from "./engine_physics.types.js";
|
package/lib/engine/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/engine/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACt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C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC9D,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,aAAa,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { Object3D, Scene } from "three";
|
|
|
2
2
|
import type { ComponentInit, Constructor, ConstructorConcrete, IComponent } from "./engine_types.js";
|
|
3
3
|
export declare function removeComponent<T extends IComponent>(go: Object3D, componentInstance: T): T;
|
|
4
4
|
export declare function getOrAddComponent<T extends IComponent>(go: Object3D, typeName: ConstructorConcrete<T>, init?: ComponentInit<T>): T;
|
|
5
|
-
export declare function addNewComponent<T extends IComponent>(obj: Object3D, componentInstance: T, callAwake?: boolean): T;
|
|
5
|
+
export declare function addNewComponent<T extends IComponent>(obj: Object3D, componentInstance: T, callAwake?: boolean, register?: boolean): T;
|
|
6
6
|
export declare function addComponent<T extends IComponent>(obj: Object3D, componentInstance: T | ConstructorConcrete<T>, init?: ComponentInit<T>, opts?: {
|
|
7
7
|
callAwake: boolean;
|
|
8
8
|
}): T;
|
|
@@ -40,7 +40,7 @@ export function getOrAddComponent(go, typeName, init) {
|
|
|
40
40
|
return addComponent(go, typeName, init);
|
|
41
41
|
}
|
|
42
42
|
const idProvider = new InstantiateIdProvider("addComponentIdProvider");
|
|
43
|
-
export function addNewComponent(obj, componentInstance, callAwake = true) {
|
|
43
|
+
export function addNewComponent(obj, componentInstance, callAwake = true, register = true) {
|
|
44
44
|
if (!obj) {
|
|
45
45
|
new Error("Can not add componet to null object");
|
|
46
46
|
}
|
|
@@ -55,8 +55,12 @@ export function addNewComponent(obj, componentInstance, callAwake = true) {
|
|
|
55
55
|
componentInstance.guid = idProvider.generateUUID();
|
|
56
56
|
}
|
|
57
57
|
apply(obj);
|
|
58
|
-
// register the component
|
|
59
|
-
|
|
58
|
+
// register the component with the context so it enters the lifecycle pipeline (awake, onEnable, start, update...)
|
|
59
|
+
// when register is false, the component is only attached to the object but not registered for lifecycle activation.
|
|
60
|
+
// use Context.registerSceneComponents() to batch-register components later.
|
|
61
|
+
if (register) {
|
|
62
|
+
registerComponent(componentInstance, componentInstance.context);
|
|
63
|
+
}
|
|
60
64
|
try {
|
|
61
65
|
if (callAwake && componentInstance.__internalAwake) {
|
|
62
66
|
updateActiveInHierarchyWithoutEventCall(obj);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine_components.js","sourceRoot":"","sources":["../../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ratio or orthorgraphic camera size. This is automatically called when a DOM size change is detected.
|
|
408
408
|
*/
|
|
409
409
|
updateAspect(camera: PerspectiveCamera | OrthographicCamera, width?: number, height?: number): void;
|
|
410
|
+
/**
|
|
411
|
+
* Registers all uninitialized components found in the scene hierarchy with this context.
|
|
412
|
+
* Components that have been added to objects (e.g. via `addComponent`) but are not yet registered
|
|
413
|
+
* with a context will be collected and queued for initialization.
|
|
414
|
+
* On the next frame, these components will go through the full lifecycle: `awake` → `onEnable` → `start` → `update`.
|
|
415
|
+
*
|
|
416
|
+
* This is useful when components are created outside of the normal glTF loading pipeline,
|
|
417
|
+
* for example in an editor that adds components during edit mode and then needs to activate them for play mode.
|
|
418
|
+
* @param root The root object to search for components. Defaults to the context's scene.
|
|
419
|
+
* @returns The number of components that were newly registered.
|
|
420
|
+
*/
|
|
421
|
+
registerSceneComponents(root?: Object3D): number;
|
|
410
422
|
/** This will recreate the whole needle engine context and dispose the whole scene content
|
|
411
423
|
* All content will be reloaded (loading times might be faster due to browser caches)
|
|
412
424
|
* All scripts will be recreated */
|
|
@@ -666,6 +666,35 @@ export class Context {
|
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
+
/**
|
|
670
|
+
* Registers all uninitialized components found in the scene hierarchy with this context.
|
|
671
|
+
* Components that have been added to objects (e.g. via `addComponent`) but are not yet registered
|
|
672
|
+
* with a context will be collected and queued for initialization.
|
|
673
|
+
* On the next frame, these components will go through the full lifecycle: `awake` → `onEnable` → `start` → `update`.
|
|
674
|
+
*
|
|
675
|
+
* This is useful when components are created outside of the normal glTF loading pipeline,
|
|
676
|
+
* for example in an editor that adds components during edit mode and then needs to activate them for play mode.
|
|
677
|
+
* @param root The root object to search for components. Defaults to the context's scene.
|
|
678
|
+
* @returns The number of components that were newly registered.
|
|
679
|
+
*/
|
|
680
|
+
registerSceneComponents(root) {
|
|
681
|
+
const searchRoot = root ?? this.scene;
|
|
682
|
+
if (!searchRoot)
|
|
683
|
+
return 0;
|
|
684
|
+
let count = 0;
|
|
685
|
+
foreachComponent(searchRoot, (comp) => {
|
|
686
|
+
// Skip components that are already registered with this context
|
|
687
|
+
if (this.scripts.includes(comp))
|
|
688
|
+
return;
|
|
689
|
+
if (this.new_scripts.includes(comp))
|
|
690
|
+
return;
|
|
691
|
+
if (this.new_script_start.includes(comp))
|
|
692
|
+
return;
|
|
693
|
+
this.new_scripts.push(comp);
|
|
694
|
+
count++;
|
|
695
|
+
}, true);
|
|
696
|
+
return count;
|
|
697
|
+
}
|
|
669
698
|
/** This will recreate the whole needle engine context and dispose the whole scene content
|
|
670
699
|
* All content will be reloaded (loading times might be faster due to browser caches)
|
|
671
700
|
* All scripts will be recreated */
|