UNPKG

x_ite

Version:

X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.

2 lines 1.38 MB
/* X_ITE v12.2.4 */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.X3D=t():e.X3D=t()}(self,()=>(()=>{var t={477(e,t,i){"use strict";i.d(t,{A:()=>a});var n=i(5185),s=i(2696);function r(e=0,t=e,i=t){this.x=e,this.y=t,this.z=i}Object.assign(r.prototype,{*[Symbol.iterator](){yield this.x,yield this.y,yield this.z},copy(){const e=Object.create(r.prototype);return e.x=this.x,e.y=this.y,e.z=this.z,e},assign({x:e,y:t,z:i}){return this.x=e,this.y=t,this.z=i,this},set(e=0,t=e,i=t){return this.x=e,this.y=t,this.z=i,this},equals({x:e,y:t,z:i}){return this.x===e&&this.y===t&&this.z===i},negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},inverse(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this},add({x:e,y:t,z:i}){return this.x+=e,this.y+=t,this.z+=i,this},subtract({x:e,y:t,z:i}){return this.x-=e,this.y-=t,this.z-=i,this},multiply(e){return this.x*=e,this.y*=e,this.z*=e,this},multVec({x:e,y:t,z:i}){return this.x*=e,this.y*=t,this.z*=i,this},divide(e){return this.x/=e,this.y/=e,this.z/=e,this},divVec({x:e,y:t,z:i}){return this.x/=e,this.y/=t,this.z/=i,this},cross({x:e,y:t,z:i}){const{x:n,y:s,z:r}=this;return this.x=s*i-r*t,this.y=r*e-n*i,this.z=n*t-s*e,this},normalize(){const e=Math.hypot(this.x,this.y,this.z);return e&&(this.x/=e,this.y/=e,this.z/=e),this},dot({x:e,y:t,z:i}){return this.x*e+this.y*t+this.z*i},squaredNorm(){const{x:e,y:t,z:i}=this;return e*e+t*t+i*i},norm(){return Math.hypot(this.x,this.y,this.z)},distance({x:e,y:t,z:i}){return Math.hypot(this.x-e,this.y-t,this.z-i)},lerp({x:e,y:t,z:i},n){const{x:s,y:r,z:o}=this;return this.x=s+n*(e-s),this.y=r+n*(t-r),this.z=o+n*(i-o),this},slerp:(()=>{const e=new r;return function(t,i){return n.A.simpleSlerp(this,e.assign(t),i)}})(),abs(){const{x:e,y:t,z:i}=this;return this.x=Math.abs(e),this.y=Math.abs(t),this.z=Math.abs(i),this},min(e){let{x:t,y:i,z:n}=this;for(const{x:e,y:s,z:r}of arguments)t=Math.min(t,e),i=Math.min(i,s),n=Math.min(n,r);return this.x=t,this.y=i,this.z=n,this},max(e){let{x:t,y:i,z:n}=this;for(const{x:e,y:s,z:r}of arguments)t=Math.max(t,e),i=Math.max(i,s),n=Math.max(n,r);return this.x=t,this.y=i,this.z=n,this},clamp({x:e,y:t,z:i},{x:s,y:r,z:o}){return this.x=n.A.clamp(this.x,e,s),this.y=n.A.clamp(this.y,t,r),this.z=n.A.clamp(this.z,i,o),this},toString(){return this.x+" "+this.y+" "+this.z}});for(const e of Object.keys(r.prototype))Object.defineProperty(r.prototype,e,{enumerable:!1});Object.defineProperties(r.prototype,{length:{value:3},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}},2:{get(){return this.z},set(e){this.z=e}}}),Object.assign(r,{ZERO:Object.freeze(new r),ONE:Object.freeze(new r(1)),X_AXIS:Object.freeze(new r(1,0,0)),Y_AXIS:Object.freeze(new r(0,1,0)),Z_AXIS:Object.freeze(new r(0,0,1)),NEGATIVE_ONE:Object.freeze(new r(-1)),NEGATIVE_X_AXIS:Object.freeze(new r(-1,0,0)),NEGATIVE_Y_AXIS:Object.freeze(new r(0,-1,0)),NEGATIVE_Z_AXIS:Object.freeze(new r(0,0,-1))});const o=r,a=s.A.add("Vector3",o)},608(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(2696);let s=0;const r=Object.freeze({BBOX:s++,POINTER:s++,CAMERA:s++,PICKING:s++,COLLISION:s++,SHADOW:s++,DISPLAY:s++}),o=n.A.add("TraverseType",r)},611(e,t,i){"use strict";i.d(t,{A:()=>l});var n=i(3097),s=i(2417),r=i(2696);function o(e=[]){return n.A.call(this,Array.from(e,e=>[e.name,e]),s.A)}Object.setPrototypeOf(o.prototype,n.A.prototype);for(const e of Object.keys(o.prototype))Object.defineProperty(o.prototype,e,{enumerable:!1});Object.defineProperties(o,{typeName:{value:"ExternProtoDeclarationArray",enumerable:!0}});const a=o,l=r.A.add("ExternProtoDeclarationArray",a)},620(e){var t;t=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={exports:{},id:n,loaded:!1};return e[n].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}return i.m=e,i.c=t,i.p="",i(0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotPNG=function(e){return e===a},t.isNotAPNG=function(e){return e===l},t.default=function(e){var t=new Uint8Array(e);if(Array.prototype.some.call(h,function(e,i){return e!==t[i]}))return a;var i=!1;if(c(t,function(e){return!(i="acTL"===e)}),!i)return l;var n=[],s=[],r=null,u=null,f=0,m=new o.APNG;if(c(t,function(e,t,i,a){var l=new DataView(t.buffer);switch(e){case"IHDR":r=t.subarray(i+8,i+8+a),m.width=l.getUint32(i+8),m.height=l.getUint32(i+12);break;case"acTL":m.numPlays=l.getUint32(i+8+4);break;case"fcTL":u&&(m.frames.push(u),f++),(u=new o.Frame).width=l.getUint32(i+8+4),u.height=l.getUint32(i+8+8),u.left=l.getUint32(i+8+12),u.top=l.getUint32(i+8+16);var h=l.getUint16(i+8+20),c=l.getUint16(i+8+22);0===c&&(c=100),u.delay=1e3*h/c,u.delay<=10&&(u.delay=100),m.playTime+=u.delay,u.disposeOp=l.getUint8(i+8+24),u.blendOp=l.getUint8(i+8+25),u.dataParts=[],0===f&&2===u.disposeOp&&(u.disposeOp=1);break;case"fdAT":u&&u.dataParts.push(t.subarray(i+8+4,i+8+a));break;case"IDAT":u&&u.dataParts.push(t.subarray(i+8,i+8+a));break;case"IEND":s.push(d(t,i,12+a));break;default:n.push(d(t,i,12+a))}}),u&&m.frames.push(u),0==m.frames.length)return l;var A=new Blob(n),_=new Blob(s);return m.frames.forEach(function(e){var t=[];t.push(h),r.set(g(e.width),0),r.set(g(e.height),4),t.push(p("IHDR",r)),t.push(A),e.dataParts.forEach(function(e){return t.push(p("IDAT",e))}),t.push(_),e.imageData=new Blob(t,{type:"image/png"}),delete e.dataParts,t=null}),m};var n,s=i(1),r=(n=s)&&n.__esModule?n:{default:n},o=i(2),a=new Error("Not a PNG"),l=new Error("Not an animated PNG"),h=new Uint8Array([137,80,78,71,13,10,26,10]);function c(e,t){var i=new DataView(e.buffer),n=8,s=void 0,r=void 0,o=void 0;do{r=i.getUint32(n),o=t(s=u(e,n+4,4),e,n,r),n+=12+r}while(!1!==o&&"IEND"!=s&&n<e.length)}function u(e,t,i){var n=Array.prototype.slice.call(e.subarray(t,t+i));return String.fromCharCode.apply(String,n)}function d(e,t,i){var n=new Uint8Array(i);return n.set(e.subarray(t,t+i)),n}var p=function(e,t){var i=e.length+t.length,n=new Uint8Array(i+8),s=new DataView(n.buffer);s.setUint32(0,t.length),n.set(function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}(e),4),n.set(t,8);var o=(0,r.default)(n,4,i);return s.setUint32(i+4,o),n},g=function(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1,s=t,r=t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t);s<r;s++)n=n>>>8^i[255&(n^e[s])];return-1^n};for(var i=new Uint32Array(256),n=0;n<256;n++){for(var s=n,r=0;r<8;r++)s=1&s?3988292384^s>>>1:s>>>1;i[n]=s}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.APNG=void 0;var n,s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(3),o=(n=r)&&n.__esModule?n:{default:n};function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.APNG=function(){function e(){a(this,e),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}return s(e,[{key:"createImages",value:function(){return Promise.all(this.frames.map(function(e){return e.createImage()}))}},{key:"getPlayer",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.createImages().then(function(){return new o.default(t,e,i)})}}]),e}(),t.Frame=function(){function e(){a(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return s(e,[{key:"createImage",value:function(){var e=this;return this.imageElement?Promise.resolve():new Promise(function(t,i){var n=URL.createObjectURL(e.imageData);e.imageElement=document.createElement("img"),e.imageElement.onload=function(){URL.revokeObjectURL(n),t()},e.imageElement.onerror=function(){URL.revokeObjectURL(n),e.imageElement=null,i(new Error("Image creation error"))},e.imageElement.src=n})}}]),e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(4),o=function(e){function t(e,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s.playbackRate=1,s._currentFrameNumber=0,s._ended=!1,s._paused=!0,s._numPlays=0,s._rafId=null,s._apng=e,s.context=i,s.stop(),n&&s.play(),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,0!==this._apng.numPlays&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&1==this._prevFrame.disposeOp?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&2==this._prevFrame.disposeOp&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var e=this.currentFrame;this._prevFrame=e,this._prevFrameData=null,2==e.disposeOp&&(this._prevFrameData=this.context.getImageData(e.left,e.top,e.width,e.height)),0==e.blendOp&&this.context.clearRect(e.left,e.top,e.width,e.height),this.context.drawImage(e.imageElement,e.left,e.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var e=this;this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1;var t=performance.now()+this.currentFrame.delay/this.playbackRate;this._rafId=requestAnimationFrame(function i(n){if(!e._ended&&!e._paused){if(n>=t){for(;n-t>=e._apng.playTime/e.playbackRate;)t+=e._apng.playTime/e.playbackRate,e._numPlays++;do{e.renderNextFrame(),t+=e.currentFrame.delay/e.playbackRate}while(!e._ended&&!e._paused&&n>t)}e._rafId=requestAnimationFrame(i)}})}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),t}(((n=r)&&n.__esModule?n:{default:n}).default);t.default=o},function(e,t){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function s(e){return"object"==typeof e&&null!==e}function r(e){return void 0===e}e.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,i,o,a,l,h;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r(i=this._events[e]))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(s(i))for(a=Array.prototype.slice.call(arguments,1),o=(h=i.slice()).length,l=0;l<o;l++)h[l].apply(this,a);return!0},i.prototype.addListener=function(e,t){var o;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(o=r(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var i=!1;function s(){this.removeListener(e,s),i||(i=!0,t.apply(this,arguments))}return s.listener=t,this.on(e,s),this},i.prototype.removeListener=function(e,t){var i,r,o,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(i=this._events[e]).length,r=-1,i===t||n(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(i)){for(a=o;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){r=a;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(i=this._events[e]))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}}])},e.exports=t()},797(e,t,i){"use strict";i.d(t,{A:()=>S});var n=i(8015),s=i(3819),r=i(8001),o=i(5053),a=i(937),l=i(7261),h=i(2696);const c=new class{#e;async initialize(){return this.#e=this.#e??new Promise(async e=>{const t={wbg:{__wbindgen_string_new:(e,t)=>{const i=this.#t(e,t);return this.#i(i)},__wbindgen_rethrow:e=>{throw this.#n(e)}}},i=await fetch(l.A.getLibraryURL("mikktspace_bg.wasm")),{instance:n}=await this.#s(i,t);this.#r=n.exports,e()})}isInitialized(){return!!this.#r}async#s(e,t){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"===e.headers.get("Content-Type"))throw t}const i=await e.arrayBuffer();return await WebAssembly.instantiate(i,t)}generateTangents(e,t,i){try{const n=this.#r.__wbindgen_add_to_stack_pointer(-16),s=this.#o(e,this.#r.__wbindgen_malloc),r=this.#a,o=this.#o(t,this.#r.__wbindgen_malloc),a=this.#a,l=this.#o(i,this.#r.__wbindgen_malloc),h=this.#a;this.#r.generateTangents(n,s,r,o,a,l,h);const c=this.#l()[n/4+0],u=this.#l()[n/4+1],d=this.#h(c,u).slice();return this.#r.__wbindgen_free(c,4*u),d}finally{this.#r.__wbindgen_add_to_stack_pointer(16)}}#r;#c=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});#u;#d(){return this.#u?.buffer!==this.#r.memory.buffer&&(this.#u=new Uint8Array(this.#r.memory.buffer)),this.#u}#t(e,t){return this.#c.decode(this.#d().subarray(e,e+t))}#p=Array.from({length:32}).concat([void 0,null,!0,!1]);#g=this.#p.length;#i(e){this.#g===this.#p.length&&this.#p.push(this.#p.length+1);const t=this.#g;return this.#g=this.#p[t],this.#p[t]=e,t}#f(e){return this.#p[e]}#m(e){e<36||(this.#p[e]=this.#g,this.#g=e)}#n(e){const t=this.#f(e);return this.#m(e),t}#A;#_(){return this.#A?.buffer!==this.#r.memory.buffer&&(this.#A=new Float32Array(this.#r.memory.buffer)),this.#A}#a=0;#o(e,t){const i=t(4*e.length);return this.#_().set(e,i/4),this.#a=e.length,i}#y;#l(){return this.#y?.buffer!==this.#r.memory.buffer&&(this.#y=new Int32Array(this.#r.memory.buffer)),this.#y}#h(e,t){return this.#_().subarray(e/4,e/4+t)}},u=h.A.add("MikkTSpace",c);var d=i(477),p=i(8392),g=i(9582),f=i(5687),m=i(1522),A=i(5185),_=i(2514);const y=[d.A.Z_AXIS,d.A.NEGATIVE_Z_AXIS,d.A.Y_AXIS,d.A.NEGATIVE_Y_AXIS,d.A.X_AXIS];function w(e){r.A.call(this,e),this.addType(o.A.X3DGeometryNode),this.addChildObjects(o.A.outputOnly,"transparent",new n.A.SFBool,o.A.outputOnly,"bbox_changed",new n.A.SFTime,o.A.outputOnly,"rebuild",new n.A.SFTime(Date.now()/1e3)),this.min=new d.A,this.max=new d.A,this.bbox=f.A.Extents(this.min,this.max),this.solid=!0,this.geometryType=3,this.colorMaterial=!1,this.attribNodes=[],this.attribArrays=[],this.textureCoordinateMapping=new Map,this.multiTexCoords=[],this.coordIndices=w.createArray(),this.texCoords=w.createArray(),this.fogDepths=w.createArray(),this.colors=w.createArray(),this.tangents=w.createArray(),this.normals=w.createArray(),this.vertices=w.createArray(),this.hasFogCoords=!1,this.hasNormals=!1,this.geometryKey="",this.vertexCount=0,this.planes=[];for(let e=0;e<5;++e)this.planes[e]=new m.A}class x extends Array{#w=new Float32Array;assign(e){const t=e.length;this.length=t;for(let i=0;i<t;++i)this[i]=e[i]}getValue(){return this.#w}shrinkToFit(){return this.length===this.#w.length?this.#w.set(this):this.#w=new Float32Array(this),this.#w}}Object.defineProperty(w,"createArray",{value:()=>new x}),Object.assign(Object.setPrototypeOf(w.prototype,r.A.prototype),{setup(){r.A.prototype.setup.call(this),this.rebuild()},initialize(){r.A.prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();this.getLive().addInterest("set_live__",this),this.addInterest("requestRebuild",this),this._rebuild.addInterest("rebuild",this),this.coordIndexBuffer=t.createBuffer(),this.attribBuffers=[],this.textureCoordinateNode=e.getDefaultTextureCoordinate(),this.texCoordBuffers=Array.from({length:e.getMaxTexCoords()},()=>t.createBuffer()),this.fogDepthBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.tangentBuffer=t.createBuffer(),this.normalBuffer=t.createBuffer(),this.vertexBuffer=t.createBuffer(),this.vertexArrayObject=new s.A(t),this.setCCW(!0),this.set_live__()},getGeometryType(){return this.geometryType},setGeometryType(e){this.geometryType=e},setTransparent(e){!!e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()},getBBox(){return this.bbox},setBBox(e){if(!e.equals(this.bbox)){e.getExtents(this.min,this.max),this.bbox.assign(e);for(let e=0;e<5;++e)this.planes[e].set(e%2?this.min:this.max,y[e]);this._bbox_changed.addEvent()}},getMin(){return this.min},getMax(){return this.max},getMatrix:()=>g.A.IDENTITY,setSolid(e){this.solid=e},isSolid(){return this.solid},setCCW(e){const t=this.getBrowser().getContext();this.frontFace=e?t.CCW:t.CW,this.backFace=e?t.CW:t.CCW},getCoordIndices(){return this.coordIndices},getAttrib(){return this.attribNodes},getAttribs(){return this.attribArrays},getAttribBuffers(){return this.attribBuffers},getFogDepths(){return this.fogDepths},getColors(){return this.colors},getMultiTexCoords(){return this.multiTexCoords},getTexCoords(){return this.texCoords},getTextureCoordinate(){return this.textureCoordinateNode},setTextureCoordinate(e){this.textureCoordinateNode.removeInterest("updateTextureCoordinateMapping",this),this.textureCoordinateNode=e??this.getBrowser().getDefaultTextureCoordinate(),this.textureCoordinateNode.addInterest("updateTextureCoordinateMapping",this),this.updateTextureCoordinateMapping()},getTextureCoordinateMapping(){return this.textureCoordinateMapping},updateTextureCoordinateMapping(){this.textureCoordinateMapping.clear(),this.textureCoordinateNode.getTextureCoordinateMapping(this.textureCoordinateMapping)},getTangents(){return this.tangents},getNormals(){return this.normals},getVertices(){return this.vertices},updateVertexArrays(){this.vertexArrayObject.update(),this.updateInstances=!0},generateTexCoords(){const e=this.texCoords;if(0===e.length){const t=this.getTexCoordParams(),i=t.min,n=t.Sindex,s=t.Tindex,r=t.Ssize,o=i[n],a=i[s],l=this.vertices.getValue(),h=l.length;for(let t=0;t<h;t+=4)e.push((l[t+n]-o)/r,(l[t+s]-a)/r,0,1);e.shrinkToFit()}this.getMultiTexCoords().push(e)},getTexCoordParams:(()=>{const e={min:new d.A,Ssize:0,Sindex:0,Tindex:0};return function(){const t=this.getBBox(),i=t.size,n=i.x,s=i.y,r=i.z;return e.min.assign(t.center).subtract(i.divide(2)),n>=s&&n>=r?(e.Ssize=n,e.Sindex=0,e.Tindex=s>=r?1:2):s>=n&&s>=r?(e.Ssize=s,e.Sindex=1,e.Tindex=n>=r?0:2):(e.Ssize=r,e.Sindex=2,e.Tindex=n>=s?0:1),e}})(),generateTangents(){try{if(this.geometryType<2)return;if(!this.vertices.length)return;if(!u.isInitialized())return void u.initialize().then(()=>{this.generateTangents(),this.transfer(),this.updateGeometryKey(),this.updateRenderFunctions(),this.getBrowser().addBrowserEvent()});const e=this.vertices.getValue().filter((e,t)=>t%4<3),t=this.normals.getValue(),i=this.multiTexCoords[0].getValue().filter((e,t)=>t%4<2),n=u.generateTangents(e,t,i),s=n.length;for(let e=3;e<s;e+=4)n[e]=-n[e];this.tangents.assign(n),this.tangents.shrinkToFit()}catch(e){_.A&&console.error(e)}},refineNormals(e,t,i){if(i<=0)return t;const n=Math.cos(A.A.clamp(i,0,Math.PI)),s=[];for(const i of e.values())for(const e of i){const r=t[e],o=new d.A;for(const e of i){const i=t[e];i.dot(r)>n&&o.add(i)}s[e]=o.normalize()}return s},transformLine(e){},transformMatrix(e){},intersectsLine:(()=>{const e=new g.A,t={u:0,v:0,t:0},i=new d.A,n=new d.A,s=new d.A;return function(r,o,a){if(this.intersectsBBox(r)){this.transformLine(r),this.transformMatrix(e.assign(o));const l=this.multiTexCoords[0].getValue(),h=this.normals.getValue(),c=this.vertices.getValue(),u=this.vertexCount;for(let e=0;e<u;e+=3){const o=4*e;if(i.x=c[o],i.y=c[o+1],i.z=c[o+2],n.x=c[o+4],n.y=c[o+5],n.z=c[o+6],s.x=c[o+8],s.y=c[o+9],s.z=c[o+10],!r.intersectsTriangle(i,n,s,t))continue;const{u,v:g,t:f}=t,m=new d.A(u*c[o]+g*c[o+4]+f*c[o+8],u*c[o+1]+g*c[o+5]+f*c[o+9],u*c[o+2]+g*c[o+6]+f*c[o+10]),A=new p.A(u*l[o]+g*l[o+4]+f*l[o+8],u*l[o+1]+g*l[o+5]+f*l[o+9],u*l[o+2]+g*l[o+6]+f*l[o+10],u*l[o+3]+g*l[o+7]+f*l[o+11]),_=3*e,y=new d.A(u*h[_]+g*h[_+3]+f*h[_+6],u*h[_+1]+g*h[_+4]+f*h[_+7],u*h[_+2]+g*h[_+5]+f*h[_+8]);a.push({texCoord:A,normal:y,point:this.getMatrix().multVecMatrix(m)})}}return a.length}})(),intersectsBBox:(()=>{const e=new d.A;return function(t){const{min:i,max:n,planes:s}=this,r=i.x,o=n.x,a=i.y,l=n.y,h=i.z,c=n.z;return!!(s[0].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.y>=a&&e.y<=l)||(!!(s[1].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.y>=a&&e.y<=l)||(!!(s[2].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.z>=h&&e.z<=c)||(!!(s[3].intersectsLine(t,e)&&e.x>=r&&e.x<=o&&e.z>=h&&e.z<=c)||!!(s[4].intersectsLine(t,e)&&e.y>=a&&e.y<=l&&e.z>=h&&e.z<=c))))}})(),set_live__(){},connectOptions(e){const t=this.getBrowser(),i=this.isLive()&&t.getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||i?(e.addInterest("requestRebuild",this),e.getModificationTime()>=this._rebuild.getValue()&&this.requestRebuild()):e.removeInterest("requestRebuild",this)},requestRebuild(){this._rebuild=Date.now()/1e3},rebuild(){this.clear(),this.build();for(const e of this.attribArrays)e.shrinkToFit();for(const e of this.multiTexCoords)e.shrinkToFit();this.coordIndices.shrinkToFit(),this.fogDepths.shrinkToFit(),this.colors.shrinkToFit(),this.tangents.shrinkToFit(),this.normals.shrinkToFit(),this.vertices.shrinkToFit(),this.updateBBox(),this.multiTexCoords.length||this.generateTexCoords(),this.tangents.length||this.generateTangents(),this.transfer(),this.updateGeometryKey(),this.updateRenderFunctions()},clear(){this.min.set(Number.POSITIVE_INFINITY),this.max.set(Number.NEGATIVE_INFINITY);{const e=this.attribArrays;for(const t of e)t.length=0;const t=this.attribNodes.length;for(let i=e.length;i<t;++i)e[i]=w.createArray();e.length=t}this.coordIndices.length=0,this.fogDepths.length=0,this.colors.length=0,this.multiTexCoords.length=0,this.texCoords.length=0,this.tangents.length=0,this.normals.length=0,this.vertices.length=0},updateBBox:(()=>{const e=new d.A;return function(){const t=this.vertices.getValue(),i=t.length,n=this.min,s=this.max;if(i){if(n.x===Number.POSITIVE_INFINITY)for(let r=0;r<i;r+=4){const{[r]:i,[r+1]:o,[r+2]:a}=t;e.set(i,o,a),n.min(e),s.max(e)}this.bbox.setExtents(n,s)}else this.bbox.setExtents(n.set(0),s.set(0));for(let e=0;e<5;++e)this.planes[e].set(e%2?n:s,y[e]);this._bbox_changed.addEvent()}})(),transfer(){const e=this.getBrowser().getContext();e.bindBuffer(e.ARRAY_BUFFER,this.coordIndexBuffer),e.bufferData(e.ARRAY_BUFFER,this.coordIndices.getValue(),e.DYNAMIC_DRAW);for(let t=this.attribBuffers.length,i=this.attribArrays.length;t<i;++t)this.attribBuffers.push(e.createBuffer());for(let t=0,i=this.attribArrays.length;t<i;++t)e.bindBuffer(e.ARRAY_BUFFER,this.attribBuffers[t]),e.bufferData(e.ARRAY_BUFFER,this.attribArrays[t].getValue(),e.DYNAMIC_DRAW);const t=this.hasFogCoords;e.bindBuffer(e.ARRAY_BUFFER,this.fogDepthBuffer),e.bufferData(e.ARRAY_BUFFER,this.fogDepths.getValue(),e.DYNAMIC_DRAW),this.hasFogCoords=!!this.fogDepths.length,this.hasFogCoords!==t&&this.updateVertexArrays();const i=this.colorMaterial;e.bindBuffer(e.ARRAY_BUFFER,this.colorBuffer),e.bufferData(e.ARRAY_BUFFER,this.colors.getValue(),e.DYNAMIC_DRAW),this.colorMaterial=!!this.colors.length,this.colorMaterial!==i&&this.updateVertexArrays();for(let t=0,i=this.multiTexCoords.length;t<i;++t)e.bindBuffer(e.ARRAY_BUFFER,this.texCoordBuffers[t]),e.bufferData(e.ARRAY_BUFFER,this.multiTexCoords[t].getValue(),e.DYNAMIC_DRAW);const n=this.hasTangents;e.bindBuffer(e.ARRAY_BUFFER,this.tangentBuffer),e.bufferData(e.ARRAY_BUFFER,this.tangents.getValue(),e.DYNAMIC_DRAW),this.hasTangents=!!this.tangents.length,this.hasTangents!==n&&this.updateVertexArrays();const s=this.hasNormals;e.bindBuffer(e.ARRAY_BUFFER,this.normalBuffer),e.bufferData(e.ARRAY_BUFFER,this.normals.getValue(),e.DYNAMIC_DRAW),this.hasNormals=!!this.normals.length,this.hasNormals!==s&&this.updateVertexArrays(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices.getValue(),e.DYNAMIC_DRAW),this.vertexCount=this.vertices.length/4},updateGeometryKey(){let e="";e+=this.geometryType,e+=this.hasFogCoords?1:0,e+=this.colorMaterial?1:0,e+=this.hasTangents?1:0,e+=this.hasNormals?1:0,this.geometryKey=e},updateRenderFunctions(){this.vertexCount?(delete this.displaySimple,delete this.display,delete this.displaySimpleInstanced,delete this.displayInstanced):(this.displaySimple=Function.prototype,this.display=Function.prototype,this.displaySimpleInstanced=Function.prototype,this.displayInstanced=Function.prototype)},traverse(e,t){},displaySimple(e,t,i){this.vertexArrayObject.enable(i.getProgram())&&(this.coordIndices.length&&i.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0),this.multiTexCoords.length&&i.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),this.hasNormals&&i.enableNormalAttribute(e,this.normalBuffer,0,0),i.enableVertexAttribute(e,this.vertexBuffer,0,0)),e.drawArrays(e.TRIANGLES,0,this.vertexCount)},display(e,t){const{viewport:i,appearanceNode:n,modelViewMatrix:s}=t,r=this.getBrowser(),o=r.getPrimitiveMode(e.TRIANGLES),a=n.getRenderModes(),l=n.getShader(this,t);e.viewport(...i);for(const t of a)t.enable(e);const h=g.A.prototype.determinant3.call(s)>0;if(e.frontFace(h?this.frontFace:this.backFace),this.solid||!n.getBackMaterial())this.displayGeometry(e,t,l,o,!0,!0);else{const i=n.getBackShader(this,t);this.displayGeometry(e,t,i,o,!0,!1),this.displayGeometry(e,t,l,o,!1,!0)}for(const t of a)t.disable(e);r.resetTextureUnits()},displayGeometry(e,t,i,n,s,r){if(i.enable(e),i.setUniforms(e,t,this,r),this.vertexArrayObject.enable(i.getProgram())){const t=this.getAttrib(),n=this.getAttribBuffers();this.coordIndices.length&&i.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0);for(let s=0,r=t.length;s<r;++s)t[s].enable(e,i,n[s]);this.hasFogCoords&&i.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&i.enableColorAttribute(e,this.colorBuffer,0,0),this.hasTangents&&i.enableTangentAttribute(e,this.tangentBuffer,0,0),i.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),i.enableNormalAttribute(e,this.normalBuffer,0,0),i.enableVertexAttribute(e,this.vertexBuffer,0,0)}t.transparent||s!==r?(e.enable(e.CULL_FACE),s&&!this.solid&&(e.cullFace(e.FRONT),e.drawArrays(n,0,this.vertexCount)),r&&(e.cullFace(e.BACK),e.drawArrays(n,0,this.vertexCount))):(this.solid?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),e.drawArrays(n,0,this.vertexCount))},displaySimpleInstanced(e,t,i){const n=i.getInstances();if(n.vertexArrayObject.update(this.updateInstances).enable(t.getProgram())){const{instancesStride:s,particleOffset:r,matrixOffset:o,normalMatrixOffset:a}=i;void 0!==r&&t.enableParticleAttribute(e,n,s,r,1),t.enableInstanceMatrixAttribute(e,n,s,o,1),void 0!==a&&t.enableInstanceNormalMatrixAttribute(e,n,s,a,1),this.coordIndices.length&&t.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0),t.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),t.enableNormalAttribute(e,this.normalBuffer,0,0),t.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateInstances=!1}e.drawArraysInstanced(e.TRIANGLES,0,this.vertexCount,i.getNumInstances())},displayInstanced(e,t,i){const{viewport:n,appearanceNode:s,modelViewMatrix:r}=t,o=this.getBrowser(),a=o.getPrimitiveMode(e.TRIANGLES),l=s.getRenderModes(),h=s.getShader(this,t);e.viewport(...n);for(const t of l)t.enable(e);const c=g.A.prototype.determinant3.call(r)>0;if(e.frontFace(c?this.frontFace:this.backFace),this.solid||!s.getBackMaterial())this.displayInstancedGeometry(e,t,h,a,!0,!0,i);else{const n=s.getBackShader(this,t);this.displayInstancedGeometry(e,t,n,a,!0,!1,i),this.displayInstancedGeometry(e,t,h,a,!1,!0,i)}for(const t of l)t.disable(e);o.resetTextureUnits()},displayInstancedGeometry(e,t,i,n,s,r,o){i.enable(e),i.setUniforms(e,t,this,r);const a=o.getInstances();if(a.vertexArrayObject.update(this.updateInstances).enable(i.getProgram())){const{instancesStride:t,particleOffset:n,velocityOffset:s,matrixOffset:r,normalMatrixOffset:l}=o,h=this.getAttrib(),c=this.getAttribBuffers();void 0!==n&&i.enableParticleAttribute(e,a,t,n,1),void 0!==s&&i.enableParticleVelocityAttribute(e,a,t,s,1),i.enableInstanceMatrixAttribute(e,a,t,r,1),void 0!==l&&i.enableInstanceNormalMatrixAttribute(e,a,t,l,1),this.coordIndices.length&&i.enableCoordIndexAttribute(e,this.coordIndexBuffer,0,0);for(let t=0,n=h.length;t<n;++t)h[t].enable(e,i,c[t]);this.hasFogCoords&&i.enableFogDepthAttribute(e,this.fogDepthBuffer,0,0),this.colorMaterial&&i.enableColorAttribute(e,this.colorBuffer,0,0),this.hasTangents&&i.enableTangentAttribute(e,this.tangentBuffer,0,0),i.enableTexCoordAttribute(e,this.texCoordBuffers,0,0),i.enableNormalAttribute(e,this.normalBuffer,0,0),i.enableVertexAttribute(e,this.vertexBuffer,0,0),this.updateInstances=!1}t.transparent||s!==r?(e.enable(e.CULL_FACE),s&&!this.solid&&(e.cullFace(e.FRONT),e.drawArraysInstanced(n,0,this.vertexCount,o.getNumInstances())),r&&(e.cullFace(e.BACK),e.drawArraysInstanced(n,0,this.vertexCount,o.getNumInstances()))):(this.solid?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),e.drawArraysInstanced(n,0,this.vertexCount,o.getNumInstances()))}},{getFogCoord(){return this.fogCoordNode},getColor(){return this.colorNode},getTexCoord(){return this.texCoordNode},getTangent(){return this.tangentNode},getNormal(){return this.normalNode},getCoord(){return this.coordNode},set_attrib__(){const e=this.getAttrib();for(const t of e)t.removeInterest("requestRebuild",this),t._attribute_changed.removeInterest("updateVertexArrays",this);e.length=0;for(const t of this._attrib){const i=(0,a.A)(o.A.X3DVertexAttributeNode,t);i&&e.push(i)}for(const t of e)t.addInterest("requestRebuild",this),t._attribute_changed.addInterest("updateVertexArrays",this);this.updateVertexArrays()},set_fogCoord__(){this.fogCoordNode?.removeInterest("requestRebuild",this),this.fogCoordNode=(0,a.A)(o.A.FogCoordinate,this._fogCoord),this.fogCoordNode?.addInterest("requestRebuild",this)},set_color__(){this.colorNode?.removeInterest("requestRebuild",this),this.colorNode=(0,a.A)(o.A.X3DColorNode,this._color),this.colorNode?.addInterest("requestRebuild",this),this.setTransparent(this.colorNode?.isTransparent())},set_texCoord__(){this.texCoordNode?.removeInterest("requestRebuild",this),this.texCoordNode=(0,a.A)(o.A.X3DTextureCoordinateNode,this._texCoord),this.texCoordNode?.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_tangent__(){this.tangentNode?.removeInterest("requestRebuild",this),this.tangentNode=(0,a.A)(o.A.X3DTangentNode,this._tangent),this.tangentNode?.addInterest("requestRebuild",this)},set_normal__(){this.normalNode?.removeInterest("requestRebuild",this),this.normalNode=(0,a.A)(o.A.X3DNormalNode,this._normal),this.normalNode?.addInterest("requestRebuild",this)},set_coord__(){this.coordNode?.removeInterest("requestRebuild",this),this.coordNode=(0,a.A)(o.A.X3DCoordinateNode,this._coord),this.coordNode?.addInterest("requestRebuild",this)}}),Object.defineProperties(w,r.A.getStaticProperties("X3DGeometryNode","Rendering",1));const b=w,S=h.A.add("X3DGeometryNode",b)},937(e,t,i){"use strict";i.d(t,{A:()=>r});var n=i(8015);const s=function(e,t,i=!0){try{if(t&&(t instanceof n.A.SFNode&&(t=t.getValue()),t&&(t=i?t.getInnerNode():t.valueOf()).getType().includes(e)))return t}catch{}return null},r=i(2696).A.add("X3DCast",s)},991(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(8060),s=i(2696);const r=n.A.WEAK_REF&&n.A.FINALIZATION_REGISTRY?class{#x=new Map;#b=new FinalizationRegistry(e=>this.#x.delete(e));constructor(e){if(e)for(const t of e)this.add(t)}*[Symbol.iterator](){yield*this.values()}get size(){return this.#x.size}add(e){this.#x.set(e.getId(),new WeakRef(e)),this.#b.register(e,e.getId(),e)}clear(){for(const e of this.values())this.#b.unregister(e);this.#x.clear()}delete(e){this.#x.delete(e.getId()),this.#b.unregister(e)}forEach(e,t){for(const i of this.values())e.call(t,i,i,this)}has(e){return this.#x.has(e.getId())}*entries(){for(const e of this.values())yield[e,e]}*keys(){yield*this.values()}*values(){for(const e of this.#x.values()){const t=e.deref();t&&(yield t)}}}:class extends Set{constructor(e){super(e)}},o=s.A.add("IterableWeakSet",r)},1166(e,t,i){"use strict";i.d(t,{A:()=>a});var n=i(5185),s=i(2696);function r(e=0,t=e){this.x=e,this.y=t}Object.assign(r.prototype,{*[Symbol.iterator](){yield this.x,yield this.y},copy(){const e=Object.create(r.prototype);return e.x=this.x,e.y=this.y,e},assign({x:e,y:t}){return this.x=e,this.y=t,this},set(e=0,t=e){return this.x=e,this.y=t,this},equals({x:e,y:t}){return this.x===e&&this.y===t},negate(){return this.x=-this.x,this.y=-this.y,this},inverse(){return this.x=1/this.x,this.y=1/this.y,this},add({x:e,y:t}){return this.x+=e,this.y+=t,this},subtract({x:e,y:t}){return this.x-=e,this.y-=t,this},multiply(e){return this.x*=e,this.y*=e,this},multVec({x:e,y:t}){return this.x*=e,this.y*=t,this},divide(e){return this.x/=e,this.y/=e,this},divVec({x:e,y:t}){return this.x/=e,this.y/=t,this},normalize(){const e=Math.hypot(this.x,this.y);return e&&(this.x/=e,this.y/=e),this},dot({x:e,y:t}){return this.x*e+this.y*t},squaredNorm(){const{x:e,y:t}=this;return e*e+t*t},norm(){return Math.hypot(this.x,this.y)},distance({x:e,y:t}){return Math.hypot(this.x-e,this.y-t)},lerp({x:e,y:t},i){const{x:n,y:s}=this;return this.x=n+i*(e-n),this.y=s+i*(t-s),this},abs(){const{x:e,y:t}=this;return this.x=Math.abs(e),this.y=Math.abs(t),this},min(e){let{x:t,y:i}=this;for(const{x:e,y:n}of arguments)t=Math.min(t,e),i=Math.min(i,n);return this.x=t,this.y=i,this},max(e){let{x:t,y:i}=this;for(const{x:e,y:n}of arguments)t=Math.max(t,e),i=Math.max(i,n);return this.x=t,this.y=i,this},clamp({x:e,y:t},{x:i,y:s}){return this.x=n.A.clamp(this.x,e,i),this.y=n.A.clamp(this.y,t,s),this},toString(){return this.x+" "+this.y}});for(const e of Object.keys(r.prototype))Object.defineProperty(r.prototype,e,{enumerable:!1});Object.defineProperties(r.prototype,{length:{value:2},0:{get(){return this.x},set(e){this.x=e}},1:{get(){return this.y},set(e){this.y=e}}}),Object.assign(r,{ZERO:Object.freeze(new r),ONE:Object.freeze(new r(1)),X_AXIS:Object.freeze(new r(1,0)),Y_AXIS:Object.freeze(new r(0,1)),NEGATIVE_ONE:Object.freeze(new r(-1)),NEGATIVE_X_AXIS:Object.freeze(new r(-1,0)),NEGATIVE_Y_AXIS:Object.freeze(new r(0,-1))});const o=r,a=s.A.add("Vector2",o)},1256(e,t,i){"use strict";i.d(t,{A:()=>p});var n=i(1166),s=i(477),r=i(2696);function o(...e){if(e.length)for(let t=0;t<4;++t)this[t]=e[t];else this.identity()}Object.assign(o.prototype,{*[Symbol.iterator](){for(let e=0;e<4;++e)yield this[e]},copy(){const e=Object.create(o.prototype);for(let t=0;t<4;++t)e[t]=this[t];return e},assign(e){for(let t=0;t<4;++t)this[t]=e[t];return this},equals(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]},set1(e,t,i){this[e*this.order+t]=i},get1(e,t){return this[e*this.order+t]},set(){switch(arguments.length){case 0:this.identity();break;case 4:for(let e=0;e<4;++e)this[e]=arguments[e]}return this},determinant1(){return this[0]},determinant(){const{0:e,1:t,2:i,3:n}=this;return e*n-t*i},transpose(){const e=this[1];return this[1]=this[2],this[2]=e,this},inverse(){const{0:e,1:t,2:i,3:n}=this,s=e*n-t*i;return this[0]=n/s,this[1]=-t/s,this[2]=-i/s,this[3]=e/s,this},multLeft(e){const{0:t,1:i,2:n,3:s}=this,{0:r,1:o,2:a,3:l}=e;return this[0]=t*r+n*o,this[1]=i*r+s*o,this[2]=t*a+n*l,this[3]=i*a+s*l,this},multRight(e){const{0:t,1:i,2:n,3:s}=this,{0:r,1:o,2:a,3:l}=e;return this[0]=r*t+a*i,this[1]=o*t+l*i,this[2]=r*n+a*s,this[3]=o*n+l*s,this},multVecMatrix(e){if("number"==typeof e){const t=e,i=t*this[1]+this[3];return(t*this[0]+this[2])/i}{const{x:t,y:i}=e;return e.x=t*this[0]+i*this[2],e.y=t*this[1]+i*this[3],e}},multMatrixVec(e){if("number"==typeof e){const t=e,i=t*this[2]+this[3];return(t*this[0]+this[1])/i}{const{x:t,y:i}=e;return e.x=t*this[0]+i*this[1],e.y=t*this[2]+i*this[3],e}},identity(){this[0]=1,this[1]=0,this[2]=0,this[3]=1},toString(){return Array.prototype.join.call(this," ")}});for(const e of Object.keys(o.prototype))Object.defineProperty(o.prototype,e,{enumerable:!1});Object.defineProperties(o.prototype,{order:{value:2},length:{value:4},x:{get:(()=>{const e=new n.A;return function(){return e.set(this[0],this[1])}})()},y:{get:(()=>{const e=new n.A;return function(){return e.set(this[2],this[3])}})()},xAxis:{get(){return this[0]}},origin:{get(){return this[2]}},submatrix:{get(){return this[0]}}}),Object.assign(o,{IDENTITY:Object.freeze(new o)});const a=o,l=r.A.add("Matrix2",a);var h=i(5575);function c(...e){if(e.length)for(let t=0;t<9;++t)this[t]=e[t];else this.identity()}Object.assign(c.prototype,{*[Symbol.iterator](){for(let e=0;e<9;++e)yield this[e]},copy(){const e=Object.create(c.prototype);for(let t=0;t<9;++t)e[t]=this[t];return e},assign(e){for(let t=0;t<9;++t)this[t]=e[t];return this},equals(e){return this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2]&&this[3]===e[3]&&this[4]===e[4]&&this[5]===e[5]&&this[6]===e[6]&&this[7]===e[7]&&this[8]===e[8]},set1(e,t,i){return this[e*this.order+t]=i,this},get1(e,t){return this[e*this.order+t]},set:(()=>{const e=new n.A;return function(t,i,s,r,o){switch(this.identity(),arguments.length){case 1:t&&!t.equals(n.A.ZERO)&&this.translate(t);break;case 2:t&&!t.equals(n.A.ZERO)&&this.translate(t),i&&this.rotate(i);break;case 3:t&&!t.equals(n.A.ZERO)&&this.translate(t),i&&this.rotate(i),s&&!s.equals(n.A.ONE)&&this.scale(s);break;case 4:t&&!t.equals(n.A.ZERO)&&this.translate(t),i&&this.rotate(i),s&&!s.equals(n.A.ONE)&&(r?(this.rotate(r),this.scale(s),this.rotate(-r)):this.scale(s));break;case 5:{t&&!t.equals(n.A.ZERO)&&this.translate(t);const a=o&&!o.equals(n.A.ZERO);a&&this.translate(o),i&&this.rotate(i),s&&!s.equals(n.A.ONE)&&(r?(this.rotate(r),this.scale(s),this.rotate(-r)):this.scale(s)),a&&this.translate(e.assign(o).negate());break}case 9:for(let e=0;e<9;++e)this[e]=arguments[e]}return this}})(),get:(()=>{const e=new n.A;return function(t,i,n,s,r){switch(arguments.length){case 1:t.set(this[6],this[7]);break;case 2:case 3:case 4:this.factor(t,i,n,s);break;case 5:r?(u.set(e.assign(r).negate()),u.multLeft(this),u.translate(r),u.get(t,i,n,s)):this.factor(t,i,n,s)}}})(),factor:(()=>{const e=new n.A,t=new l,i=new l,s=new l,r={values:[],vectors:[[],[]]};return function(n,o,a,l){n?.set(this[6],this[7]);const c=this.submatrix,u=c.determinant()<0?-1:1;s.assign(c).transpose().multLeft(c);const d=(0,h.A)(s,r);i.set(d.vectors[0][0],d.vectors[1][0],d.vectors[0][1],d.vectors[1][1]),l&&(l[0]=i[0],l[1]=i[1],l[2]=Math.atan2(i[1],i[0])),e.set(u*Math.sqrt(d.values[0]),u*Math.sqrt(d.values[1])),a?.assign(e),o&&(t[0]=1/e.x,t[3]=1/e.y,c.multLeft(i).multLeft(t).multLeft(i.transpose()),o[0]=c[0],o[1]=c[1],o[2]=Math.atan2(c[1],c[0]))}})(),determinant2(){const{0:e,1:t,3:i,4:n}=this;return e*n-t*i},determinant(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l}=this;return e*(s*l-r*a)-t*(n*l-r*o)+i*(n*a-s*o)},transpose(){let e;return e=this[1],this[1]=this[3],this[3]=e,e=this[2],this[2]=this[6],this[6]=e,e=this[5],this[5]=this[7],this[7]=e,this},inverse(){const{0:e,1:t,2:i,3:n,4:s,5:r,6:o,7:a,8:l}=this,h=e*s,c=e*a,u=n*t,d=n*a,p=o*t,g=o*s;let f=h*l-c*r-u*l+d*i+p*r-g*i;f=1/f;const m=(s*l-a*r)*f,A=-(t*l-a*i)*f,_=(t*r-s*i)*f,y=-(n*l-o*r)*f,w=(e*l-o*i)*f,x=-(e*r-n*i)*f;return this[0]=m,this[1]=A,this[2]=_,this[3]=y,this[4]=w,this[5]=x,this[6]=(d-g)*f,this[7]=-(c-p)*f,this[8]=(h-u)*f,this},multLeft(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:h}=this,{0:c,1:u,2:d,3:p,4:g,5:f,6:m,7:A,8:_}=e;return this[0]=t*c+s*u+a*d,this[1]=i*c+r*u+l*d,this[2]=n*c+o*u+h*d,this[3]=t*p+s*g+a*f,this[4]=i*p+r*g+l*f,this[5]=n*p+o*g+h*f,this[6]=t*m+s*A+a*_,this[7]=i*m+r*A+l*_,this[8]=n*m+o*A+h*_,this},multRight(e){const{0:t,1:i,2:n,3:s,4:r,5:o,6:a,7:l,8:h}=this,{0:c,1:u,2:d,3:p,4:g,5:f,6:m,7:A,8:_}=e;return this[0]=t*c+i*p+n*m,this[1]=t*u+i*g+n*A,this[2]=t*d+i*f+n*_,this[3]=s*c+r*p+o*m,this[4]=s*u+r*g+o*A,this[5]=s*d+r*f+o*_,this[6]=a*c+l*p+h*m,this[7]=a*u+l*g+h*A,this[8]=a*d+l*f+h*_,this},multVecMatrix(e){if(2===e.length){const{x:t,y:i}=e,n=t*this[2]+i*this[5]+this[8];return e.x=(t*this[0]+i*this[3]+this[6])/n,e.y=(t*this[1]+i*this[4]+this[7])/n,e}{const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[3]+n*this[6],e.y=t*this[1]+i*this[4]+n*this[7],e.z=t*this[2]+i*this[5]+n*this[8],e}},multMatrixVec(e){if(2===e.length){const{x:t,y:i}=e,n=t*this[6]+i*this[7]+this[8];return e.x=(t*this[0]+i*this[1]+this[2])/n,e.y=(t*this[3]+i*this[4]+this[5])/n,e}{const{x:t,y:i,z:n}=e;return e.x=t*this[0]+i*this[1]+n*this[2],e.y=t*this[3]+i*this[4]+n*this[5],e.z=t*this[6]+i*this[7]+n*this[8],e}},multDirMatrix(e){const{x:t,y:i}=e;return e.x=t*this[0]+i*this[3],e.y=t*this[1]+i*this[4],e},multMatrixDir(e){const{x:t,y:i}=e;return e.x=t*this[0]+i*this[1],e.y=t*this[3]+i*this[4],e},identity(){return this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=1,this[5]=0,this[6]=0,this[7]=0,this[8]=1,this},translate(e){const{x:t,y:i}=e;return this[6]+=this[0]*t+this[3]*i,this[7]+=this[1]*t+this[4]*i,this},rotate(e){return this.multLeft(c.Rotation(e))},scale(e){const{x:t,y:i}=e;return this[0]*=t,this[3]*=i,this[1]*=t,this[4]*=i,this},skewX(e){const t=Math.tan(e);return this[3]+=this[0]*t,this[4]+=this[1]*t,this[5]+=this[2]*t,this},skewY(e){const t=Math.tan(e);return this[0]+=this[3]*t,this[1]+=this[4]*t,this[2]+=this[5]*t,this},toString(){return Array.prototype.join.call(this," ")}});for(const e of Object.keys(c.prototype))Object.defineProperty(c.prototype,e,{enumerable:!1});Object.defineProperties(c.prototype,{order:{value:3},length:{value:9},x:{get:(()=>{const e=new s.A;return function(){return e.set(this[0],this[1],this[2])}})()},y:{get:(()=>{const e=new s.A;return function(){return e.set(this[3],this[4],this[5])}})()},z:{get:(()=>{const e=new s.A;return function(){return e.set(this[6],this[7],this[8])}})()},xAxis:{get:(()=>{const e=new n.A;return function(){return e.set(this[0],this[1])}})()},yAxis:{get:(()=>{const e=new n.A;return function(){return e.set(this[3],this[4])}})()},origin:{get:(()=>{const e=new n.A;return function(){return e.set(this[6],this[7])}})()},submatrix:{get:(()=>{const e=new l;return function(){return e[0]=this[0],e[1]=this[1],e[2]=this[3],e[3]=this[4],e}})()}}),Object.assign(c,{IDENTITY:Object.freeze(new c),Rotation(e){const t=Math.sin(e),i=Math.cos(e);return new c(i,t,0,-t,i,0,0,0,1)},Matrix2:e=>new c(e[0],e[1],0,e[2],e[3],0,0,0,1)});const u=new c,d=c,p=r.A.add("Matrix3",d)},1262(e,t,i){"use strict";i.d(t,{A:()=>h});var n=i(8015),s=i(8001),r=i(6761),o=i(2696);class a extends s.A{#S;#T;#v;#O;#E;#N;#C;#I;constructor(e,t,i=s.A,n){super(e.getExecutionContext()),this.#S=e,this.#T=e.lastIndex,this.#v=e.lineNumber,this.#E=e.getNamedNodes(),this.#N=e.getImportedNodes(),this.#O=t,this.#C=i,this.#I=n}getComponentInfo(){return this.#C.componentInfo}getContainerField(){return this.#C.containerField}getSpecificationRange(){return this.#C.specificationRange}replaceWithNode(){const e=this.#O,t=this.#E.get(e)??this.#N.get(e),i=t instanceof r.A?t.getExportedNode(this.#C):t;if(!i)throw this.#S.lastIndex=this.#T,this.#S.lineNumber=this.#v,new Error(`Named node '${e}' not found.`);this.#S.checkNodeType(i,this.#O,this.#C,this.#I);for(const e of Array.from(this.getParents()))e instanceof n.A.SFNode&&e.setValue(i)}}const l=a,h=o.A.add("Placeholder",l)},1264(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(2696);const s={parse(e){return this.lastIndex=e.lastIndex,e.result=this.exec(e.input),!!e.result&&(e.lastIndex=this.lastIndex,!0)},lookahead(e){const t=e.lastIndex,i=this.parse(e);return e.lastIndex=t,i}};const r=function(e){for(const t of Object.values(e))Object.assign(t,s);return e},o=n.A.add("Expressions",r)},1461(e,t,i){"use strict";i.d(t,{A:()=>d});var n=i(5768),s=i(5543),r=i(5595),o=i(8187),a=i(937),l=i(5053),h=i(2696);function c(e){s.A.call(this,e),this.addType(l.A.X3DWorld),this.addChildObjects(l.A.outputOnly,"activeLayer",new n.A(this.layer0)),this.defaultLayerSet=new r.A(e),this.layerSet=this.defaultLayerSet,this.layer0=new o.A(e)}Object.assign(Object.setPrototypeOf(c.prototype,s.A.prototype),{initialize(){s.A.prototype.initialize.call(this),this.layerSet.setPrivate(!0),this.layerSet.setup(),this.layerSet.setLayer0(this.layer0),this.layerSet._activeLayer.addInterest("set_rootNodes__",this),this.getExecutionContext().getRootNodes().addInterest("set_rootNodes__",this),this.set_rootNodes__(),this.layer0.setPrivate(!0),this.layer0.setLayer0(!0),this.layer0.setup(),this.set_activeLayer__()},getCache(){return this.getBrowser().getBrowserOption("Cache")},getLayerSet(){return this.layerSet},getActiveLayer(){return this._activeLayer.getValue()},getLayer0(){return this.layer0},set_rootNodes__(){const e=this.layerSet,t=this.getExecutionContext().getRootNodes();this.layerSet=this.defaultLayerSet,this.layer0._children=t;for(const e of t){const t=(0,a.A)(l.A.LayerSet,e);t&&(this.layerSet=t)}this.layerSet!==e&&(this.layerSet.setLayer0(this.layer0),e._activeLayerNode.removeInterest("set_activeLayer__",this),this.layerSet._activeLayerNode.addInterest("set_activeLayer__",this),this.set_activeLayer__())},set_activeLayer__(){this._activeLayer=this.layerSet.getActiveLayer()},bindBindables(){const e=this.getExecutionContext().getWorldURL();this.layerSet.bindBindables(decodeURIComponent(new URL(e).hash.substring(1)))},traverse(e,t){this.layerSet.traverse(e,t)}});for(const e of Object.keys(c.prototype))Object.defineProperty(c.prototype,e,{enumerable:!1});Object.defineProperties(c,{typeName:{value:"X3DWorld",enumerable:!0}}),l.A.addConstant(c.typeName);const u=c,d=h.A.add("X3DWorld",u)},1467(e,t,i){"use strict";i.d(t,{A:()=>g});var n=i(8015),s=i(5717),r=i(3999),o=i(8001),a=i(5464),l=i(1815),h=i(5053),c=i(9401),u=i(2696);function d(e){a.A.call(this,e),this.addType(h.A.Background)}Object.assign(Object.setPrototypeOf(d.prototype,a.A.prototype),{initialize(){a.A.prototype.initialize.call(this);const e=new l.A(this.getExecutionContext()),t=new l.A(this.getExecutionContext()),i=new l.A(this.getExecutionContext()),n=new l.A(this.getExecutionContext()),s=new l.A(this.getExecutionContext()),r=new l.A(this.getExecutionContext()),o=this.getBrowser().getBackgroundTextureProperties();this._frontUrl.addFieldInterest(e._url),this._backUrl.addFieldInterest(t._url),this._leftUrl.addFieldInterest(i._url),this._rightUrl.addFieldInterest(n._url),this._topUrl.addFieldInterest(s._url),this._bottomUrl.addFieldInterest(r._url),e._url=this._frontUrl,t._url=this._backUrl,i._url=this._leftUrl,n._url=this._rightUrl,s._url=this._topUrl,r._url=this._bottomUrl,e._textureProperties=o,t._textureProperties=o,i._textureProperties=o,n._textureProperties=o,s._textureProperties=o,r._textureProperties=o,e.setup(),t.setup(),i.setup(),n.setup(),s.setup(),r.setup(),this.set_texture__(0,e),this.set_texture__(1,t),this.set_texture__(2,i),this.set_texture__(3,n),this.set_textu