@playcanvas/web-components 0.2.11 → 0.2.12

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/dist/pwc.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("playcanvas")):"function"==typeof define&&define.amd?define(["exports","playcanvas"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pd={},e.pc)}(this,function(e,t){"use strict";class a extends HTMLElement{constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-app")}get closestEntity(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-entity")}_onReady(){this._readyResolve(),this.dispatchEvent(new CustomEvent("ready"))}ready(){return this._readyPromise.then(()=>this)}}class s extends HTMLElement{constructor(){super(),this.loadPromise=this.loadModule()}async loadModule(){const e=this.getAttribute("name"),a={glueUrl:this.getAttribute("glue"),wasmUrl:this.getAttribute("wasm"),fallbackUrl:this.getAttribute("fallback")};"Basis"===e?t.basisInitialize(a):(t.WasmModule.setConfig(e,a),await new Promise(a=>{t.WasmModule.getInstance(e,()=>a())}))}getLoadPromise(){return this.loadPromise}}customElements.define("pc-module",s);class i extends a{constructor(){super(),this._canvas=null,this._alpha=!0,this._backend="webgl2",this._antialias=!0,this._depth=!0,this._stencil=!0,this._highResolution=!0,this._hierarchyReady=!1,this._picker=null,this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1},this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this.app=null,this._onWindowResize=this._onWindowResize.bind(this)}async connectedCallback(){const e=this.querySelectorAll(":scope > pc-module");await Promise.all(Array.from(e).map(e=>e.getLoadPromise())),this._canvas=document.createElement("canvas"),this.appendChild(this._canvas);const a={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[],s=await t.createGraphicsDevice(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depth,deviceTypes:a,stencil:this._stencil});s.maxPixelRatio=this._highResolution?window.devicePixelRatio:1;const i=new t.AppOptions;i.graphicsDevice=s,i.keyboard=new t.Keyboard(window),i.mouse=new t.Mouse(this._canvas),i.componentSystems=[t.AnimComponentSystem,t.AnimationComponentSystem,t.AudioListenerComponentSystem,t.ButtonComponentSystem,t.CameraComponentSystem,t.CollisionComponentSystem,t.ElementComponentSystem,t.GSplatComponentSystem,t.JointComponentSystem,t.LayoutChildComponentSystem,t.LayoutGroupComponentSystem,t.LightComponentSystem,t.ModelComponentSystem,t.ParticleSystemComponentSystem,t.RenderComponentSystem,t.RigidBodyComponentSystem,t.ScreenComponentSystem,t.ScriptComponentSystem,t.ScrollbarComponentSystem,t.ScrollViewComponentSystem,t.SoundComponentSystem,t.SpriteComponentSystem,t.ZoneComponentSystem],i.resourceHandlers=[t.AnimClipHandler,t.AnimationHandler,t.AnimStateGraphHandler,t.AudioHandler,t.BinaryHandler,t.CssHandler,t.ContainerHandler,t.CubemapHandler,t.FolderHandler,t.FontHandler,t.GSplatHandler,t.HierarchyHandler,t.HtmlHandler,t.JsonHandler,t.MaterialHandler,t.ModelHandler,t.RenderHandler,t.ScriptHandler,t.SceneHandler,t.ShaderHandler,t.SpriteHandler,t.TemplateHandler,t.TextHandler,t.TextureAtlasHandler,t.TextureHandler],i.soundManager=new t.SoundManager,i.lightmapper=t.Lightmapper,i.batchManager=t.BatchManager,i.xr=t.XrManager,this.app=new t.AppBase(this._canvas),this.app.init(i),this.app.setCanvasFillMode(t.FILLMODE_FILL_WINDOW),this.app.setCanvasResolution(t.RESOLUTION_AUTO),this._pickerCreate();const n=this.querySelectorAll(":scope > pc-asset");Array.from(n).forEach(e=>{e.createAsset();const t=e.asset;t&&this.app.assets.add(t)});const o=this.querySelectorAll(":scope > pc-material");Array.from(o).forEach(e=>{e.createMaterial()});const r=this.querySelectorAll("pc-entity");Array.from(r).forEach(e=>{e.createEntity(this.app)}),r.forEach(e=>{e.buildHierarchy(this.app)}),this._hierarchyReady=!0,this.app.preload(()=>{this.app.start(),window.addEventListener("resize",this._onWindowResize),this._onReady()})}disconnectedCallback(){this._pickerDestroy(),this.app&&(this.app.destroy(),this.app=null),window.removeEventListener("resize",this._onWindowResize),this._canvas&&this.contains(this._canvas)&&(this.removeChild(this._canvas),this._canvas=null)}_onWindowResize(){this.app&&this.app.resizeCanvas()}_pickerCreate(){const{width:e,height:a}=this.app.graphicsDevice;this._picker=new t.Picker(this.app,e,a),this._pointerHandlers.pointermove=this._onPointerMove.bind(this),this._pointerHandlers.pointerdown=this._onPointerDown.bind(this),this._pointerHandlers.pointerup=this._onPointerUp.bind(this),["pointermove","pointerdown","pointerup","pointerenter","pointerleave"].forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null}}_getPickerCoordinates(e){const t=this._canvas.getBoundingClientRect(),a=this._canvas.width/t.width,s=this._canvas.height/t.height;return{x:(e.clientX-t.left)*a,y:(e.clientY-t.top)*s}}_onPointerMove(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);let n=null;if(i.length>0){let e=i[0].node;for(;null!==e;){const t=this.querySelector(`pc-entity[name="${e.name}"]`);if(t){n=t;break}e=e.parent}}this._hoveredEntity!==n&&(this._hoveredEntity&&this._hoveredEntity.hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),n&&n.hasListeners("pointerenter")&&n.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=n,n&&n.hasListeners("pointermove")&&n.dispatchEvent(new PointerEvent("pointermove",e))}_onPointerDown(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);if(i.length>0){let t=i[0].node;for(;null!==t;){const a=this.querySelector(`pc-entity[name="${t.name}"]`);if(a&&a.hasListeners("pointerdown")){a.dispatchEvent(new PointerEvent("pointerdown",e));break}t=t.parent}}}_onPointerUp(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);if(i.length>0){const t=this.querySelector(`pc-entity[name="${i[0].node.name}"]`);t&&t.hasListeners("pointerup")&&t.dispatchEvent(new PointerEvent("pointerup",e))}}_onPointerListenerAdded(e){if(!this._hasPointerListeners[e]&&this._canvas){this._hasPointerListeners[e]=!0;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.addEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}_onPointerListenerRemoved(e){if(!Array.from(this.querySelectorAll("pc-entity")).some(t=>t.hasListeners(e))&&this._canvas){this._hasPointerListeners[e]=!1;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.removeEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}set alpha(e){this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._antialias=e}get antialias(){return this._antialias}set backend(e){this._backend=e}get backend(){return this._backend}set depth(e){this._depth=e}get depth(){return this._depth}get hierarchyReady(){return this._hierarchyReady}set highResolution(e){this._highResolution=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e?window.devicePixelRatio:1)}get highResolution(){return this._highResolution}set stencil(e){this._stencil=e}get stencil(){return this._stencil}static get observedAttributes(){return["alpha","antialias","backend","depth","stencil","high-resolution"]}attributeChangedCallback(e,t,a){switch(e){case"alpha":this.alpha="false"!==a;break;case"antialias":this.antialias="false"!==a;break;case"backend":"webgpu"!==a&&"webgl2"!==a&&"null"!==a||(this.backend=a);break;case"depth":this.depth="false"!==a;break;case"high-resolution":this.highResolution="false"!==a;break;case"stencil":this.stencil="false"!==a}}}customElements.define("pc-app",i);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o=e=>{const a=n[e.toLowerCase()];if(a)return(new t.Color).fromString(a);if(e.startsWith("#"))return(new t.Color).fromString(e);const s=e.split(" ").map(Number);return new t.Color(s)},r=e=>{const a=e.split(" ").map(Number);return new t.Vec2(a)},c=e=>{const a=e.split(" ").map(Number);return new t.Vec3(a)},b=e=>{const a=e.split(" ").map(Number);return new t.Vec4(a)};class h extends a{constructor(){super(...arguments),this._enabled=!0,this._name="Untitled",this._position=new t.Vec3,this._rotation=new t.Vec3,this._scale=new t.Vec3(1,1,1),this._tags=[],this._listeners={},this.entity=null}createEntity(e){this.entity=new t.Entity(this.getAttribute("name")||this._name,e);const a=this.getAttribute("enabled");a&&(this.entity.enabled="false"!==a);const s=this.getAttribute("position");s&&this.entity.setLocalPosition(c(s));const i=this.getAttribute("rotation");i&&this.entity.setLocalEulerAngles(c(i));const n=this.getAttribute("scale");n&&this.entity.setLocalScale(c(n));const o=this.getAttribute("tags");o&&this.entity.tags.add(o.split(",").map(e=>e.trim()));["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"].forEach(e=>{const t=this.getAttribute(e);if(t){const a=e.substring(2),s=e=>{try{new Function("event",t).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(a,s)}})}buildHierarchy(e){if(!this.entity)return;const t=this.closestEntity;(null==t?void 0:t.entity)?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady()}connectedCallback(){const e=this.closestApp;if(e&&e.hierarchyReady){const t=e.app;this.createEntity(t),this.buildHierarchy(t);const a=this.querySelectorAll("pc-entity");a.forEach(e=>{e.createEntity(t)}),a.forEach(e=>{e.buildHierarchy(t)})}}disconnectedCallback(){if(this.entity){this.querySelectorAll("pc-entity").forEach(e=>{e.entity=null}),this.entity.destroy(),this.entity=null}}set enabled(e){this._enabled=e,this.entity&&(this.entity.enabled=e)}get enabled(){return this._enabled}set name(e){this._name=e,this.entity&&(this.entity.name=e)}get name(){return this._name}set position(e){this._position=e,this.entity&&this.entity.setLocalPosition(this._position)}get position(){return this._position}set rotation(e){this._rotation=e,this.entity&&this.entity.setLocalEulerAngles(this._rotation)}get rotation(){return this._rotation}set scale(e){this._scale=e,this.entity&&this.entity.setLocalScale(this._scale)}get scale(){return this._scale}set tags(e){this._tags=e,this.entity&&(this.entity.tags.clear(),this.entity.tags.add(this._tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","name","position","rotation","scale","tags","onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"]}attributeChangedCallback(e,t,a){switch(e){case"enabled":this.enabled="false"!==a;break;case"name":this.name=a;break;case"position":this.position=c(a);break;case"rotation":this.rotation=c(a);break;case"scale":this.scale=c(a);break;case"tags":this.tags=a.split(",").map(e=>e.trim());break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":if(a){const t=e.substring(2),a=e=>{try{const a=this.getAttribute(t)||"";new Function("event",a).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(t,a)}}}addEventListener(e,t,a){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),super.addEventListener(e,t,a),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:connect`,{bubbles:!0}))}removeEventListener(e,t,a){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),super.removeEventListener(e,t,a),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:disconnect`,{bubbles:!0}))}hasListeners(e){var t;return Boolean(null===(t=this._listeners[e])||void 0===t?void 0:t.length)}}customElements.define("pc-entity",h);var l=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var a,s=WebAssembly.validate(e)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",i=WebAssembly.instantiate(n(s),{}).then(function(e){(a=e.instance).exports.__wasm_call_ctors()});function n(e){for(var a=new Uint8Array(e.length),s=0;s<e.length;++s){var i=e.charCodeAt(s);a[s]=i>96?i-97:i>64?i-39:i+4}var n=0;for(s=0;s<e.length;++s)a[n++]=a[s]<60?t[a[s]]:64*(a[s]-60)+a[++s];return a.buffer.slice(0,n)}function o(e,t,s,i,n,o){var r=a.exports.sbrk,c=s+3&-4,b=r(c*i),h=r(n.length),l=new Uint8Array(a.exports.memory.buffer);l.set(n,h);var p=e(b,s,i,h,n.length);if(0==p&&o&&o(b,c,i),t.set(l.subarray(b,b+s*i)),r(b-r(0)),0!=p)throw new Error("Malformed buffer data: "+p)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},b=[],h=0;function l(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var a=e.data;t.pending-=a.count,t.requests[a.id][a.action](a.value),delete t.requests[a.id]},t}function p(e){for(var t="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+o.toString()+d.toString(),a=new Blob([t],{type:"text/javascript"}),i=URL.createObjectURL(a),r=0;r<e;++r)b[r]=l(i);URL.revokeObjectURL(i)}function d(e){i.then(function(){var t=e.data;try{var s=new Uint8Array(t.count*t.size);o(a.exports[t.mode],s,t.count,t.size,t.source,a.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:s},[s.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:i,supported:!0,useWorkers:function(e){p(e)},decodeVertexBuffer:function(e,t,s,i,n){o(a.exports.meshopt_decodeVertexBuffer,e,t,s,i,a.exports[r[n]])},decodeIndexBuffer:function(e,t,s,i){o(a.exports.meshopt_decodeIndexBuffer,e,t,s,i)},decodeIndexSequence:function(e,t,s,i){o(a.exports.meshopt_decodeIndexSequence,e,t,s,i)},decodeGltfBuffer:function(e,t,s,i,n,b){o(a.exports[c[n]],e,t,s,i,a.exports[r[b]])},decodeGltfBufferAsync:function(e,t,s,n,l){return b.length>0?function(e,t,a,s,i){for(var n=b[0],o=1;o<b.length;++o)b[o].pending<n.pending&&(n=b[o]);return new Promise(function(o,r){var c=new Uint8Array(a),b=h++;n.pending+=e,n.requests[b]={resolve:o,reject:r},n.object.postMessage({id:b,count:e,size:t,source:c,mode:s,filter:i},[c.buffer])})}(e,t,s,c[n],r[l]):i.then(function(){var i=new Uint8Array(e*t);return o(a.exports[c[n]],i,e,t,s,a.exports[r[l]]),i})}}}();const p=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),d=(e,t,a)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const s=e.extensions.EXT_meshopt_compression;Promise.all([l.ready,t[s.buffer]]).then(e=>{const t=e[1],i=s.byteOffset||0,n=s.byteLength||0,o=s.count,r=s.byteStride,c=new Uint8Array(o*r),b=new Uint8Array(t.buffer,t.byteOffset+i,n);l.decodeGltfBuffer(c,o,r,b,s.mode,s.filter),a(null,c)})}else a(null,null)};class f extends HTMLElement{constructor(){super(...arguments),this._lazy=!1,this.asset=null}disconnectedCallback(){this.destroyAsset()}createAsset(){var e;const a=this.getAttribute("id")||"",s=this.getAttribute("src")||"";let i=this.getAttribute("type");if(!i){const t=s.split(".").pop();i=null!==(e=p.get(t||""))&&void 0!==e?e:null}i?(this.asset="container"===i?new t.Asset(a,i,{url:s},void 0,{bufferView:{processAsync:d.bind(this)}}):new t.Asset(a,i,{url:s}),this.asset.preload=!this._lazy):console.warn(`Unsupported asset type: ${s}`)}destroyAsset(){this.asset&&(this.asset.unload(),this.asset=null)}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e)}get lazy(){return this._lazy}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return null==t?void 0:t.asset}static get observedAttributes(){return["lazy"]}attributeChangedCallback(e,t,a){"lazy"===e&&(this.lazy=this.hasAttribute("lazy"))}}customElements.define("pc-asset",f);class g extends a{constructor(e){super(),this._enabled=!0,this._component=null,this._componentName=e}getInitialComponentData(){return{}}async addComponent(){const e=this.closestEntity;if(e){await e.ready();const t=this.getInitialComponentData();this._component=e.entity.addComponent(this._componentName,t)}}initComponent(){}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),await this.addComponent(),this.initComponent(),this._onReady()}disconnectedCallback(){this.component&&this.component.entity&&(this._component.entity.removeComponent(this._componentName),this._component=null)}get component(){return this._component}set enabled(e){this._enabled=e,this.component&&(this.component.enabled=e)}get enabled(){return this._enabled}static get observedAttributes(){return["enabled"]}attributeChangedCallback(e,t,a){if("enabled"===e)this.enabled="false"!==a}}class u extends g{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",u);const m=new Map([["none",t.TONEMAP_NONE],["linear",t.TONEMAP_LINEAR],["filmic",t.TONEMAP_FILMIC],["hejl",t.TONEMAP_HEJL],["aces",t.TONEMAP_ACES],["aces2",t.TONEMAP_ACES2],["neutral",t.TONEMAP_NEUTRAL]]);class _ extends g{constructor(){super("camera"),this._clearColor=new t.Color(.75,.75,.75,1),this._clearColorBuffer=!0,this._clearDepthBuffer=!0,this._clearStencilBuffer=!1,this._cullFaces=!0,this._farClip=1e3,this._flipFaces=!1,this._fov=45,this._frustumCulling=!0,this._gamma="srgb",this._horizontalFov=!1,this._nearClip=.1,this._orthographic=!1,this._orthoHeight=10,this._priority=0,this._rect=new t.Vec4(0,0,1,1),this._scissorRect=new t.Vec4(0,0,1,1),this._tonemap="none"}getInitialComponentData(){return{clearColor:this._clearColor,clearColorBuffer:this._clearColorBuffer,clearDepthBuffer:this._clearDepthBuffer,clearStencilBuffer:this._clearStencilBuffer,cullFaces:this._cullFaces,farClip:this._farClip,flipFaces:this._flipFaces,fov:this._fov,frustumCulling:this._frustumCulling,gammaCorrection:"srgb"===this._gamma?t.GAMMA_SRGB:t.GAMMA_NONE,horizontalFov:this._horizontalFov,nearClip:this._nearClip,orthographic:this._orthographic,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:m.get(this._tonemap)}}get xrAvailable(){var e;const a=null===(e=this.component)||void 0===e?void 0:e.system.app.xr;return a&&a.supported&&a.isAvailable(t.XRTYPE_VR)}startXr(e,t){this.component&&this.xrAvailable&&this.component.startXr(e,t,{callback:e=>{e&&console.error(`WebXR Immersive VR failed to start: ${e.message}`)}})}endXr(){this.component&&this.component.endXr()}get component(){return super.component}set clearColor(e){this._clearColor=e,this.component&&(this.component.clearColor=e)}get clearColor(){return this._clearColor}set clearColorBuffer(e){this._clearColorBuffer=e,this.component&&(this.component.clearColorBuffer=e)}get clearColorBuffer(){return this._clearColorBuffer}set clearDepthBuffer(e){this._clearDepthBuffer=e,this.component&&(this.component.clearDepthBuffer=e)}get clearDepthBuffer(){return this._clearDepthBuffer}set clearStencilBuffer(e){this._clearStencilBuffer=e,this.component&&(this.component.clearStencilBuffer=e)}get clearStencilBuffer(){return this._clearStencilBuffer}set cullFaces(e){this._cullFaces=e,this.component&&(this.component.cullFaces=e)}get cullFaces(){return this._cullFaces}set farClip(e){this._farClip=e,this.component&&(this.component.farClip=e)}get farClip(){return this._farClip}set flipFaces(e){this._flipFaces=e,this.component&&(this.component.flipFaces=e)}get flipFaces(){return this._flipFaces}set fov(e){this._fov=e,this.component&&(this.component.fov=e)}get fov(){return this._fov}set frustumCulling(e){this._frustumCulling=e,this.component&&(this.component.frustumCulling=e)}get frustumCulling(){return this._frustumCulling}set gamma(e){this._gamma=e,this.component&&(this.component.gammaCorrection="srgb"===e?t.GAMMA_SRGB:t.GAMMA_NONE)}get gamma(){return this._gamma}set horizontalFov(e){this._horizontalFov=e,this.component&&(this.component.horizontalFov=e)}get horizontalFov(){return this._horizontalFov}set nearClip(e){this._nearClip=e,this.component&&(this.component.nearClip=e)}get nearClip(){return this._nearClip}set orthographic(e){this._orthographic=e,this.component&&(this.component.projection=e?t.PROJECTION_ORTHOGRAPHIC:t.PROJECTION_PERSPECTIVE)}get orthographic(){return this._orthographic}set orthoHeight(e){this._orthoHeight=e,this.component&&(this.component.orthoHeight=e)}get orthoHeight(){return this._orthoHeight}set priority(e){this._priority=e,this.component&&(this.component.priority=e)}get priority(){return this._priority}set rect(e){this._rect=e,this.component&&(this.component.rect=e)}get rect(){return this._rect}set scissorRect(e){this._scissorRect=e,this.component&&(this.component.scissorRect=e)}get scissorRect(){return this._scissorRect}set tonemap(e){var a;this._tonemap=e,this.component&&(this.component.toneMapping=null!==(a=m.get(e))&&void 0!==a?a:t.TONEMAP_NONE)}get tonemap(){return this._tonemap}static get observedAttributes(){return[...super.observedAttributes,"clear-color","clear-color-buffer","clear-depth-buffer","clear-stencil-buffer","cull-faces","far-clip","flip-faces","fov","frustum-culling","gamma","horizontal-fov","near-clip","orthographic","ortho-height","priority","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"clear-color":this.clearColor=o(a);break;case"clear-color-buffer":this.clearColorBuffer="false"!==a;break;case"clear-depth-buffer":this.clearDepthBuffer="false"!==a;break;case"clear-stencil-buffer":this.clearStencilBuffer="false"!==a;break;case"cull-faces":this.cullFaces="false"!==a;break;case"far-clip":this.farClip=parseFloat(a);break;case"flip-faces":this.flipFaces="true"!==a;break;case"fov":this.fov=parseFloat(a);break;case"frustum-culling":this.frustumCulling="false"!==a;break;case"gamma":this.gamma=a;break;case"horizontal-fov":this.horizontalFov=this.hasAttribute("horizontal-fov");break;case"near-clip":this.nearClip=parseFloat(a);break;case"orthographic":this.orthographic=this.hasAttribute("orthographic");break;case"ortho-height":this.orthoHeight=parseFloat(a);break;case"priority":this.priority=parseFloat(a);break;case"rect":this.rect=b(a);break;case"scissor-rect":this.scissorRect=b(a);break;case"tonemap":this.tonemap=a}}}customElements.define("pc-camera",_);class k extends g{constructor(){super("collision"),this._angularOffset=new t.Quat,this._axis=1,this._convexHull=!1,this._halfExtents=new t.Vec3(.5,.5,.5),this._height=2,this._linearOffset=new t.Vec3,this._radius=.5,this._type="box"}getInitialComponentData(){return{axis:this._axis,angularOffset:this._angularOffset,convexHull:this._convexHull,halfExtents:this._halfExtents,height:this._height,linearOffset:this._linearOffset,radius:this._radius,type:this._type}}get component(){return super.component}set angularOffset(e){this._angularOffset=e,this.component&&(this.component.angularOffset=e)}get angularOffset(){return this._angularOffset}set axis(e){this._axis=e,this.component&&(this.component.axis=e)}get axis(){return this._axis}set convexHull(e){this._convexHull=e,this.component&&(this.component.convexHull=e)}get convexHull(){return this._convexHull}set halfExtents(e){this._halfExtents=e,this.component&&(this.component.halfExtents=e)}get halfExtents(){return this._halfExtents}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set linearOffset(e){this._linearOffset=e,this.component&&(this.component.linearOffset=e)}get linearOffset(){return this._linearOffset}set radius(e){this._radius=e,this.component&&(this.component.radius=e)}get radius(){return this._radius}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-offset","axis","convex-hull","half-extents","height","linear-offset","radius","type"]}attributeChangedCallback(e,a,s){switch(super.attributeChangedCallback(e,a,s),e){case"angular-offset":this.angularOffset=(e=>{const[a,s,i]=e.split(" ").map(Number),n=new t.Quat;return n.setFromEulerAngles(a,s,i),n})(s);break;case"axis":this.axis=parseInt(s,10);break;case"convex-hull":this.convexHull=this.hasAttribute("convex-hull");break;case"half-extents":this.halfExtents=c(s);break;case"height":this.height=parseFloat(s);break;case"linear-offset":this.linearOffset=c(s);break;case"radius":this.radius=parseFloat(s);break;case"type":this.type=s}}}customElements.define("pc-collision",k);class v extends g{constructor(){super("element"),this._anchor=new t.Vec4(.5,.5,.5,.5),this._asset="",this._autoWidth=!0,this._color=new t.Color(1,1,1,1),this._fontSize=32,this._lineHeight=32,this._pivot=new t.Vec2(.5,.5),this._text="",this._type="group",this._width=0,this._wrapLines=!1}initComponent(){this.component._text._material.useFog=!0}getInitialComponentData(){return{anchor:this._anchor,autoWidth:this._autoWidth,color:this._color,fontAsset:f.get(this._asset).id,fontSize:this._fontSize,lineHeight:this._lineHeight,pivot:this._pivot,type:this._type,text:this._text,width:this._width,wrapLines:this._wrapLines}}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.fontAsset=t.id)}get asset(){return this._asset}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set width(e){this._width=e,this.component&&(this.component.width=e)}get width(){return this._width}set wrapLines(e){this._wrapLines=e,this.component&&(this.component.wrapLines=e)}get wrapLines(){return this._wrapLines}static get observedAttributes(){return[...super.observedAttributes,"anchor","asset","auto-width","color","font-size","line-height","pivot","text","type","width","wrap-lines"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"anchor":this.anchor=b(a);break;case"asset":this.asset=a;break;case"auto-width":this.autoWidth="false"!==a;break;case"color":this.color=o(a);break;case"font-size":this.fontSize=Number(a);break;case"line-height":this.lineHeight=Number(a);break;case"pivot":this.pivot=r(a);break;case"text":this.text=a;break;case"type":this.type=a;break;case"width":this.width=Number(a);break;case"wrap-lines":this.wrapLines=this.hasAttribute(e)}}}customElements.define("pc-element",v);const y=new Map([["pcf1-16f",t.SHADOW_PCF1_16F],["pcf1-32f",t.SHADOW_PCF1_32F],["pcf3-16f",t.SHADOW_PCF3_16F],["pcf3-32f",t.SHADOW_PCF3_32F],["pcf5-16f",t.SHADOW_PCF5_16F],["pcf5-32f",t.SHADOW_PCF5_32F],["vsm-16f",t.SHADOW_VSM_16F],["vsm-32f",t.SHADOW_VSM_32F],["pcss-32f",t.SHADOW_PCSS_32F]]);class w extends g{constructor(){super("light"),this._castShadows=!1,this._color=new t.Color(1,1,1),this._innerConeAngle=40,this._intensity=1,this._normalOffsetBias=.05,this._outerConeAngle=45,this._range=10,this._shadowBias=.2,this._shadowDistance=16,this._shadowIntensity=1,this._shadowResolution=1024,this._shadowType="pcf3-32f",this._type="directional",this._vsmBias=.01,this._vsmBlurSize=11}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,range:this._range,shadowBias:this._shadowBias,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowType:y.get(this._shadowType),type:this._type,vsmBias:this._vsmBias,vsmBlurSize:this._vsmBlurSize}}get component(){return super.component}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set innerConeAngle(e){this._innerConeAngle=e,this.component&&(this.component.innerConeAngle=e)}get innerConeAngle(){return this._innerConeAngle}set intensity(e){this._intensity=e,this.component&&(this.component.intensity=e)}get intensity(){return this._intensity}set normalOffsetBias(e){this._normalOffsetBias=e,this.component&&(this.component.normalOffsetBias=e)}get normalOffsetBias(){return this._normalOffsetBias}set outerConeAngle(e){this._outerConeAngle=e,this.component&&(this.component.outerConeAngle=e)}get outerConeAngle(){return this._outerConeAngle}set range(e){this._range=e,this.component&&(this.component.range=e)}get range(){return this._range}set shadowBias(e){this._shadowBias=e,this.component&&(this.component.shadowBias=e)}get shadowBias(){return this._shadowBias}set shadowDistance(e){this._shadowDistance=e,this.component&&(this.component.shadowDistance=e)}get shadowDistance(){return this._shadowDistance}set shadowIntensity(e){this._shadowIntensity=e,this.component&&(this.component.shadowIntensity=e)}get shadowIntensity(){return this._shadowIntensity}set shadowResolution(e){this._shadowResolution=e,this.component&&(this.component.shadowResolution=e)}get shadowResolution(){return this._shadowResolution}set shadowType(e){var a;this._shadowType=e,this.component&&(this.component.shadowType=null!==(a=y.get(e))&&void 0!==a?a:t.SHADOW_PCF3_32F)}get shadowType(){return this._shadowType}set type(e){["directional","omni","spot"].includes(e)?(this._type=e,this.component&&(this.component.type=e)):console.warn(`Invalid light type '${e}', using default type '${this._type}'.`)}get type(){return this._type}set vsmBias(e){this._vsmBias=e,this.component&&(this.component.vsmBias=e)}get vsmBias(){return this._vsmBias}set vsmBlurSize(e){this._vsmBlurSize=e,this.component&&(this.component.vsmBlurSize=e)}get vsmBlurSize(){return this._vsmBlurSize}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","range","shadow-bias","shadow-distance","shadow-intensity","shadow-resolution","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"color":this.color=o(a);break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"inner-cone-angle":this.innerConeAngle=Number(a);break;case"intensity":this.intensity=Number(a);break;case"normal-offset-bias":this.normalOffsetBias=Number(a);break;case"outer-cone-angle":this.outerConeAngle=Number(a);break;case"range":this.range=Number(a);break;case"shadow-bias":this.shadowBias=Number(a);break;case"shadow-distance":this.shadowDistance=Number(a);break;case"shadow-resolution":this.shadowResolution=Number(a);break;case"shadow-intensity":this.shadowIntensity=Number(a);break;case"shadow-type":this.shadowType=a;break;case"type":this.type=a;break;case"vsm-bias":this.vsmBias=Number(a);break;case"vsm-blur-size":this.vsmBlurSize=Number(a)}}}customElements.define("pc-light",w);class A extends g{constructor(){super("particlesystem"),this._asset=""}getInitialComponentData(){var e;const t=f.get(this._asset);if(!t)return{};if(t.resource.colorMapAsset){const a=t.resource.colorMapAsset,s=null===(e=f.get(a))||void 0===e?void 0:e.id;s&&(t.resource.colorMapAsset=s)}return t.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)e.hasOwnProperty(t)&&(this.component[t]=e[t])}async _loadAsset(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app,s=f.get(this._asset);s&&(s.loaded?this.applyConfig(s.resource):(s.once("load",()=>{this.applyConfig(s.resource)}),a.assets.load(s)))}set asset(e){this._asset=e,this.isConnected&&this._loadAsset()}get asset(){return this._asset}play(){this.component&&this.component.play()}pause(){this.component&&this.component.pause()}reset(){this.component&&this.component.reset()}stop(){this.component&&this.component.stop()}static get observedAttributes(){return[...super.observedAttributes,"asset"]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),"asset"===e)this.asset=a}}customElements.define("pc-particles",A);class x extends HTMLElement{constructor(){super(...arguments),this._diffuse=new t.Color(1,1,1),this._diffuseMap="",this._metalnessMap="",this._normalMap="",this._roughnessMap="",this.material=null}createMaterial(){this.material=new t.StandardMaterial,this.material.glossInvert=!1,this.material.useMetalness=!1,this.material.diffuse=this._diffuse,this.diffuseMap=this._diffuseMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.roughnessMap=this._roughnessMap,this.material.update()}disconnectedCallback(){this.material&&(this.material.destroy(),this.material=null)}setMap(e,t){if(this.material){const a=f.get(e);a&&(a.loaded?(this.material[t]=a.resource,this.material[t].anisotropy=4):a.once("load",()=>{this.material[t]=a.resource,this.material[t].anisotropy=4,this.material.update()}))}}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e)}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this.setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set metalnessMap(e){this._metalnessMap=e,this.setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set normalMap(e){this._normalMap=e,this.setMap(e,"normalMap")}get normalMap(){return this._normalMap}set roughnessMap(e){this._roughnessMap=e,this.setMap(e,"glossMap")}get roughnessMap(){return this._roughnessMap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return null==t?void 0:t.material}static get observedAttributes(){return["diffuse","diffuse-map","metalness-map","normal-map","roughness-map"]}attributeChangedCallback(e,t,a){switch(e){case"diffuse":this.diffuse=o(a);break;case"diffuse-map":this.diffuseMap=a;break;case"metalness-map":this.metalnessMap=a;break;case"normal-map":this.normalMap=a;break;case"roughness-map":this.roughnessMap=a}}}customElements.define("pc-material",x);class C extends g{constructor(){super("render"),this._castShadows=!0,this._material="",this._receiveShadows=!0,this._type="asset"}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:x.get(this._material),receiveShadows:this._receiveShadows}}get component(){return super.component}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set material(e){this._material=e,this.component&&(this.component.material=x.get(e))}get material(){return this._material}set receiveShadows(e){this._receiveShadows=e,this.component&&(this.component.receiveShadows=e)}get receiveShadows(){return this._receiveShadows}static get observedAttributes(){return[...super.observedAttributes,"cast-shadows","material","receive-shadows","type"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"cast-shadows":this.castShadows="false"!==a;break;case"material":this.material=a;break;case"receive-shadows":this.receiveShadows="false"!==a;break;case"type":this.type=a}}}customElements.define("pc-render",C);class S extends g{constructor(){super("rigidbody"),this._angularDamping=0,this._angularFactor=new t.Vec3(1,1,1),this._friction=.5,this._linearDamping=0,this._linearFactor=new t.Vec3(1,1,1),this._mass=1,this._restitution=0,this._rollingFriction=0,this._type="static"}getInitialComponentData(){return{angularDamping:this._angularDamping,angularFactor:this._angularFactor,friction:this._friction,linearDamping:this._linearDamping,linearFactor:this._linearFactor,mass:this._mass,restitution:this._restitution,rollingFriction:this._rollingFriction,type:this._type}}get component(){return super.component}set angularDamping(e){this._angularDamping=e,this.component&&(this.component.angularDamping=e)}get angularDamping(){return this._angularDamping}set angularFactor(e){this._angularFactor=e,this.component&&(this.component.angularFactor=e)}get angularFactor(){return this._angularFactor}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set linearDamping(e){this._linearDamping=e,this.component&&(this.component.linearDamping=e)}get linearDamping(){return this._linearDamping}set linearFactor(e){this._linearFactor=e,this.component&&(this.component.linearFactor=e)}get linearFactor(){return this._linearFactor}set mass(e){this._mass=e,this.component&&(this.component.mass=e)}get mass(){return this._mass}set restitution(e){this._restitution=e,this.component&&(this.component.restitution=e)}get restitution(){return this._restitution}set rollingFriction(e){this._rollingFriction=e,this.component&&(this.component.rollingFriction=e)}get rollingFriction(){return this._rollingFriction}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-damping","angular-factor","friction","linear-damping","linear-factor","mass","restitution","rolling-friction","type"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"angular-damping":this.angularDamping=parseFloat(a);break;case"angular-factor":this.angularFactor=c(a);break;case"friction":this.friction=parseFloat(a);break;case"linear-damping":this.linearDamping=parseFloat(a);break;case"linear-factor":this.linearFactor=c(a);break;case"mass":this.mass=parseFloat(a);break;case"restitution":this.restitution=parseFloat(a);break;case"rolling-friction":this.rollingFriction=parseFloat(a);break;case"type":this.type=a}}}customElements.define("pc-rigidbody",S);class j extends g{constructor(){super("screen"),this._screenSpace=!1,this._resolution=new t.Vec2(640,320),this._referenceResolution=new t.Vec2(640,320),this._priority=0,this._blend=!1,this._scaleBlend=.5}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE,screenSpace:this._screenSpace}}get component(){return super.component}set priority(e){this._priority=e,this.component&&(this.component.priority=this._priority)}get priority(){return this._priority}set referenceResolution(e){this._referenceResolution=e,this.component&&(this.component.referenceResolution=this._referenceResolution)}get referenceResolution(){return this._referenceResolution}set resolution(e){this._resolution=e,this.component&&(this.component.resolution=this._resolution)}get resolution(){return this._resolution}set scaleBlend(e){this._scaleBlend=e,this.component&&(this.component.scaleBlend=this._scaleBlend)}get scaleBlend(){return this._scaleBlend}set blend(e){this._blend=e,this.component&&(this.component.scaleMode=this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE)}get blend(){return this._blend}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"blend","screen-space","resolution","reference-resolution","priority","scale-blend"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"priority":this.priority=parseInt(a,10);break;case"reference-resolution":this.referenceResolution=r(a);break;case"resolution":this.resolution=r(a);break;case"scale-blend":this.scaleBlend=parseFloat(a);break;case"blend":this.blend=this.hasAttribute("blend");break;case"screen-space":this.screenSpace=this.hasAttribute("screen-space")}}}customElements.define("pc-screen",j);class F extends g{constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.observer.observe(this,{childList:!0}),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this))}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{const t=e.getAttribute("name"),a=e.getAttribute("attributes");t&&this.createScript(t,a)})}convertAttributes(e){if("string"==typeof e){if(e.startsWith("asset:")){const t=e.slice(6),a=document.querySelector(`pc-asset#${t}`);if(a)return a.asset}if(e.startsWith("entity:")){const t=e.slice(7),a=document.querySelector(`pc-entity[name="${t}"]`);if(a)return a.entity}if(e.startsWith("vec2:")){const a=e.slice(5).split(",").map(Number);if(2===a.length&&a.every(e=>!isNaN(e)))return new t.Vec2(a[0],a[1])}if(e.startsWith("vec3:")){const a=e.slice(5).split(",").map(Number);if(3===a.length&&a.every(e=>!isNaN(e)))return new t.Vec3(a[0],a[1],a[2])}if(e.startsWith("vec4:")){const a=e.slice(5).split(",").map(Number);if(4===a.length&&a.every(e=>!isNaN(e)))return new t.Vec4(a[0],a[1],a[2],a[3])}if(e.startsWith("color:")){const a=e.slice(6).split(",").map(Number);if(4===a.length&&a.every(e=>!isNaN(e)))return new t.Color(a[0],a[1],a[2],a[3])}return e}if(Array.isArray(e))return e.length>0&&e[0],e.map(e=>this.convertAttributes(e));if(e&&"object"==typeof e){const t={};for(const a in e)t[a]=this.convertAttributes(e[a]);return t}return e}preprocessAttributes(e){return this.convertAttributes(e)}mergeDeep(e,t){for(const a in t)t[a]&&"object"==typeof t[a]&&!Array.isArray(t[a])?(e[a]&&"object"==typeof e[a]||(e[a]={}),this.mergeDeep(e[a],t[a])):e[a]=t[a];return e}applyAttributes(e,t){try{const a=t?JSON.parse(t):{},s=this.convertAttributes(a);this.mergeDeep(e,s)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}}handleScriptAttributesChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const a=this.component.get(t);a&&this.applyAttributes(a,e.detail.attributes)}handleScriptEnableChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const a=this.component.get(t);a&&(a.enabled=e.detail.enabled)}createScript(e,t){if(!this.component)return null;let a={};if(t)try{a=JSON.parse(t),a=this.preprocessAttributes(a)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}return this.component.create(e,{properties:a})}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e)t.addedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name"),a=e.getAttribute("attributes");t&&this.createScript(t,a)}}),t.removedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name");t&&this.destroyScript(t)}})}disconnectedCallback(){var e;this.observer.disconnect(),null===(e=super.disconnectedCallback)||void 0===e||e.call(this)}get component(){return super.component}}customElements.define("pc-scripts",F);class E extends HTMLElement{constructor(){super(...arguments),this._attributes="{}",this._enabled=!0,this._name=""}set scriptAttributes(e){this._attributes=e,this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:e},bubbles:!0}))}get scriptAttributes(){return this._attributes}set enabled(e){this._enabled=e,this.dispatchEvent(new CustomEvent("scriptenablechange",{detail:{enabled:e},bubbles:!0}))}get enabled(){return this._enabled}set name(e){this._name=e}get name(){return this._name}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,a){switch(e){case"attributes":this.scriptAttributes=a;break;case"enabled":this.enabled="false"!==a;break;case"name":this.name=a}}}customElements.define("pc-script",E);class O extends g{constructor(){super("sound"),this._distanceModel="linear",this._maxDistance=1e4,this._pitch=1,this._positional=!1,this._refDistance=1,this._rollOffFactor=1,this._volume=1}getInitialComponentData(){return{distanceModel:this._distanceModel,maxDistance:this._maxDistance,pitch:this._pitch,positional:this._positional,refDistance:this._refDistance,rollOffFactor:this._rollOffFactor,volume:this._volume}}get component(){return super.component}set distanceModel(e){this._distanceModel=e,this.component&&(this.component.distanceModel=e)}get distanceModel(){return this._distanceModel}set maxDistance(e){this._maxDistance=e,this.component&&(this.component.maxDistance=e)}get maxDistance(){return this._maxDistance}set pitch(e){this._pitch=e,this.component&&(this.component.pitch=e)}get pitch(){return this._pitch}set positional(e){this._positional=e,this.component&&(this.component.positional=e)}get positional(){return this._positional}set refDistance(e){this._refDistance=e,this.component&&(this.component.refDistance=e)}get refDistance(){return this._refDistance}set rollOffFactor(e){this._rollOffFactor=e,this.component&&(this.component.rollOffFactor=e)}get rollOffFactor(){return this._rollOffFactor}set volume(e){this._volume=e,this.component&&(this.component.volume=e)}get volume(){return this._volume}static get observedAttributes(){return[...super.observedAttributes,"distance-model","max-distance","pitch","positional","ref-distance","roll-off-factor","volume"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"distance-model":this.distanceModel=a;break;case"max-distance":this.maxDistance=parseFloat(a);break;case"pitch":this.pitch=parseFloat(a);break;case"positional":this.positional=this.hasAttribute("positional");break;case"ref-distance":this.refDistance=parseFloat(a);break;case"roll-off-factor":this.rollOffFactor=parseFloat(a);break;case"volume":this.volume=parseFloat(a)}}}customElements.define("pc-sounds",O);class R extends a{constructor(){super(...arguments),this._asset="",this._autoPlay=!1,this._duration=null,this._loop=!1,this._name="",this._overlap=!1,this._pitch=1,this._startTime=0,this._volume=1,this.soundSlot=null}async connectedCallback(){var e;await(null===(e=this.soundElement)||void 0===e?void 0:e.ready());const t={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(t.duration=this._duration),this.soundSlot=this.soundElement.component.addSlot(this._name,t),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this.soundElement.component.removeSlot(this._name)}get soundElement(){const e=this.parentElement;return e instanceof O?e:(console.warn("pc-sound-slot must be a direct child of a pc-sound element"),null)}set asset(e){var t;if(this._asset=e,this.soundSlot){const a=null===(t=f.get(e))||void 0===t?void 0:t.id;a&&(this.soundSlot.asset=a)}}get asset(){return this._asset}set autoPlay(e){this._autoPlay=e,this.soundSlot&&(this.soundSlot.autoPlay=e)}get autoPlay(){return this._autoPlay}set duration(e){this._duration=e,this.soundSlot&&(this.soundSlot.duration=e)}get duration(){return this._duration}set loop(e){this._loop=e,this.soundSlot&&(this.soundSlot.loop=e)}get loop(){return this._loop}set name(e){this._name=e,this.soundSlot&&(this.soundSlot.name=e)}get name(){return this._name}set overlap(e){this._overlap=e,this.soundSlot&&(this.soundSlot.overlap=e)}get overlap(){return this._overlap}set pitch(e){this._pitch=e,this.soundSlot&&(this.soundSlot.pitch=e)}get pitch(){return this._pitch}set startTime(e){this._startTime=e,this.soundSlot&&(this.soundSlot.startTime=e)}get startTime(){return this._startTime}set volume(e){this._volume=e,this.soundSlot&&(this.soundSlot.volume=e)}get volume(){return this._volume}static get observedAttributes(){return["asset","auto-play","duration","loop","name","overlap","pitch","start-time","volume"]}attributeChangedCallback(e,t,a){switch(e){case"asset":this.asset=a;break;case"auto-play":this.autoPlay=this.hasAttribute("auto-play");break;case"duration":this.duration=parseFloat(a);break;case"loop":this.loop=this.hasAttribute("loop");break;case"name":this.name=a;break;case"overlap":this.overlap=this.hasAttribute("overlap");break;case"pitch":this.pitch=parseFloat(a);break;case"start-time":this.startTime=parseFloat(a);break;case"volume":this.volume=parseFloat(a)}}}customElements.define("pc-sound",R);class P extends g{constructor(){super("gsplat"),this._asset="",this._castShadows=!1}getInitialComponentData(){return{asset:f.get(this._asset),castShadows:this._castShadows}}get component(){return super.component}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.asset=t)}get asset(){return this._asset}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"asset":this.asset=a;break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows")}}}customElements.define("pc-splat",P);class H extends a{constructor(){super(...arguments),this._asset="",this._entity=null}connectedCallback(){this._loadModel(),this._onReady()}disconnectedCallback(){this._unloadModel()}_instantiate(e){this._entity=e.instantiateRenderEntity(),e.animations.length>0&&(this._entity.addComponent("anim"),this._entity.anim.assignAnimation("animation",e.animations[0].resource));const t=this.closestEntity;if(t)t.ready().then(()=>{t.entity.addChild(this._entity)});else{const e=this.closestApp;e&&e.ready().then(()=>{e.app.root.addChild(this._entity)})}}async _loadModel(){var e;this._unloadModel();const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app,s=f.get(this._asset);s&&(s.loaded?this._instantiate(s.resource):(s.once("load",()=>{this._instantiate(s.resource)}),a.assets.load(s)))}_unloadModel(){var e;null===(e=this._entity)||void 0===e||e.destroy(),this._entity=null}set asset(e){this._asset=e,this.isConnected&&this._loadModel()}get asset(){return this._asset}static get observedAttributes(){return["asset"]}attributeChangedCallback(e,t,a){if("asset"===e)this.asset=a}}customElements.define("pc-model",H);class D extends a{constructor(){super(...arguments),this._fog="none",this._fogColor=new t.Color(1,1,1),this._fogDensity=0,this._fogStart=0,this._fogEnd=1e3,this._gravity=new t.Vec3(0,-9.81,0),this.scene=null}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),this.scene=this.closestApp.app.scene,this.updateSceneSettings(),this._onReady()}updateSceneSettings(){if(this.scene){this.scene.fog.type=this._fog,this.scene.fog.color=this._fogColor,this.scene.fog.density=this._fogDensity,this.scene.fog.start=this._fogStart,this.scene.fog.end=this._fogEnd;this.parentElement.app.systems.rigidbody.gravity.copy(this._gravity)}}set fog(e){this._fog=e,this.scene&&(this.scene.fog.type=e)}get fog(){return this._fog}set fogColor(e){this._fogColor=e,this.scene&&(this.scene.fog.color=e)}get fogColor(){return this._fogColor}set fogDensity(e){this._fogDensity=e,this.scene&&(this.scene.fog.density=e)}get fogDensity(){return this._fogDensity}set fogStart(e){this._fogStart=e,this.scene&&(this.scene.fog.start=e)}get fogStart(){return this._fogStart}set fogEnd(e){this._fogEnd=e,this.scene&&(this.scene.fog.end=e)}get fogEnd(){return this._fogEnd}set gravity(e){if(this._gravity=e,this.scene){this.parentElement.app.systems.rigidbody.gravity.copy(e)}}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,a){switch(e){case"fog":this.fog=a;break;case"fog-color":this.fogColor=o(a);break;case"fog-density":this.fogDensity=parseFloat(a);break;case"fog-start":this.fogStart=parseFloat(a);break;case"fog-end":this.fogEnd=parseFloat(a);break;case"gravity":this.gravity=c(a)}}}customElements.define("pc-scene",D);class z extends a{constructor(){super(...arguments),this._asset="",this._center=new t.Vec3(0,.01,0),this._intensity=1,this._rotation=new t.Vec3,this._level=0,this._lighting=!1,this._scale=new t.Vec3(100,100,100),this._type="infinite",this._scene=null}connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._unloadSkybox()}_generateSkybox(e){if(!this._scene)return;const a=e.resource,s=t.EnvLighting.generateSkyboxCubemap(a);if(s.anisotropy=4,this._scene.skybox=s,this._lighting){const e=t.EnvLighting.generateLightingSource(a),s=t.EnvLighting.generateAtlas(e);this._scene.envAtlas=s}const i=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);i&&(i.enabled="none"!==this._type),this._scene.sky.type=this._type,this._scene.sky.node.setLocalScale(this._scale),this._scene.sky.center=this._center,this._scene.skyboxIntensity=this._intensity,this._scene.skyboxMip=this._level}async _loadSkybox(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app;if(!a)return;const s=f.get(this._asset);s&&(this._scene=a.scene,s.loaded?this._generateSkybox(s):(s.once("load",()=>{this._generateSkybox(s)}),a.assets.load(s)))}_unloadSkybox(){var e,t;this._scene&&(null===(e=this._scene.skybox)||void 0===e||e.destroy(),this._scene.skybox=null,null===(t=this._scene.envAtlas)||void 0===t||t.destroy(),this._scene.envAtlas=null,this._scene=null)}set asset(e){this._asset=e,this.isConnected&&this._loadSkybox()}get asset(){return this._asset}set center(e){this._center=e,this._scene&&(this._scene.sky.center=this._center)}get center(){return this._center}set intensity(e){this._intensity=e,this._scene&&(this._scene.skyboxIntensity=this._intensity)}get intensity(){return this._intensity}set level(e){this._level=e,this._scene&&(this._scene.skyboxMip=this._level)}get level(){return this._level}set lighting(e){this._lighting=e}get lighting(){return this._lighting}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new t.Quat).setFromEulerAngles(e))}get rotation(){return this._rotation}set scale(e){this._scale=e,this._scene&&this._scene.sky.node.setLocalScale(this._scale)}get scale(){return this._scale}set type(e){if(this._type=e,this._scene){this._scene.sky.type=this._type;const e=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","level","lighting","rotation","scale","type"]}attributeChangedCallback(e,t,a){switch(e){case"asset":this.asset=a;break;case"center":this.center=c(a);break;case"intensity":this.intensity=parseFloat(a);break;case"level":this.level=parseInt(a,10);break;case"lighting":this.lighting=this.hasAttribute(e);break;case"rotation":this.rotation=c(a);break;case"scale":this.scale=c(a);break;case"type":this.type=a}}}customElements.define("pc-sky",z),e.AppElement=i,e.AssetElement=f,e.AsyncElement=a,e.CameraComponentElement=_,e.CollisionComponentElement=k,e.ComponentElement=g,e.ElementComponentElement=v,e.EntityElement=h,e.LightComponentElement=w,e.ListenerComponentElement=u,e.MaterialElement=x,e.ModelElement=H,e.ModuleElement=s,e.ParticleSystemComponentElement=A,e.RenderComponentElement=C,e.RigidBodyComponentElement=S,e.SceneElement=D,e.ScreenComponentElement=j,e.ScriptComponentElement=F,e.ScriptElement=E,e.SkyElement=z,e.SoundComponentElement=O,e.SoundSlotElement=R,e.SplatComponentElement=P});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("playcanvas")):"function"==typeof define&&define.amd?define(["exports","playcanvas"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pd={},e.pc)}(this,function(e,t){"use strict";class a extends HTMLElement{constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-app")}get closestEntity(){var e;return null===(e=this.parentElement)||void 0===e?void 0:e.closest("pc-entity")}_onReady(){this._readyResolve(),this.dispatchEvent(new CustomEvent("ready"))}ready(){return this._readyPromise.then(()=>this)}}class s extends HTMLElement{constructor(){super(),this.loadPromise=this.loadModule()}async loadModule(){const e=this.getAttribute("name"),a={glueUrl:this.getAttribute("glue"),wasmUrl:this.getAttribute("wasm"),fallbackUrl:this.getAttribute("fallback")};"Basis"===e?t.basisInitialize(a):(t.WasmModule.setConfig(e,a),await new Promise(a=>{t.WasmModule.getInstance(e,()=>a())}))}getLoadPromise(){return this.loadPromise}}customElements.define("pc-module",s);class i extends a{constructor(){super(),this._canvas=null,this._alpha=!0,this._backend="webgl2",this._antialias=!0,this._depth=!0,this._stencil=!0,this._highResolution=!0,this._hierarchyReady=!1,this._picker=null,this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1},this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this.app=null,this._onWindowResize=this._onWindowResize.bind(this)}async connectedCallback(){const e=this.querySelectorAll(":scope > pc-module");await Promise.all(Array.from(e).map(e=>e.getLoadPromise())),this._canvas=document.createElement("canvas"),this.appendChild(this._canvas);const a={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[],s=await t.createGraphicsDevice(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depth,deviceTypes:a,stencil:this._stencil});s.maxPixelRatio=this._highResolution?window.devicePixelRatio:1;const i=new t.AppOptions;i.graphicsDevice=s,i.keyboard=new t.Keyboard(window),i.mouse=new t.Mouse(this._canvas),i.componentSystems=[t.AnimComponentSystem,t.AnimationComponentSystem,t.AudioListenerComponentSystem,t.ButtonComponentSystem,t.CameraComponentSystem,t.CollisionComponentSystem,t.ElementComponentSystem,t.GSplatComponentSystem,t.JointComponentSystem,t.LayoutChildComponentSystem,t.LayoutGroupComponentSystem,t.LightComponentSystem,t.ModelComponentSystem,t.ParticleSystemComponentSystem,t.RenderComponentSystem,t.RigidBodyComponentSystem,t.ScreenComponentSystem,t.ScriptComponentSystem,t.ScrollbarComponentSystem,t.ScrollViewComponentSystem,t.SoundComponentSystem,t.SpriteComponentSystem,t.ZoneComponentSystem],i.resourceHandlers=[t.AnimClipHandler,t.AnimationHandler,t.AnimStateGraphHandler,t.AudioHandler,t.BinaryHandler,t.CssHandler,t.ContainerHandler,t.CubemapHandler,t.FolderHandler,t.FontHandler,t.GSplatHandler,t.HierarchyHandler,t.HtmlHandler,t.JsonHandler,t.MaterialHandler,t.ModelHandler,t.RenderHandler,t.ScriptHandler,t.SceneHandler,t.ShaderHandler,t.SpriteHandler,t.TemplateHandler,t.TextHandler,t.TextureAtlasHandler,t.TextureHandler],i.soundManager=new t.SoundManager,i.lightmapper=t.Lightmapper,i.batchManager=t.BatchManager,i.xr=t.XrManager,this.app=new t.AppBase(this._canvas),this.app.init(i),this.app.setCanvasFillMode(t.FILLMODE_FILL_WINDOW),this.app.setCanvasResolution(t.RESOLUTION_AUTO),this._pickerCreate();const n=this.querySelectorAll(":scope > pc-asset");Array.from(n).forEach(e=>{e.createAsset();const t=e.asset;t&&this.app.assets.add(t)});const o=this.querySelectorAll(":scope > pc-material");Array.from(o).forEach(e=>{e.createMaterial()});const r=this.querySelectorAll("pc-entity");Array.from(r).forEach(e=>{e.createEntity(this.app)}),r.forEach(e=>{e.buildHierarchy(this.app)}),this._hierarchyReady=!0,this.app.preload(()=>{this.app.start(),window.addEventListener("resize",this._onWindowResize),this._onReady()})}disconnectedCallback(){this._pickerDestroy(),this.app&&(this.app.destroy(),this.app=null),window.removeEventListener("resize",this._onWindowResize),this._canvas&&this.contains(this._canvas)&&(this.removeChild(this._canvas),this._canvas=null)}_onWindowResize(){this.app&&this.app.resizeCanvas()}_pickerCreate(){const{width:e,height:a}=this.app.graphicsDevice;this._picker=new t.Picker(this.app,e,a),this._pointerHandlers.pointermove=this._onPointerMove.bind(this),this._pointerHandlers.pointerdown=this._onPointerDown.bind(this),this._pointerHandlers.pointerup=this._onPointerUp.bind(this),["pointermove","pointerdown","pointerup","pointerenter","pointerleave"].forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null}}_getPickerCoordinates(e){const t=this._canvas.getBoundingClientRect(),a=this._canvas.width/t.width,s=this._canvas.height/t.height;return{x:(e.clientX-t.left)*a,y:(e.clientY-t.top)*s}}_onPointerMove(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);let n=null;if(i.length>0){let e=i[0].node;for(;null!==e;){const t=this.querySelector(`pc-entity[name="${e.name}"]`);if(t){n=t;break}e=e.parent}}this._hoveredEntity!==n&&(this._hoveredEntity&&this._hoveredEntity.hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),n&&n.hasListeners("pointerenter")&&n.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=n,n&&n.hasListeners("pointermove")&&n.dispatchEvent(new PointerEvent("pointermove",e))}_onPointerDown(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);if(i.length>0){let t=i[0].node;for(;null!==t;){const a=this.querySelector(`pc-entity[name="${t.name}"]`);if(a&&a.hasListeners("pointerdown")){a.dispatchEvent(new PointerEvent("pointerdown",e));break}t=t.parent}}}_onPointerUp(e){if(!this._picker||!this.app)return;const t=this.app.root.findComponent("camera");if(!t)return;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=this._picker.getSelection(a,s);if(i.length>0){const t=this.querySelector(`pc-entity[name="${i[0].node.name}"]`);t&&t.hasListeners("pointerup")&&t.dispatchEvent(new PointerEvent("pointerup",e))}}_onPointerListenerAdded(e){if(!this._hasPointerListeners[e]&&this._canvas){this._hasPointerListeners[e]=!0;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.addEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}_onPointerListenerRemoved(e){if(!Array.from(this.querySelectorAll("pc-entity")).some(t=>t.hasListeners(e))&&this._canvas){this._hasPointerListeners[e]=!1;const t="pointerenter"===e||"pointerleave"===e?this._pointerHandlers.pointermove:this._pointerHandlers[e];t&&this._canvas.removeEventListener("pointerenter"===e||"pointerleave"===e?"pointermove":e,t)}}set alpha(e){this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._antialias=e}get antialias(){return this._antialias}set backend(e){this._backend=e}get backend(){return this._backend}set depth(e){this._depth=e}get depth(){return this._depth}get hierarchyReady(){return this._hierarchyReady}set highResolution(e){this._highResolution=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e?window.devicePixelRatio:1)}get highResolution(){return this._highResolution}set stencil(e){this._stencil=e}get stencil(){return this._stencil}static get observedAttributes(){return["alpha","antialias","backend","depth","stencil","high-resolution"]}attributeChangedCallback(e,t,a){switch(e){case"alpha":this.alpha="false"!==a;break;case"antialias":this.antialias="false"!==a;break;case"backend":"webgpu"!==a&&"webgl2"!==a&&"null"!==a||(this.backend=a);break;case"depth":this.depth="false"!==a;break;case"high-resolution":this.highResolution="false"!==a;break;case"stencil":this.stencil="false"!==a}}}customElements.define("pc-app",i);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o=e=>{const a=n[e.toLowerCase()];if(a)return(new t.Color).fromString(a);if(e.startsWith("#"))return(new t.Color).fromString(e);const s=e.split(" ").map(Number);return new t.Color(s)},r=e=>{const a=e.split(" ").map(Number);return new t.Vec2(a)},c=e=>{const a=e.split(" ").map(Number);return new t.Vec3(a)},b=e=>{const a=e.split(" ").map(Number);return new t.Vec4(a)};class h extends a{constructor(){super(...arguments),this._enabled=!0,this._name="Untitled",this._position=new t.Vec3,this._rotation=new t.Vec3,this._scale=new t.Vec3(1,1,1),this._tags=[],this._listeners={},this.entity=null}createEntity(e){this.entity=new t.Entity(this.getAttribute("name")||this._name,e);const a=this.getAttribute("enabled");a&&(this.entity.enabled="false"!==a);const s=this.getAttribute("position");s&&this.entity.setLocalPosition(c(s));const i=this.getAttribute("rotation");i&&this.entity.setLocalEulerAngles(c(i));const n=this.getAttribute("scale");n&&this.entity.setLocalScale(c(n));const o=this.getAttribute("tags");o&&this.entity.tags.add(o.split(",").map(e=>e.trim()));["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"].forEach(e=>{const t=this.getAttribute(e);if(t){const a=e.substring(2),s=e=>{try{new Function("event",t).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(a,s)}})}buildHierarchy(e){if(!this.entity)return;const t=this.closestEntity;(null==t?void 0:t.entity)?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady()}connectedCallback(){const e=this.closestApp;if(e&&e.hierarchyReady){const t=e.app;this.createEntity(t),this.buildHierarchy(t);const a=this.querySelectorAll("pc-entity");a.forEach(e=>{e.createEntity(t)}),a.forEach(e=>{e.buildHierarchy(t)})}}disconnectedCallback(){if(this.entity){this.querySelectorAll("pc-entity").forEach(e=>{e.entity=null}),this.entity.destroy(),this.entity=null}}set enabled(e){this._enabled=e,this.entity&&(this.entity.enabled=e)}get enabled(){return this._enabled}set name(e){this._name=e,this.entity&&(this.entity.name=e)}get name(){return this._name}set position(e){this._position=e,this.entity&&this.entity.setLocalPosition(this._position)}get position(){return this._position}set rotation(e){this._rotation=e,this.entity&&this.entity.setLocalEulerAngles(this._rotation)}get rotation(){return this._rotation}set scale(e){this._scale=e,this.entity&&this.entity.setLocalScale(this._scale)}get scale(){return this._scale}set tags(e){this._tags=e,this.entity&&(this.entity.tags.clear(),this.entity.tags.add(this._tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","name","position","rotation","scale","tags","onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"]}attributeChangedCallback(e,t,a){switch(e){case"enabled":this.enabled="false"!==a;break;case"name":this.name=a;break;case"position":this.position=c(a);break;case"rotation":this.rotation=c(a);break;case"scale":this.scale=c(a);break;case"tags":this.tags=a.split(",").map(e=>e.trim());break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":if(a){const t=e.substring(2),a=e=>{try{const a=this.getAttribute(t)||"";new Function("event",a).call(this,e)}catch(e){console.error("Error in event handler:",e)}};this.addEventListener(t,a)}}}addEventListener(e,t,a){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),super.addEventListener(e,t,a),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:connect`,{bubbles:!0}))}removeEventListener(e,t,a){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),super.removeEventListener(e,t,a),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:disconnect`,{bubbles:!0}))}hasListeners(e){var t;return Boolean(null===(t=this._listeners[e])||void 0===t?void 0:t.length)}}customElements.define("pc-entity",h);var l=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var a,s=WebAssembly.validate(e)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",i=WebAssembly.instantiate(n(s),{}).then(function(e){(a=e.instance).exports.__wasm_call_ctors()});function n(e){for(var a=new Uint8Array(e.length),s=0;s<e.length;++s){var i=e.charCodeAt(s);a[s]=i>96?i-97:i>64?i-39:i+4}var n=0;for(s=0;s<e.length;++s)a[n++]=a[s]<60?t[a[s]]:64*(a[s]-60)+a[++s];return a.buffer.slice(0,n)}function o(e,t,s,i,n,o){var r=a.exports.sbrk,c=s+3&-4,b=r(c*i),h=r(n.length),l=new Uint8Array(a.exports.memory.buffer);l.set(n,h);var p=e(b,s,i,h,n.length);if(0==p&&o&&o(b,c,i),t.set(l.subarray(b,b+s*i)),r(b-r(0)),0!=p)throw new Error("Malformed buffer data: "+p)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},b=[],h=0;function l(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var a=e.data;t.pending-=a.count,t.requests[a.id][a.action](a.value),delete t.requests[a.id]},t}function p(e){for(var t="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+o.toString()+d.toString(),a=new Blob([t],{type:"text/javascript"}),i=URL.createObjectURL(a),r=0;r<e;++r)b[r]=l(i);URL.revokeObjectURL(i)}function d(e){i.then(function(){var t=e.data;try{var s=new Uint8Array(t.count*t.size);o(a.exports[t.mode],s,t.count,t.size,t.source,a.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:s},[s.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:i,supported:!0,useWorkers:function(e){p(e)},decodeVertexBuffer:function(e,t,s,i,n){o(a.exports.meshopt_decodeVertexBuffer,e,t,s,i,a.exports[r[n]])},decodeIndexBuffer:function(e,t,s,i){o(a.exports.meshopt_decodeIndexBuffer,e,t,s,i)},decodeIndexSequence:function(e,t,s,i){o(a.exports.meshopt_decodeIndexSequence,e,t,s,i)},decodeGltfBuffer:function(e,t,s,i,n,b){o(a.exports[c[n]],e,t,s,i,a.exports[r[b]])},decodeGltfBufferAsync:function(e,t,s,n,l){return b.length>0?function(e,t,a,s,i){for(var n=b[0],o=1;o<b.length;++o)b[o].pending<n.pending&&(n=b[o]);return new Promise(function(o,r){var c=new Uint8Array(a),b=h++;n.pending+=e,n.requests[b]={resolve:o,reject:r},n.object.postMessage({id:b,count:e,size:t,source:c,mode:s,filter:i},[c.buffer])})}(e,t,s,c[n],r[l]):i.then(function(){var i=new Uint8Array(e*t);return o(a.exports[c[n]],i,e,t,s,a.exports[r[l]]),i})}}}();const p=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),d=(e,t,a)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const s=e.extensions.EXT_meshopt_compression;Promise.all([l.ready,t[s.buffer]]).then(e=>{const t=e[1],i=s.byteOffset||0,n=s.byteLength||0,o=s.count,r=s.byteStride,c=new Uint8Array(o*r),b=new Uint8Array(t.buffer,t.byteOffset+i,n);l.decodeGltfBuffer(c,o,r,b,s.mode,s.filter),a(null,c)})}else a(null,null)};class f extends HTMLElement{constructor(){super(...arguments),this._lazy=!1,this.asset=null}disconnectedCallback(){this.destroyAsset()}createAsset(){var e;const a=this.getAttribute("id")||"",s=this.getAttribute("src")||"";let i=this.getAttribute("type");if(!i){const t=s.split(".").pop();i=null!==(e=p.get(t||""))&&void 0!==e?e:null}i?(this.asset="container"===i?new t.Asset(a,i,{url:s},void 0,{bufferView:{processAsync:d.bind(this)}}):new t.Asset(a,i,{url:s}),this.asset.preload=!this._lazy):console.warn(`Unsupported asset type: ${s}`)}destroyAsset(){this.asset&&(this.asset.unload(),this.asset=null)}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e)}get lazy(){return this._lazy}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return null==t?void 0:t.asset}static get observedAttributes(){return["lazy"]}attributeChangedCallback(e,t,a){"lazy"===e&&(this.lazy=this.hasAttribute("lazy"))}}customElements.define("pc-asset",f);class g extends a{constructor(e){super(),this._enabled=!0,this._component=null,this._componentName=e}getInitialComponentData(){return{}}async addComponent(){const e=this.closestEntity;if(e){await e.ready();const t=this.getInitialComponentData();this._component=e.entity.addComponent(this._componentName,t)}}initComponent(){}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),await this.addComponent(),this.initComponent(),this._onReady()}disconnectedCallback(){this.component&&this.component.entity&&(this._component.entity.removeComponent(this._componentName),this._component=null)}get component(){return this._component}set enabled(e){this._enabled=e,this.component&&(this.component.enabled=e)}get enabled(){return this._enabled}static get observedAttributes(){return["enabled"]}attributeChangedCallback(e,t,a){if("enabled"===e)this.enabled="false"!==a}}class u extends g{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",u);const m=new Map([["none",t.TONEMAP_NONE],["linear",t.TONEMAP_LINEAR],["filmic",t.TONEMAP_FILMIC],["hejl",t.TONEMAP_HEJL],["aces",t.TONEMAP_ACES],["aces2",t.TONEMAP_ACES2],["neutral",t.TONEMAP_NEUTRAL]]);class _ extends g{constructor(){super("camera"),this._clearColor=new t.Color(.75,.75,.75,1),this._clearColorBuffer=!0,this._clearDepthBuffer=!0,this._clearStencilBuffer=!1,this._cullFaces=!0,this._farClip=1e3,this._flipFaces=!1,this._fov=45,this._frustumCulling=!0,this._gamma="srgb",this._horizontalFov=!1,this._nearClip=.1,this._orthographic=!1,this._orthoHeight=10,this._priority=0,this._rect=new t.Vec4(0,0,1,1),this._scissorRect=new t.Vec4(0,0,1,1),this._tonemap="none"}getInitialComponentData(){return{clearColor:this._clearColor,clearColorBuffer:this._clearColorBuffer,clearDepthBuffer:this._clearDepthBuffer,clearStencilBuffer:this._clearStencilBuffer,cullFaces:this._cullFaces,farClip:this._farClip,flipFaces:this._flipFaces,fov:this._fov,frustumCulling:this._frustumCulling,gammaCorrection:"srgb"===this._gamma?t.GAMMA_SRGB:t.GAMMA_NONE,horizontalFov:this._horizontalFov,nearClip:this._nearClip,orthographic:this._orthographic,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:m.get(this._tonemap)}}get xrAvailable(){var e;const a=null===(e=this.component)||void 0===e?void 0:e.system.app.xr;return a&&a.supported&&a.isAvailable(t.XRTYPE_VR)}startXr(e,t){this.component&&this.xrAvailable&&this.component.startXr(e,t,{callback:e=>{e&&console.error(`WebXR Immersive VR failed to start: ${e.message}`)}})}endXr(){this.component&&this.component.endXr()}get component(){return super.component}set clearColor(e){this._clearColor=e,this.component&&(this.component.clearColor=e)}get clearColor(){return this._clearColor}set clearColorBuffer(e){this._clearColorBuffer=e,this.component&&(this.component.clearColorBuffer=e)}get clearColorBuffer(){return this._clearColorBuffer}set clearDepthBuffer(e){this._clearDepthBuffer=e,this.component&&(this.component.clearDepthBuffer=e)}get clearDepthBuffer(){return this._clearDepthBuffer}set clearStencilBuffer(e){this._clearStencilBuffer=e,this.component&&(this.component.clearStencilBuffer=e)}get clearStencilBuffer(){return this._clearStencilBuffer}set cullFaces(e){this._cullFaces=e,this.component&&(this.component.cullFaces=e)}get cullFaces(){return this._cullFaces}set farClip(e){this._farClip=e,this.component&&(this.component.farClip=e)}get farClip(){return this._farClip}set flipFaces(e){this._flipFaces=e,this.component&&(this.component.flipFaces=e)}get flipFaces(){return this._flipFaces}set fov(e){this._fov=e,this.component&&(this.component.fov=e)}get fov(){return this._fov}set frustumCulling(e){this._frustumCulling=e,this.component&&(this.component.frustumCulling=e)}get frustumCulling(){return this._frustumCulling}set gamma(e){this._gamma=e,this.component&&(this.component.gammaCorrection="srgb"===e?t.GAMMA_SRGB:t.GAMMA_NONE)}get gamma(){return this._gamma}set horizontalFov(e){this._horizontalFov=e,this.component&&(this.component.horizontalFov=e)}get horizontalFov(){return this._horizontalFov}set nearClip(e){this._nearClip=e,this.component&&(this.component.nearClip=e)}get nearClip(){return this._nearClip}set orthographic(e){this._orthographic=e,this.component&&(this.component.projection=e?t.PROJECTION_ORTHOGRAPHIC:t.PROJECTION_PERSPECTIVE)}get orthographic(){return this._orthographic}set orthoHeight(e){this._orthoHeight=e,this.component&&(this.component.orthoHeight=e)}get orthoHeight(){return this._orthoHeight}set priority(e){this._priority=e,this.component&&(this.component.priority=e)}get priority(){return this._priority}set rect(e){this._rect=e,this.component&&(this.component.rect=e)}get rect(){return this._rect}set scissorRect(e){this._scissorRect=e,this.component&&(this.component.scissorRect=e)}get scissorRect(){return this._scissorRect}set tonemap(e){var a;this._tonemap=e,this.component&&(this.component.toneMapping=null!==(a=m.get(e))&&void 0!==a?a:t.TONEMAP_NONE)}get tonemap(){return this._tonemap}static get observedAttributes(){return[...super.observedAttributes,"clear-color","clear-color-buffer","clear-depth-buffer","clear-stencil-buffer","cull-faces","far-clip","flip-faces","fov","frustum-culling","gamma","horizontal-fov","near-clip","orthographic","ortho-height","priority","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"clear-color":this.clearColor=o(a);break;case"clear-color-buffer":this.clearColorBuffer="false"!==a;break;case"clear-depth-buffer":this.clearDepthBuffer="false"!==a;break;case"clear-stencil-buffer":this.clearStencilBuffer="false"!==a;break;case"cull-faces":this.cullFaces="false"!==a;break;case"far-clip":this.farClip=parseFloat(a);break;case"flip-faces":this.flipFaces="true"!==a;break;case"fov":this.fov=parseFloat(a);break;case"frustum-culling":this.frustumCulling="false"!==a;break;case"gamma":this.gamma=a;break;case"horizontal-fov":this.horizontalFov=this.hasAttribute("horizontal-fov");break;case"near-clip":this.nearClip=parseFloat(a);break;case"orthographic":this.orthographic=this.hasAttribute("orthographic");break;case"ortho-height":this.orthoHeight=parseFloat(a);break;case"priority":this.priority=parseFloat(a);break;case"rect":this.rect=b(a);break;case"scissor-rect":this.scissorRect=b(a);break;case"tonemap":this.tonemap=a}}}customElements.define("pc-camera",_);class k extends g{constructor(){super("collision"),this._angularOffset=new t.Quat,this._axis=1,this._convexHull=!1,this._halfExtents=new t.Vec3(.5,.5,.5),this._height=2,this._linearOffset=new t.Vec3,this._radius=.5,this._type="box"}getInitialComponentData(){return{axis:this._axis,angularOffset:this._angularOffset,convexHull:this._convexHull,halfExtents:this._halfExtents,height:this._height,linearOffset:this._linearOffset,radius:this._radius,type:this._type}}get component(){return super.component}set angularOffset(e){this._angularOffset=e,this.component&&(this.component.angularOffset=e)}get angularOffset(){return this._angularOffset}set axis(e){this._axis=e,this.component&&(this.component.axis=e)}get axis(){return this._axis}set convexHull(e){this._convexHull=e,this.component&&(this.component.convexHull=e)}get convexHull(){return this._convexHull}set halfExtents(e){this._halfExtents=e,this.component&&(this.component.halfExtents=e)}get halfExtents(){return this._halfExtents}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set linearOffset(e){this._linearOffset=e,this.component&&(this.component.linearOffset=e)}get linearOffset(){return this._linearOffset}set radius(e){this._radius=e,this.component&&(this.component.radius=e)}get radius(){return this._radius}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-offset","axis","convex-hull","half-extents","height","linear-offset","radius","type"]}attributeChangedCallback(e,a,s){switch(super.attributeChangedCallback(e,a,s),e){case"angular-offset":this.angularOffset=(e=>{const[a,s,i]=e.split(" ").map(Number),n=new t.Quat;return n.setFromEulerAngles(a,s,i),n})(s);break;case"axis":this.axis=parseInt(s,10);break;case"convex-hull":this.convexHull=this.hasAttribute("convex-hull");break;case"half-extents":this.halfExtents=c(s);break;case"height":this.height=parseFloat(s);break;case"linear-offset":this.linearOffset=c(s);break;case"radius":this.radius=parseFloat(s);break;case"type":this.type=s}}}customElements.define("pc-collision",k);class v extends g{constructor(){super("element"),this._anchor=new t.Vec4(.5,.5,.5,.5),this._asset="",this._autoWidth=!0,this._color=new t.Color(1,1,1,1),this._fontSize=32,this._lineHeight=32,this._pivot=new t.Vec2(.5,.5),this._text="",this._type="group",this._width=0,this._wrapLines=!1}initComponent(){this.component._text._material.useFog=!0}getInitialComponentData(){return{anchor:this._anchor,autoWidth:this._autoWidth,color:this._color,fontAsset:f.get(this._asset).id,fontSize:this._fontSize,lineHeight:this._lineHeight,pivot:this._pivot,type:this._type,text:this._text,width:this._width,wrapLines:this._wrapLines}}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.fontAsset=t.id)}get asset(){return this._asset}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set width(e){this._width=e,this.component&&(this.component.width=e)}get width(){return this._width}set wrapLines(e){this._wrapLines=e,this.component&&(this.component.wrapLines=e)}get wrapLines(){return this._wrapLines}static get observedAttributes(){return[...super.observedAttributes,"anchor","asset","auto-width","color","font-size","line-height","pivot","text","type","width","wrap-lines"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"anchor":this.anchor=b(a);break;case"asset":this.asset=a;break;case"auto-width":this.autoWidth="false"!==a;break;case"color":this.color=o(a);break;case"font-size":this.fontSize=Number(a);break;case"line-height":this.lineHeight=Number(a);break;case"pivot":this.pivot=r(a);break;case"text":this.text=a;break;case"type":this.type=a;break;case"width":this.width=Number(a);break;case"wrap-lines":this.wrapLines=this.hasAttribute(e)}}}customElements.define("pc-element",v);const y=new Map([["pcf1-16f",t.SHADOW_PCF1_16F],["pcf1-32f",t.SHADOW_PCF1_32F],["pcf3-16f",t.SHADOW_PCF3_16F],["pcf3-32f",t.SHADOW_PCF3_32F],["pcf5-16f",t.SHADOW_PCF5_16F],["pcf5-32f",t.SHADOW_PCF5_32F],["vsm-16f",t.SHADOW_VSM_16F],["vsm-32f",t.SHADOW_VSM_32F],["pcss-32f",t.SHADOW_PCSS_32F]]);class w extends g{constructor(){super("light"),this._castShadows=!1,this._color=new t.Color(1,1,1),this._innerConeAngle=40,this._intensity=1,this._normalOffsetBias=.05,this._outerConeAngle=45,this._range=10,this._shadowBias=.2,this._shadowDistance=16,this._shadowIntensity=1,this._shadowResolution=1024,this._shadowType="pcf3-32f",this._type="directional",this._vsmBias=.01,this._vsmBlurSize=11}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,range:this._range,shadowBias:this._shadowBias,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowType:y.get(this._shadowType),type:this._type,vsmBias:this._vsmBias,vsmBlurSize:this._vsmBlurSize}}get component(){return super.component}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set innerConeAngle(e){this._innerConeAngle=e,this.component&&(this.component.innerConeAngle=e)}get innerConeAngle(){return this._innerConeAngle}set intensity(e){this._intensity=e,this.component&&(this.component.intensity=e)}get intensity(){return this._intensity}set normalOffsetBias(e){this._normalOffsetBias=e,this.component&&(this.component.normalOffsetBias=e)}get normalOffsetBias(){return this._normalOffsetBias}set outerConeAngle(e){this._outerConeAngle=e,this.component&&(this.component.outerConeAngle=e)}get outerConeAngle(){return this._outerConeAngle}set range(e){this._range=e,this.component&&(this.component.range=e)}get range(){return this._range}set shadowBias(e){this._shadowBias=e,this.component&&(this.component.shadowBias=e)}get shadowBias(){return this._shadowBias}set shadowDistance(e){this._shadowDistance=e,this.component&&(this.component.shadowDistance=e)}get shadowDistance(){return this._shadowDistance}set shadowIntensity(e){this._shadowIntensity=e,this.component&&(this.component.shadowIntensity=e)}get shadowIntensity(){return this._shadowIntensity}set shadowResolution(e){this._shadowResolution=e,this.component&&(this.component.shadowResolution=e)}get shadowResolution(){return this._shadowResolution}set shadowType(e){var a;this._shadowType=e,this.component&&(this.component.shadowType=null!==(a=y.get(e))&&void 0!==a?a:t.SHADOW_PCF3_32F)}get shadowType(){return this._shadowType}set type(e){["directional","omni","spot"].includes(e)?(this._type=e,this.component&&(this.component.type=e)):console.warn(`Invalid light type '${e}', using default type '${this._type}'.`)}get type(){return this._type}set vsmBias(e){this._vsmBias=e,this.component&&(this.component.vsmBias=e)}get vsmBias(){return this._vsmBias}set vsmBlurSize(e){this._vsmBlurSize=e,this.component&&(this.component.vsmBlurSize=e)}get vsmBlurSize(){return this._vsmBlurSize}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","range","shadow-bias","shadow-distance","shadow-intensity","shadow-resolution","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"color":this.color=o(a);break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"inner-cone-angle":this.innerConeAngle=Number(a);break;case"intensity":this.intensity=Number(a);break;case"normal-offset-bias":this.normalOffsetBias=Number(a);break;case"outer-cone-angle":this.outerConeAngle=Number(a);break;case"range":this.range=Number(a);break;case"shadow-bias":this.shadowBias=Number(a);break;case"shadow-distance":this.shadowDistance=Number(a);break;case"shadow-resolution":this.shadowResolution=Number(a);break;case"shadow-intensity":this.shadowIntensity=Number(a);break;case"shadow-type":this.shadowType=a;break;case"type":this.type=a;break;case"vsm-bias":this.vsmBias=Number(a);break;case"vsm-blur-size":this.vsmBlurSize=Number(a)}}}customElements.define("pc-light",w);class A extends g{constructor(){super("particlesystem"),this._asset=""}getInitialComponentData(){var e;const t=f.get(this._asset);if(!t)return{};if(t.resource.colorMapAsset){const a=t.resource.colorMapAsset,s=null===(e=f.get(a))||void 0===e?void 0:e.id;s&&(t.resource.colorMapAsset=s)}return t.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)e.hasOwnProperty(t)&&(this.component[t]=e[t])}async _loadAsset(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app,s=f.get(this._asset);s&&(s.loaded?this.applyConfig(s.resource):(s.once("load",()=>{this.applyConfig(s.resource)}),a.assets.load(s)))}set asset(e){this._asset=e,this.isConnected&&this._loadAsset()}get asset(){return this._asset}play(){this.component&&this.component.play()}pause(){this.component&&this.component.pause()}reset(){this.component&&this.component.reset()}stop(){this.component&&this.component.stop()}static get observedAttributes(){return[...super.observedAttributes,"asset"]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),"asset"===e)this.asset=a}}customElements.define("pc-particles",A);class x extends HTMLElement{constructor(){super(...arguments),this._diffuse=new t.Color(1,1,1),this._diffuseMap="",this._metalnessMap="",this._normalMap="",this._roughnessMap="",this.material=null}createMaterial(){this.material=new t.StandardMaterial,this.material.glossInvert=!1,this.material.useMetalness=!1,this.material.diffuse=this._diffuse,this.diffuseMap=this._diffuseMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.roughnessMap=this._roughnessMap,this.material.update()}disconnectedCallback(){this.material&&(this.material.destroy(),this.material=null)}setMap(e,t){if(this.material){const a=f.get(e);a&&(a.loaded?(this.material[t]=a.resource,this.material[t].anisotropy=4):a.once("load",()=>{this.material[t]=a.resource,this.material[t].anisotropy=4,this.material.update()}))}}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e)}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this.setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set metalnessMap(e){this._metalnessMap=e,this.setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set normalMap(e){this._normalMap=e,this.setMap(e,"normalMap")}get normalMap(){return this._normalMap}set roughnessMap(e){this._roughnessMap=e,this.setMap(e,"glossMap")}get roughnessMap(){return this._roughnessMap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return null==t?void 0:t.material}static get observedAttributes(){return["diffuse","diffuse-map","metalness-map","normal-map","roughness-map"]}attributeChangedCallback(e,t,a){switch(e){case"diffuse":this.diffuse=o(a);break;case"diffuse-map":this.diffuseMap=a;break;case"metalness-map":this.metalnessMap=a;break;case"normal-map":this.normalMap=a;break;case"roughness-map":this.roughnessMap=a}}}customElements.define("pc-material",x);class C extends g{constructor(){super("render"),this._castShadows=!0,this._material="",this._receiveShadows=!0,this._type="asset"}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:x.get(this._material),receiveShadows:this._receiveShadows}}get component(){return super.component}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set material(e){this._material=e,this.component&&(this.component.material=x.get(e))}get material(){return this._material}set receiveShadows(e){this._receiveShadows=e,this.component&&(this.component.receiveShadows=e)}get receiveShadows(){return this._receiveShadows}static get observedAttributes(){return[...super.observedAttributes,"cast-shadows","material","receive-shadows","type"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"cast-shadows":this.castShadows="false"!==a;break;case"material":this.material=a;break;case"receive-shadows":this.receiveShadows="false"!==a;break;case"type":this.type=a}}}customElements.define("pc-render",C);class S extends g{constructor(){super("rigidbody"),this._angularDamping=0,this._angularFactor=new t.Vec3(1,1,1),this._friction=.5,this._linearDamping=0,this._linearFactor=new t.Vec3(1,1,1),this._mass=1,this._restitution=0,this._rollingFriction=0,this._type="static"}getInitialComponentData(){return{angularDamping:this._angularDamping,angularFactor:this._angularFactor,friction:this._friction,linearDamping:this._linearDamping,linearFactor:this._linearFactor,mass:this._mass,restitution:this._restitution,rollingFriction:this._rollingFriction,type:this._type}}get component(){return super.component}set angularDamping(e){this._angularDamping=e,this.component&&(this.component.angularDamping=e)}get angularDamping(){return this._angularDamping}set angularFactor(e){this._angularFactor=e,this.component&&(this.component.angularFactor=e)}get angularFactor(){return this._angularFactor}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set linearDamping(e){this._linearDamping=e,this.component&&(this.component.linearDamping=e)}get linearDamping(){return this._linearDamping}set linearFactor(e){this._linearFactor=e,this.component&&(this.component.linearFactor=e)}get linearFactor(){return this._linearFactor}set mass(e){this._mass=e,this.component&&(this.component.mass=e)}get mass(){return this._mass}set restitution(e){this._restitution=e,this.component&&(this.component.restitution=e)}get restitution(){return this._restitution}set rollingFriction(e){this._rollingFriction=e,this.component&&(this.component.rollingFriction=e)}get rollingFriction(){return this._rollingFriction}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}static get observedAttributes(){return[...super.observedAttributes,"angular-damping","angular-factor","friction","linear-damping","linear-factor","mass","restitution","rolling-friction","type"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"angular-damping":this.angularDamping=parseFloat(a);break;case"angular-factor":this.angularFactor=c(a);break;case"friction":this.friction=parseFloat(a);break;case"linear-damping":this.linearDamping=parseFloat(a);break;case"linear-factor":this.linearFactor=c(a);break;case"mass":this.mass=parseFloat(a);break;case"restitution":this.restitution=parseFloat(a);break;case"rolling-friction":this.rollingFriction=parseFloat(a);break;case"type":this.type=a}}}customElements.define("pc-rigidbody",S);class j extends g{constructor(){super("screen"),this._screenSpace=!1,this._resolution=new t.Vec2(640,320),this._referenceResolution=new t.Vec2(640,320),this._priority=0,this._blend=!1,this._scaleBlend=.5}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE,screenSpace:this._screenSpace}}get component(){return super.component}set priority(e){this._priority=e,this.component&&(this.component.priority=this._priority)}get priority(){return this._priority}set referenceResolution(e){this._referenceResolution=e,this.component&&(this.component.referenceResolution=this._referenceResolution)}get referenceResolution(){return this._referenceResolution}set resolution(e){this._resolution=e,this.component&&(this.component.resolution=this._resolution)}get resolution(){return this._resolution}set scaleBlend(e){this._scaleBlend=e,this.component&&(this.component.scaleBlend=this._scaleBlend)}get scaleBlend(){return this._scaleBlend}set blend(e){this._blend=e,this.component&&(this.component.scaleMode=this._blend?t.SCALEMODE_BLEND:t.SCALEMODE_NONE)}get blend(){return this._blend}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"blend","screen-space","resolution","reference-resolution","priority","scale-blend"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"priority":this.priority=parseInt(a,10);break;case"reference-resolution":this.referenceResolution=r(a);break;case"resolution":this.resolution=r(a);break;case"scale-blend":this.scaleBlend=parseFloat(a);break;case"blend":this.blend=this.hasAttribute("blend");break;case"screen-space":this.screenSpace=this.hasAttribute("screen-space")}}}customElements.define("pc-screen",j);class F extends g{constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.observer.observe(this,{childList:!0}),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this))}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{const t=e.getAttribute("name"),a=e.getAttribute("attributes");t&&this.createScript(t,a)})}convertAttributes(e){if("string"==typeof e){if(e.startsWith("asset:")){const t=e.slice(6),a=document.querySelector(`pc-asset#${t}`);if(a)return a.asset}if(e.startsWith("entity:")){const t=e.slice(7),a=document.querySelector(`pc-entity[name="${t}"]`);if(a)return a.entity}if(e.startsWith("vec2:")){const a=e.slice(5).split(",").map(Number);if(2===a.length&&a.every(e=>!isNaN(e)))return new t.Vec2(a[0],a[1])}if(e.startsWith("vec3:")){const a=e.slice(5).split(",").map(Number);if(3===a.length&&a.every(e=>!isNaN(e)))return new t.Vec3(a[0],a[1],a[2])}if(e.startsWith("vec4:")){const a=e.slice(5).split(",").map(Number);if(4===a.length&&a.every(e=>!isNaN(e)))return new t.Vec4(a[0],a[1],a[2],a[3])}if(e.startsWith("color:")){const a=e.slice(6).split(",").map(Number);if(4===a.length&&a.every(e=>!isNaN(e)))return new t.Color(a[0],a[1],a[2],a[3])}return e}if(Array.isArray(e))return e.length>0&&e[0],e.map(e=>this.convertAttributes(e));if(e&&"object"==typeof e){const t={};for(const a in e)t[a]=this.convertAttributes(e[a]);return t}return e}preprocessAttributes(e){return this.convertAttributes(e)}mergeDeep(e,t){for(const a in t)t[a]&&"object"==typeof t[a]&&!Array.isArray(t[a])?(e[a]&&"object"==typeof e[a]||(e[a]={}),this.mergeDeep(e[a],t[a])):e[a]=t[a];return e}applyAttributes(e,t){try{const a=t?JSON.parse(t):{},s=this.convertAttributes(a);this.mergeDeep(e,s)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}}handleScriptAttributesChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const a=this.component.get(t);a&&this.applyAttributes(a,e.detail.attributes)}handleScriptEnableChange(e){const t=e.target.getAttribute("name");if(!t||!this.component)return;const a=this.component.get(t);a&&(a.enabled=e.detail.enabled)}createScript(e,t){if(!this.component)return null;let a={};if(t)try{a=JSON.parse(t),a=this.preprocessAttributes(a)}catch(e){console.error(`Error parsing attributes JSON string ${t}:`,e)}return this.component.create(e,{properties:a})}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e)t.addedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name"),a=e.getAttribute("attributes");t&&this.createScript(t,a)}}),t.removedNodes.forEach(e=>{if(e instanceof HTMLElement&&"pc-script"===e.tagName.toLowerCase()){const t=e.getAttribute("name");t&&this.destroyScript(t)}})}disconnectedCallback(){var e;this.observer.disconnect(),null===(e=super.disconnectedCallback)||void 0===e||e.call(this)}get component(){return super.component}}customElements.define("pc-scripts",F);class E extends HTMLElement{constructor(){super(...arguments),this._attributes="{}",this._enabled=!0,this._name=""}set scriptAttributes(e){this._attributes=e,this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:e},bubbles:!0}))}get scriptAttributes(){return this._attributes}set enabled(e){this._enabled=e,this.dispatchEvent(new CustomEvent("scriptenablechange",{detail:{enabled:e},bubbles:!0}))}get enabled(){return this._enabled}set name(e){this._name=e}get name(){return this._name}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,a){switch(e){case"attributes":this.scriptAttributes=a;break;case"enabled":this.enabled="false"!==a;break;case"name":this.name=a}}}customElements.define("pc-script",E);class O extends g{constructor(){super("sound"),this._distanceModel="linear",this._maxDistance=1e4,this._pitch=1,this._positional=!1,this._refDistance=1,this._rollOffFactor=1,this._volume=1}getInitialComponentData(){return{distanceModel:this._distanceModel,maxDistance:this._maxDistance,pitch:this._pitch,positional:this._positional,refDistance:this._refDistance,rollOffFactor:this._rollOffFactor,volume:this._volume}}get component(){return super.component}set distanceModel(e){this._distanceModel=e,this.component&&(this.component.distanceModel=e)}get distanceModel(){return this._distanceModel}set maxDistance(e){this._maxDistance=e,this.component&&(this.component.maxDistance=e)}get maxDistance(){return this._maxDistance}set pitch(e){this._pitch=e,this.component&&(this.component.pitch=e)}get pitch(){return this._pitch}set positional(e){this._positional=e,this.component&&(this.component.positional=e)}get positional(){return this._positional}set refDistance(e){this._refDistance=e,this.component&&(this.component.refDistance=e)}get refDistance(){return this._refDistance}set rollOffFactor(e){this._rollOffFactor=e,this.component&&(this.component.rollOffFactor=e)}get rollOffFactor(){return this._rollOffFactor}set volume(e){this._volume=e,this.component&&(this.component.volume=e)}get volume(){return this._volume}static get observedAttributes(){return[...super.observedAttributes,"distance-model","max-distance","pitch","positional","ref-distance","roll-off-factor","volume"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"distance-model":this.distanceModel=a;break;case"max-distance":this.maxDistance=parseFloat(a);break;case"pitch":this.pitch=parseFloat(a);break;case"positional":this.positional=this.hasAttribute("positional");break;case"ref-distance":this.refDistance=parseFloat(a);break;case"roll-off-factor":this.rollOffFactor=parseFloat(a);break;case"volume":this.volume=parseFloat(a)}}}customElements.define("pc-sounds",O);class R extends a{constructor(){super(...arguments),this._asset="",this._autoPlay=!1,this._duration=null,this._loop=!1,this._name="",this._overlap=!1,this._pitch=1,this._startTime=0,this._volume=1,this.soundSlot=null}async connectedCallback(){var e;await(null===(e=this.soundElement)||void 0===e?void 0:e.ready());const t={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(t.duration=this._duration),this.soundSlot=this.soundElement.component.addSlot(this._name,t),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this.soundElement.component.removeSlot(this._name)}get soundElement(){const e=this.parentElement;return e instanceof O?e:(console.warn("pc-sound-slot must be a direct child of a pc-sound element"),null)}set asset(e){var t;if(this._asset=e,this.soundSlot){const a=null===(t=f.get(e))||void 0===t?void 0:t.id;a&&(this.soundSlot.asset=a)}}get asset(){return this._asset}set autoPlay(e){this._autoPlay=e,this.soundSlot&&(this.soundSlot.autoPlay=e)}get autoPlay(){return this._autoPlay}set duration(e){this._duration=e,this.soundSlot&&(this.soundSlot.duration=e)}get duration(){return this._duration}set loop(e){this._loop=e,this.soundSlot&&(this.soundSlot.loop=e)}get loop(){return this._loop}set name(e){this._name=e,this.soundSlot&&(this.soundSlot.name=e)}get name(){return this._name}set overlap(e){this._overlap=e,this.soundSlot&&(this.soundSlot.overlap=e)}get overlap(){return this._overlap}set pitch(e){this._pitch=e,this.soundSlot&&(this.soundSlot.pitch=e)}get pitch(){return this._pitch}set startTime(e){this._startTime=e,this.soundSlot&&(this.soundSlot.startTime=e)}get startTime(){return this._startTime}set volume(e){this._volume=e,this.soundSlot&&(this.soundSlot.volume=e)}get volume(){return this._volume}static get observedAttributes(){return["asset","auto-play","duration","loop","name","overlap","pitch","start-time","volume"]}attributeChangedCallback(e,t,a){switch(e){case"asset":this.asset=a;break;case"auto-play":this.autoPlay=this.hasAttribute("auto-play");break;case"duration":this.duration=parseFloat(a);break;case"loop":this.loop=this.hasAttribute("loop");break;case"name":this.name=a;break;case"overlap":this.overlap=this.hasAttribute("overlap");break;case"pitch":this.pitch=parseFloat(a);break;case"start-time":this.startTime=parseFloat(a);break;case"volume":this.volume=parseFloat(a)}}}customElements.define("pc-sound",R);class P extends g{constructor(){super("gsplat"),this._asset="",this._castShadows=!1,this._unified=!1}getInitialComponentData(){return{asset:f.get(this._asset),castShadows:this._castShadows,unified:this._unified}}get component(){return super.component}set asset(e){this._asset=e;const t=f.get(e);this.component&&t&&(this.component.asset=t)}get asset(){return this._asset}set castShadows(e){this._castShadows=e,this.component&&(this.component.castShadows=e)}get castShadows(){return this._castShadows}set unified(e){this.component&&this.component.enabled?console.warn('The "unified" property can only be changed when the component is disabled.'):(this._unified=e,this.component&&(this.component.unified=e))}get unified(){return this._unified}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows","unified"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"asset":this.asset=a;break;case"cast-shadows":this.castShadows=this.hasAttribute("cast-shadows");break;case"unified":this.unified=this.hasAttribute("unified")}}}customElements.define("pc-splat",P);class H extends a{constructor(){super(...arguments),this._asset="",this._entity=null}connectedCallback(){this._loadModel(),this._onReady()}disconnectedCallback(){this._unloadModel()}_instantiate(e){this._entity=e.instantiateRenderEntity(),e.animations.length>0&&(this._entity.addComponent("anim"),this._entity.anim.assignAnimation("animation",e.animations[0].resource));const t=this.closestEntity;if(t)t.ready().then(()=>{t.entity.addChild(this._entity)});else{const e=this.closestApp;e&&e.ready().then(()=>{e.app.root.addChild(this._entity)})}}async _loadModel(){var e;this._unloadModel();const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app,s=f.get(this._asset);s&&(s.loaded?this._instantiate(s.resource):(s.once("load",()=>{this._instantiate(s.resource)}),a.assets.load(s)))}_unloadModel(){var e;null===(e=this._entity)||void 0===e||e.destroy(),this._entity=null}set asset(e){this._asset=e,this.isConnected&&this._loadModel()}get asset(){return this._asset}static get observedAttributes(){return["asset"]}attributeChangedCallback(e,t,a){if("asset"===e)this.asset=a}}customElements.define("pc-model",H);class D extends a{constructor(){super(...arguments),this._fog="none",this._fogColor=new t.Color(1,1,1),this._fogDensity=0,this._fogStart=0,this._fogEnd=1e3,this._gravity=new t.Vec3(0,-9.81,0),this.scene=null}async connectedCallback(){var e;await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),this.scene=this.closestApp.app.scene,this.updateSceneSettings(),this._onReady()}updateSceneSettings(){if(this.scene){this.scene.fog.type=this._fog,this.scene.fog.color=this._fogColor,this.scene.fog.density=this._fogDensity,this.scene.fog.start=this._fogStart,this.scene.fog.end=this._fogEnd;this.parentElement.app.systems.rigidbody.gravity.copy(this._gravity)}}set fog(e){this._fog=e,this.scene&&(this.scene.fog.type=e)}get fog(){return this._fog}set fogColor(e){this._fogColor=e,this.scene&&(this.scene.fog.color=e)}get fogColor(){return this._fogColor}set fogDensity(e){this._fogDensity=e,this.scene&&(this.scene.fog.density=e)}get fogDensity(){return this._fogDensity}set fogStart(e){this._fogStart=e,this.scene&&(this.scene.fog.start=e)}get fogStart(){return this._fogStart}set fogEnd(e){this._fogEnd=e,this.scene&&(this.scene.fog.end=e)}get fogEnd(){return this._fogEnd}set gravity(e){if(this._gravity=e,this.scene){this.parentElement.app.systems.rigidbody.gravity.copy(e)}}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,a){switch(e){case"fog":this.fog=a;break;case"fog-color":this.fogColor=o(a);break;case"fog-density":this.fogDensity=parseFloat(a);break;case"fog-start":this.fogStart=parseFloat(a);break;case"fog-end":this.fogEnd=parseFloat(a);break;case"gravity":this.gravity=c(a)}}}customElements.define("pc-scene",D);class z extends a{constructor(){super(...arguments),this._asset="",this._center=new t.Vec3(0,.01,0),this._intensity=1,this._rotation=new t.Vec3,this._level=0,this._lighting=!1,this._scale=new t.Vec3(100,100,100),this._type="infinite",this._scene=null}connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._unloadSkybox()}_generateSkybox(e){if(!this._scene)return;const a=e.resource,s=t.EnvLighting.generateSkyboxCubemap(a);if(s.anisotropy=4,this._scene.skybox=s,this._lighting){const e=t.EnvLighting.generateLightingSource(a),s=t.EnvLighting.generateAtlas(e);this._scene.envAtlas=s}const i=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);i&&(i.enabled="none"!==this._type),this._scene.sky.type=this._type,this._scene.sky.node.setLocalScale(this._scale),this._scene.sky.center=this._center,this._scene.skyboxIntensity=this._intensity,this._scene.skyboxMip=this._level}async _loadSkybox(){var e;const t=await(null===(e=this.closestApp)||void 0===e?void 0:e.ready()),a=null==t?void 0:t.app;if(!a)return;const s=f.get(this._asset);s&&(this._scene=a.scene,s.loaded?this._generateSkybox(s):(s.once("load",()=>{this._generateSkybox(s)}),a.assets.load(s)))}_unloadSkybox(){var e,t;this._scene&&(null===(e=this._scene.skybox)||void 0===e||e.destroy(),this._scene.skybox=null,null===(t=this._scene.envAtlas)||void 0===t||t.destroy(),this._scene.envAtlas=null,this._scene=null)}set asset(e){this._asset=e,this.isConnected&&this._loadSkybox()}get asset(){return this._asset}set center(e){this._center=e,this._scene&&(this._scene.sky.center=this._center)}get center(){return this._center}set intensity(e){this._intensity=e,this._scene&&(this._scene.skyboxIntensity=this._intensity)}get intensity(){return this._intensity}set level(e){this._level=e,this._scene&&(this._scene.skyboxMip=this._level)}get level(){return this._level}set lighting(e){this._lighting=e}get lighting(){return this._lighting}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new t.Quat).setFromEulerAngles(e))}get rotation(){return this._rotation}set scale(e){this._scale=e,this._scene&&this._scene.sky.node.setLocalScale(this._scale)}get scale(){return this._scale}set type(e){if(this._type=e,this._scene){this._scene.sky.type=this._type;const e=this._scene.layers.getLayerById(t.LAYERID_SKYBOX);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","level","lighting","rotation","scale","type"]}attributeChangedCallback(e,t,a){switch(e){case"asset":this.asset=a;break;case"center":this.center=c(a);break;case"intensity":this.intensity=parseFloat(a);break;case"level":this.level=parseInt(a,10);break;case"lighting":this.lighting=this.hasAttribute(e);break;case"rotation":this.rotation=c(a);break;case"scale":this.scale=c(a);break;case"type":this.type=a}}}customElements.define("pc-sky",z),e.AppElement=i,e.AssetElement=f,e.AsyncElement=a,e.CameraComponentElement=_,e.CollisionComponentElement=k,e.ComponentElement=g,e.ElementComponentElement=v,e.EntityElement=h,e.LightComponentElement=w,e.ListenerComponentElement=u,e.MaterialElement=x,e.ModelElement=H,e.ModuleElement=s,e.ParticleSystemComponentElement=A,e.RenderComponentElement=C,e.RigidBodyComponentElement=S,e.SceneElement=D,e.ScreenComponentElement=j,e.ScriptComponentElement=F,e.ScriptElement=E,e.SkyElement=z,e.SoundComponentElement=O,e.SoundSlotElement=R,e.SplatComponentElement=P});
2
2
  //# sourceMappingURL=pwc.min.js.map