@playcanvas/web-components 0.12.0 → 0.13.1

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.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/app.d.cts +281 -0
  3. package/dist/app.d.ts +61 -3
  4. package/dist/asset.d.cts +224 -0
  5. package/dist/asset.d.ts +8 -2
  6. package/dist/async-element.d.cts +103 -0
  7. package/dist/async-element.d.ts +6 -4
  8. package/dist/colors.d.cts +1 -0
  9. package/dist/components/button-component.d.cts +186 -0
  10. package/dist/components/button-component.d.ts +1 -1
  11. package/dist/components/camera-component.d.cts +253 -0
  12. package/dist/components/camera-component.d.ts +1 -1
  13. package/dist/components/collision-component.d.cts +73 -0
  14. package/dist/components/collision-component.d.ts +1 -1
  15. package/dist/components/component.d.cts +82 -0
  16. package/dist/components/component.d.ts +1 -1
  17. package/dist/components/element-component.d.cts +316 -0
  18. package/dist/components/element-component.d.ts +1 -1
  19. package/dist/components/gsplat-component.d.cts +108 -0
  20. package/dist/components/gsplat-component.d.ts +1 -1
  21. package/dist/components/layoutchild-component.d.cts +110 -0
  22. package/dist/components/layoutchild-component.d.ts +1 -1
  23. package/dist/components/layoutgroup-component.d.cts +136 -0
  24. package/dist/components/layoutgroup-component.d.ts +1 -1
  25. package/dist/components/light-component.d.cts +264 -0
  26. package/dist/components/light-component.d.ts +1 -1
  27. package/dist/components/listener-component.d.cts +20 -0
  28. package/dist/components/listener-component.d.ts +1 -1
  29. package/dist/components/particlesystem-component.d.cts +52 -0
  30. package/dist/components/particlesystem-component.d.ts +1 -1
  31. package/dist/components/render-component.d.cts +76 -0
  32. package/dist/components/render-component.d.ts +1 -1
  33. package/dist/components/rigidbody-component.d.cts +88 -0
  34. package/dist/components/rigidbody-component.d.ts +1 -1
  35. package/dist/components/screen-component.d.cts +70 -0
  36. package/dist/components/screen-component.d.ts +1 -1
  37. package/dist/components/script-component.d.cts +163 -0
  38. package/dist/components/script-component.d.ts +1 -1
  39. package/dist/components/script.d.cts +94 -0
  40. package/dist/components/script.d.ts +1 -1
  41. package/dist/components/scrollbar-component.d.cts +69 -0
  42. package/dist/components/scrollbar-component.d.ts +1 -1
  43. package/dist/components/scrollview-component.d.cts +178 -0
  44. package/dist/components/scrollview-component.d.ts +1 -1
  45. package/dist/components/sound-component.d.cts +108 -0
  46. package/dist/components/sound-component.d.ts +1 -1
  47. package/dist/components/sound-slot.d.cts +134 -0
  48. package/dist/components/sound-slot.d.ts +2 -2
  49. package/dist/custom-elements.json +80 -22
  50. package/dist/entity-base.d.cts +67 -0
  51. package/dist/entity-base.d.ts +2 -2
  52. package/dist/entity.d.cts +131 -0
  53. package/dist/entity.d.ts +1 -1
  54. package/dist/index.d.cts +79 -0
  55. package/dist/index.d.ts +33 -33
  56. package/dist/loading-bar.d.cts +35 -0
  57. package/dist/material.d.cts +1011 -0
  58. package/dist/model.d.cts +72 -0
  59. package/dist/model.d.ts +1 -1
  60. package/dist/module.d.cts +29 -0
  61. package/dist/module.d.ts +16 -10
  62. package/dist/node.d.cts +253 -0
  63. package/dist/node.d.ts +1 -1
  64. package/dist/parse.d.cts +147 -0
  65. package/dist/pwc.cjs +285 -92
  66. package/dist/pwc.cjs.map +1 -1
  67. package/dist/pwc.js +286 -93
  68. package/dist/pwc.js.map +1 -1
  69. package/dist/pwc.min.js +1 -1
  70. package/dist/pwc.min.js.map +1 -1
  71. package/dist/pwc.min.mjs +1 -1
  72. package/dist/pwc.min.mjs.map +1 -1
  73. package/dist/pwc.mjs +286 -93
  74. package/dist/pwc.mjs.map +1 -1
  75. package/dist/scene.d.cts +117 -0
  76. package/dist/scene.d.ts +1 -1
  77. package/dist/sky.d.cts +121 -0
  78. package/dist/sky.d.ts +1 -1
  79. package/dist/vscode.html-custom-data.json +3 -3
  80. package/dist/web-types.json +42 -6
  81. package/package.json +16 -7
  82. package/src/app.ts +211 -49
  83. package/src/asset.ts +34 -2
  84. package/src/async-element.ts +4 -2
  85. package/src/components/button-component.ts +7 -7
  86. package/src/components/element-component.ts +7 -7
  87. package/src/components/gsplat-component.ts +3 -3
  88. package/src/components/particlesystem-component.ts +7 -8
  89. package/src/components/script-component.ts +2 -2
  90. package/src/components/sound-slot.ts +2 -2
  91. package/src/loading-bar.ts +2 -2
  92. package/src/material.ts +2 -2
  93. package/src/model.ts +2 -5
  94. package/src/module.ts +39 -20
  95. package/src/sky.ts +2 -3
package/dist/pwc.min.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{basisInitialize as e,WasmModule as t,Vec3 as a,Color as s,Vec4 as i,Quat as n,Vec2 as o,createGraphicsDevice as r,AppOptions as h,Keyboard as c,Mouse as l,ElementInput as p,AnimComponentSystem as b,AnimationComponentSystem as d,AudioListenerComponentSystem as u,ButtonComponentSystem as m,CameraComponentSystem as g,CollisionComponentSystem as f,ElementComponentSystem as _,GSplatComponentSystem as v,JointComponentSystem as y,LayoutChildComponentSystem as k,LayoutGroupComponentSystem as w,LightComponentSystem as M,ModelComponentSystem as x,ParticleSystemComponentSystem as S,RenderComponentSystem as C,RigidBodyComponentSystem as A,ScreenComponentSystem as F,ScriptComponentSystem as E,ScrollbarComponentSystem as j,ScrollViewComponentSystem as R,SoundComponentSystem as O,SpriteComponentSystem as z,ZoneComponentSystem as T,AnimClipHandler as H,AnimationHandler as P,AnimStateGraphHandler as G,AudioHandler as U,BinaryHandler as D,CssHandler as B,ContainerHandler as L,CubemapHandler as q,FolderHandler as W,FontHandler as K,GSplatHandler as Q,HierarchyHandler as I,HtmlHandler as J,JsonHandler as $,MaterialHandler as V,ModelHandler as Y,RenderHandler as N,ScriptHandler as X,SceneHandler as Z,ShaderHandler as ee,SpriteHandler as te,TemplateHandler as ae,TextHandler as se,TextureAtlasHandler as ie,TextureHandler as ne,SoundManager as oe,Lightmapper as re,BatchManager as he,XrManager as ce,AppBase as le,FILLMODE_FILL_WINDOW as pe,RESOLUTION_AUTO as be,Picker as de,MeshInstance as ue,Entity as me,Asset as ge,SPRITE_RENDERMODE_SIMPLE as fe,FILTER_LINEAR_MIPMAP_LINEAR as _e,FILTER_LINEAR as ve,ADDRESS_REPEAT as ye,SPRITE_RENDERMODE_SLICED as ke,SPRITE_RENDERMODE_TILED as we,ADDRESS_CLAMP_TO_EDGE as Me,ADDRESS_MIRRORED_REPEAT as xe,FILTER_NEAREST as Se,FILTER_NEAREST_MIPMAP_NEAREST as Ce,FILTER_LINEAR_MIPMAP_NEAREST as Ae,FILTER_NEAREST_MIPMAP_LINEAR as Fe,BUTTON_TRANSITION_MODE_TINT as Ee,BUTTON_TRANSITION_MODE_SPRITE_CHANGE as je,TONEMAP_NONE as Re,PROJECTION_PERSPECTIVE as Oe,GAMMA_SRGB as ze,GAMMA_NONE as Te,XRTYPE_VR as He,TONEMAP_LINEAR as Pe,TONEMAP_FILMIC as Ge,TONEMAP_HEJL as Ue,TONEMAP_ACES as De,TONEMAP_ACES2 as Be,TONEMAP_NEUTRAL as Le,PROJECTION_ORTHOGRAPHIC as qe,ORIENTATION_HORIZONTAL as We,FITTING_NONE as Ke,FITTING_STRETCH as Qe,FITTING_SHRINK as Ie,FITTING_BOTH as Je,ORIENTATION_VERTICAL as $e,SHADOW_PCF3_32F as Ve,SHADOW_PCF1_16F as Ye,SHADOW_PCF1_32F as Ne,SHADOW_PCF3_16F as Xe,SHADOW_PCF5_16F as Ze,SHADOW_PCF5_32F as et,SHADOW_VSM_16F as tt,SHADOW_VSM_32F as at,SHADOW_PCSS_32F as st,StandardMaterial as it,BLEND_NONE as nt,CULLFACE_BACK as ot,FRESNEL_SCHLICK as rt,SPECOCC_AO as ht,BLEND_NORMAL as ct,BLEND_ADDITIVE as lt,BLEND_ADDITIVEALPHA as pt,BLEND_PREMULTIPLIED as bt,BLEND_MULTIPLICATIVE as dt,BLEND_MULTIPLICATIVE2X as ut,BLEND_SCREEN as mt,BLEND_MIN as gt,BLEND_MAX as ft,BLEND_SUBTRACTIVE as _t,CULLFACE_NONE as vt,CULLFACE_FRONT as yt,CULLFACE_FRONTANDBACK as kt,FRESNEL_NONE as wt,SPECOCC_NONE as Mt,SPECOCC_GLOSSDEPENDENT as xt,SCALEMODE_NONE as St,SCALEMODE_BLEND as Ct,SCROLL_MODE_BOUNCE as At,SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED as Ft,SCROLLBAR_VISIBILITY_SHOW_ALWAYS as Et,SCROLL_MODE_CLAMP as jt,SCROLL_MODE_INFINITE as Rt,EnvLighting as Ot,LAYERID_SKYBOX as zt}from"playcanvas";class Tt extends HTMLElement{_readyPromise;_readyResolve;_readyResolved=!1;constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){return this.parentElement?.closest("pc-app")??null}get closestEntity(){return this.parentElement?.closest("pc-entity, pc-node")??null}_onReady(){this._readyResolved||(this._readyResolved=!0,this._readyResolve(),this.dispatchEvent(new CustomEvent("ready",{bubbles:!0,composed:!0})))}_resetReady(){this._readyResolved&&(this._readyResolved=!1,this._readyPromise=new Promise(e=>{this._readyResolve=e}))}ready(){return this._readyPromise.then(()=>this)}}async function Ht(e){let t;if("string"==typeof e){"loading"===document.readyState&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e,{once:!0})});try{t=document.querySelector(e)}catch{throw new Error(`whenReady: '${e}' is not a valid CSS selector`)}if(!t)throw new Error(`whenReady: no element found matching '${e}'`)}else t=e;if(!(t instanceof Tt)){const a=t instanceof Element?`<${t.tagName.toLowerCase()}>`:String(e);throw new Error(`whenReady: ${a} does not initialize asynchronously`)}return await t.ready(),t}class Pt extends HTMLElement{loadPromise;constructor(){super(),this.loadPromise=this.loadModule()}async loadModule(){const a=this.getAttribute("name"),s={glueUrl:this.getAttribute("glue"),wasmUrl:this.getAttribute("wasm"),fallbackUrl:this.getAttribute("fallback")};"Basis"===a?e(s):(t.setConfig(a,s),await new Promise(e=>{t.getInstance(a,()=>e())}))}_getLoadPromise(){return this.loadPromise}}customElements.define("pc-module",Pt);class Gt{_track;_fill;_sweep=null;_removal=null;constructor(e){this._track=document.createElement("div"),this._track.setAttribute("role","progressbar"),this._track.setAttribute("aria-label","Loading"),this._track.setAttribute("aria-valuemin","0"),this._track.setAttribute("aria-valuemax","100"),this._track.style.cssText=["position: fixed","top: 0","left: 0","width: 100%","height: var(--pc-loading-bar-height, 3px)","background: var(--pc-loading-bar-background, rgba(0, 0, 0, 0.1))","z-index: 10000","pointer-events: none","opacity: 1","transition: opacity 0.2s ease"].join("; "),this._fill=document.createElement("div"),this._fill.style.cssText=["width: 100%","height: 100%","transform-origin: left center","transform: scaleX(0)","background: var(--pc-loading-bar-color, #f60)","transition: transform 0.2s ease"].join("; "),this._track.appendChild(this._fill),e.appendChild(this._track),"function"==typeof this._fill.animate&&(this._sweep=this._fill.animate([{transform:"scaleX(0.25) translateX(-100%)"},{transform:"scaleX(0.25) translateX(500%)"}],{duration:1e3,iterations:1/0,easing:"ease-in-out"}))}progress(e,t){this._sweep&&(this._sweep.cancel(),this._sweep=null);const a=0===t?1:e/t;this._track.setAttribute("aria-valuenow",String(Math.round(100*a))),this._fill.style.transform=`scaleX(${a})`}complete(){null===this._removal&&(this._sweep&&(this._sweep.cancel(),this._sweep=null),this._track.setAttribute("aria-valuenow","100"),this._fill.style.transform="scaleX(1)",this._track.style.opacity="0",this._removal=setTimeout(()=>this._track.remove(),250))}destroy(){this._sweep&&(this._sweep.cancel(),this._sweep=null),null!==this._removal&&(clearTimeout(this._removal),this._removal=null),this._track.remove()}}const Ut={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"},Dt=(e,t)=>{const a=e.trim().split(/\s+/).map(Number);return a.length!==t||a.some(e=>!Number.isFinite(e))?null:a},Bt=e=>null===e?null:e.clone(),Lt=(e,t)=>null===e?t:"false"!==e,qt=(e,t,a)=>{if(null===e)return Bt(t);const i=Ut[e.toLowerCase()];if(i)return(new s).fromString(i);if(/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)){let t=e.slice(1);return 3!==t.length&&4!==t.length||(t=t.split("").map(e=>e+e).join("")),(new s).fromString(`#${t}`)}const n=Dt(e,4)??Dt(e,3);return n?new s(n):(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected a CSS color name, a hex color or 3 or 4 space-separated numbers. Using '${t}'.`),Bt(t))},Wt=(e,t,a,s)=>{if(null===e)return a;const i=Array.isArray(t)?t:[...t.keys()];return i.includes(e)?e:(console.warn(`Invalid value '${e}' for attribute '${s}'. Valid values: ${i.join(", ")}. Using '${a}'.`),a)},Kt=(e,t,a)=>{if(null===e)return t;const s=""===e.trim()?NaN:Number(e);return Number.isFinite(s)?s:(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected a finite number. Using '${t}'.`),t)},Qt=(e,t,a)=>{if(null===e)return Bt(t);const s=Dt(e,3);return s?(new n).setFromEulerAngles(s[0],s[1],s[2]):(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected 3 space-separated numbers. Using '${t}'.`),Bt(t))},It=(e,t=[])=>null===e?[...t]:e.split(",").map(e=>e.trim()).filter(e=>""!==e),Jt=(e,t,a)=>{if(null===e)return Bt(t);const s=Dt(e,2);return s?new o(s):(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected 2 space-separated numbers. Using '${t}'.`),Bt(t))},$t=(e,t,s)=>{if(null===e)return Bt(t);const i=Dt(e,3);return i?new a(i):(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected 3 space-separated numbers. Using '${t}'.`),Bt(t))},Vt=(e,t,a)=>{if(null===e)return Bt(t);const s=Dt(e,4);return s?new i(s):(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected 4 space-separated numbers. Using '${t}'.`),Bt(t))},Yt=e=>{if(!e)return null;let t=null;try{t=document.querySelector(e)}catch{t=null}return t||(t=document.getElementById(e)??document.querySelector(`pc-entity[name="${e}"]`)),t?.entity??null},Nt=["pointermove","pointerdown","pointerup","pointerenter","pointerleave"];class Xt extends Tt{_canvas=null;_alpha=!0;_backend="webgpu";_antialias=!0;_depthBuffer=!0;_stencilBuffer=!0;_maxPixelRatio=1/0;_loadingBar=!0;_optionsLocked=!1;_bar=null;_hierarchyReady=!1;_bootGeneration=0;_entityElements=new Map;_picker=null;_hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1};_hoveredEntity=null;_pickToken=0;_pointerHandlers={pointermove:null,pointerdown:null,pointerup:null};_app=null;_loadProgress=0;get app(){return this._app}get loadProgress(){return this._loadProgress}constructor(){super(),this._onWindowResize=this._onWindowResize.bind(this),Nt.forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}async connectedCallback(){const e=++this._bootGeneration;this._loadingBar&&!this._bar&&(this._bar=new Gt(this));const t=this.querySelectorAll(":scope > pc-module");if(await Promise.all(Array.from(t).map(e=>e._getLoadPromise())),e!==this._bootGeneration)return;this._canvas=document.createElement("canvas"),this.appendChild(this._canvas);const a={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[];this._optionsLocked=!0;const s=await r(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depthBuffer,deviceTypes:a,stencil:this._stencilBuffer});if(e!==this._bootGeneration)return void s.destroy();s.maxPixelRatio=this._maxPixelRatio;const i=new h;i.graphicsDevice=s,i.keyboard=new c(window),i.mouse=new l(this._canvas),i.elementInput=new p(this._canvas,{useMouse:!0,useTouch:!0}),i.componentSystems=[b,d,u,m,g,f,_,v,y,k,w,M,x,S,C,A,F,E,j,R,O,z,T],i.resourceHandlers=[H,P,G,U,D,B,L,q,W,K,Q,I,J,$,V,Y,N,X,Z,ee,te,ae,se,ie,ne],i.soundManager=new oe,i.lightmapper=re,i.batchManager=he,i.xr=ce;const n=new le(this._canvas);this._app=n,n.init(i),n.setCanvasFillMode(pe),n.setCanvasResolution(be),this._pickerCreate();const o=this.querySelectorAll(":scope > pc-asset");for(const t of Array.from(o)){t._createAsset();const a=t.asset;if(a&&(n.assets.add(a),e!==this._bootGeneration))return}const de=this.querySelectorAll(":scope > pc-material");Array.from(de).forEach(e=>{e._createMaterial()});const ue=this.querySelectorAll("pc-entity");if(Array.from(ue).forEach(e=>{e._createEntity(n)}),ue.forEach(e=>{e._buildHierarchy(n)}),e!==this._bootGeneration)return;this._hierarchyReady=!0;const me=n.assets.list({preload:!0}).length;let ge=0;const fe=()=>{ge+=1,this._loadProgress=ge/me,this._bar?.progress(ge,me),this.dispatchEvent(new ProgressEvent("progress",{lengthComputable:!0,loaded:ge,total:me}))};n.on("preload:progress",fe),this._loadProgress=0===me?1:0,this._bar?.progress(0,me),this.dispatchEvent(new ProgressEvent("progress",{lengthComputable:!0,loaded:0,total:me})),e===this._bootGeneration&&n.preload(()=>{e===this._bootGeneration&&(n.off("preload:progress",fe),this._loadProgress=1,n.start(),n.once("frameend",()=>this._bar?.complete()),window.addEventListener("resize",this._onWindowResize),this._onReady())})}disconnectedCallback(){this._bootGeneration++,this._optionsLocked=!1,this._pickerDestroy(),this._app&&(this._app.destroy(),this._app=null),this._entityElements.clear(),this._loadProgress=0,this._bar?.destroy(),this._bar=null,this._hierarchyReady=!1,this._resetReady(),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:t}=this.app.graphicsDevice;this._picker=new de(this.app,e,t);const a=e=>t=>{e.call(this,t)};this._pointerHandlers.pointermove=a(this._onPointerMove),this._pointerHandlers.pointerdown=a(this._onPointerDown),this._pointerHandlers.pointerup=a(this._onPointerUp),Nt.forEach(e=>{Array.from(this.querySelectorAll("pc-entity, pc-node")).some(t=>t._hasListeners(e))&&this._onPointerListenerAdded(e)})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1}}_registerEntityElement(e,t){this._entityElements.set(e,t)}_unregisterEntityElement(e){this._entityElements.delete(e)}elementFromEntity(e){return this._entityElements.get(e)??null}_elementFromNode(e){for(;null!==e;){const t=this._entityElements.get(e);if(t)return t;e=e.parent}return null}_elementWithListener(e,t){for(;null!==e;){const a=this._entityElements.get(e);if(a?._hasListeners(t))return a;e=e.parent}return 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}}async _pickNode(e){const t=this.app.root.findComponent("camera");if(!t)return null;const{x:a,y:s}=this._getPickerCoordinates(e);this._picker.prepare(t,this.app.scene);const i=await this._picker.getSelectionAsync(a,s);if(0===i.length)return null;const n=i[0];return n instanceof ue?n.node:n.entity}async _onPointerMove(e){if(!this._picker||!this.app)return;const t=++this._pickToken,a=await this._pickNode(e);if(t!==this._pickToken||!this._picker)return;const s=this._elementFromNode(a);this._hoveredEntity!==s&&(this._hoveredEntity&&this._hoveredEntity._hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),s&&s._hasListeners("pointerenter")&&s.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=s,s&&s._hasListeners("pointermove")&&s.dispatchEvent(new PointerEvent("pointermove",e))}async _onPointerDown(e){if(!this._picker||!this.app)return;const t=await this._pickNode(e);if(!this._picker)return;const a=this._elementWithListener(t,"pointerdown");a&&a.dispatchEvent(new PointerEvent("pointerdown",e))}async _onPointerUp(e){if(!this._picker||!this.app)return;const t=await this._pickNode(e);if(!this._picker)return;const a=this._elementWithListener(t,"pointerup");a&&a.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, pc-node")).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)}}_warnIfBooted(e){this._optionsLocked&&console.warn(`Attribute '${e}' on <pc-app> is only read when the application boots, so this change has no effect. Set it before the element is connected, or remove and re-insert the element to reboot with the new value.`)}set alpha(e){this._warnIfBooted("alpha"),this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._warnIfBooted("antialias"),this._antialias=e}get antialias(){return this._antialias}set backend(e){this._warnIfBooted("backend"),this._backend=e}get backend(){return this._backend}set depthBuffer(e){this._warnIfBooted("depth-buffer"),this._depthBuffer=e}get depthBuffer(){return this._depthBuffer}set loadingBar(e){this._loadingBar=e,!e&&this._bar&&(this._bar.destroy(),this._bar=null)}get loadingBar(){return this._loadingBar}set maxPixelRatio(e){this._maxPixelRatio=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e,this.app.resizeCanvas())}get maxPixelRatio(){return this._maxPixelRatio}set stencilBuffer(e){this._warnIfBooted("stencil-buffer"),this._stencilBuffer=e}get stencilBuffer(){return this._stencilBuffer}static get observedAttributes(){return["alpha","antialias","backend","depth-buffer","loading-bar","max-pixel-ratio","stencil-buffer"]}attributeChangedCallback(e,t,a){switch(e){case"alpha":this.alpha=Lt(a,!0);break;case"antialias":this.antialias=Lt(a,!0);break;case"backend":this.backend=Wt(a,["webgpu","webgl2","null"],"webgpu",e);break;case"depth-buffer":this.depthBuffer=Lt(a,!0);break;case"loading-bar":this.loadingBar=Lt(a,!0);break;case"max-pixel-ratio":this.maxPixelRatio=Kt(a,1/0,e);break;case"stencil-buffer":this.stencilBuffer=Lt(a,!0)}}}customElements.define("pc-app",Xt);const Zt=["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"];class ea extends Tt{_entity=null;_appElement=null;_listeners={};_inlineHandlerTypes=new Set;get entity(){return this._entity}_registerEntity(e){this._appElement=this.closestApp,this._appElement?._registerEntityElement(e,this)}_unregisterEntity(e){this._appElement?._unregisterEntityElement(e),this._appElement=null}_updateInlineHandler(e,t){const a=e.substring(2),s=this._inlineHandlerTypes.has(a),i=null!==t;i&&!s?(this._inlineHandlerTypes.add(a),this.dispatchEvent(new CustomEvent(`${a}:connect`,{bubbles:!0}))):!i&&s&&(this._inlineHandlerTypes.delete(a),this.dispatchEvent(new CustomEvent(`${a}:disconnect`,{bubbles:!0})))}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){return Boolean(this._listeners[e]?.length)||this._inlineHandlerTypes.has(e)}}class ta extends ea{_enabled=!0;_name="Untitled";_position=new a;_rotation=new a;_scale=new a(1,1,1);_tags=[];_built=!1;_createEntity(e){if(this._entity)return;const t=new me(this._name,e);this._entity=t,t.enabled=this._enabled,t.setLocalPosition(this._position),t.setLocalEulerAngles(this._rotation),t.setLocalScale(this._scale),this._tags.length>0&&t.tags.add(this._tags),this._registerEntity(t),t.once("destroy",this._onEntityDestroy,this)}_onEntityDestroy(e){this._unregisterEntity(e),this._entity=null,this._built=!1,this._resetReady()}_buildHierarchy(e){if(!this.entity||this._built)return;const t=this.closestEntity;t&&!t.entity||(this._built=!0,t?.entity?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady())}connectedCallback(){const e=this.closestApp;if(!e){const e=this.getAttribute("name"),t=e?` '${e}'`:"";return void console.warn(`pc-entity${t} must be a descendant of pc-app - entity not created`)}if(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(){this._entity?.destroy()}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",...Zt]}attributeChangedCallback(e,t,s){switch(e){case"enabled":this.enabled=Lt(s,!0);break;case"name":this.name=s??"Untitled";break;case"position":this.position=$t(s,a.ZERO,e);break;case"rotation":this.rotation=$t(s,a.ZERO,e);break;case"scale":this.scale=$t(s,a.ONE,e);break;case"tags":this.tags=It(s);break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":this._updateInlineHandler(e,s)}}}customElements.define("pc-entity",ta);var aa=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,h=s+3&-4,c=r(h*i),l=r(n.length),p=new Uint8Array(a.exports.memory.buffer);p.set(n,l);var b=e(c,s,i,l,n.length);if(0==b&&o&&o(c,h,i),t.set(p.subarray(c,c+s*i)),r(c-r(0)),0!=b)throw new Error("Malformed buffer data: "+b)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},c=[],l=0;function p(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 b(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)c[r]=p(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){b(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,c){o(a.exports[h[n]],e,t,s,i,a.exports[r[c]])},decodeGltfBufferAsync:function(e,t,s,n,p){return c.length>0?function(e,t,a,s,i){for(var n=c[0],o=1;o<c.length;++o)c[o].pending<n.pending&&(n=c[o]);return new Promise(function(o,r){var h=new Uint8Array(a),c=l++;n.pending+=e,n.requests[c]={resolve:o,reject:r},n.object.postMessage({id:c,count:e,size:t,source:h,mode:s,filter:i},[h.buffer])})}(e,t,s,h[n],r[p]):i.then(function(){var i=new Uint8Array(e*t);return o(a.exports[h[n]],i,e,t,s,a.exports[r[p]]),i})}}}();const sa=new Map([["simple",fe],["sliced",ke],["tiled",we]]),ia=new Map([["repeat",ye],["clamp",Me],["mirror",xe]]),na=new Map([["nearest",Se],["linear",ve],["nearest-mip-nearest",Ce],["linear-mip-nearest",Ae],["nearest-mip-linear",Fe],["linear-mip-linear",_e]]),oa=new Map([["nearest",Se],["linear",ve]]),ra=e=>e.replace(/-/g,"_"),ha={addressU:ye,addressV:ye,anisotropy:1,flipY:!1,magFilter:ve,minFilter:_e,mipmaps:!0,srgb:!1},ca=[[["address-u","address-v","anisotropy","flip-y","mag-filter","min-filter","mipmaps","srgb"],["texture","textureatlas"]],[["atlas","frame-keys","pixels-per-unit","render-mode"],["sprite"]]],la=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["gltf","container"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["ktx2","texture"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),pa=(e,t,a)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const s=e.extensions.EXT_meshopt_compression;Promise.all([aa.ready,t[s.buffer]]).then(e=>{const t=e[1],i=s.byteOffset||0,n=s.byteLength||0,o=s.count,r=s.byteStride,h=new Uint8Array(o*r),c=new Uint8Array(t.buffer,t.byteOffset+i,n);aa.decodeGltfBuffer(h,o,r,c,s.mode,s.filter),a(null,h)})}else a(null,null)};class ba extends Tt{_addressU=null;_addressV=null;_anisotropy=null;_flipY=null;_lazy=!1;_magFilter=null;_minFilter=null;_mipmaps=null;_srgb=null;asset=null;async connectedCallback(){const e=this.closestApp;if(e)if(this.parentElement===e){if(await e.ready(),this.isConnected&&this.parentElement===e){if(!this.asset){const t=e.app;if(!t)return;this._createAsset(),this.asset&&(t.assets.add(this.asset),this.lazy||t.assets.load(this.asset))}this.asset&&this._onReady()}}else console.warn(`pc-asset '${this.getAttribute("id")??this.getAttribute("src")}' must be a direct child of pc-app - asset not created`)}disconnectedCallback(){this._destroyAsset(),this._resetReady()}_onAssetLoad(){this.dispatchEvent(new Event("load"))}_onAssetError(e){this.dispatchEvent(new ErrorEvent("error",{message:e instanceof Error?e.message:String(e)}))}_createAsset(){const e=this.getAttribute("id")||"",t=this.getAttribute("src")||"";let a=this.getAttribute("type");if(!a){const e=t.split(".").pop();a=la.get(e||"")??null}if(!a)return void console.warn(`Unsupported asset type: ${t}`);const s=ca.filter(([,e])=>!e.includes(a)).flatMap(([e])=>e).filter(e=>this.hasAttribute(e));s.length>0&&console.warn(`pc-asset '${e||t}' has attributes that do not apply to asset type '${a}' and are ignored: ${s.join(", ")}`);const i=this._buildData(a);this.asset="container"===a?new ge(e,a,{url:t},void 0,{bufferView:{processAsync:pa.bind(this)}}):new ge(e,a,"sprite"===a?null:t?{url:t}:null,i),this.asset.preload=!this._lazy,this.asset.on("load",this._onAssetLoad,this),this.asset.on("error",this._onAssetError,this)}_buildData(e){let t;const a=this.getAttribute("data");if(a)try{t=JSON.parse(a)}catch(e){console.warn(`Invalid 'data' JSON on pc-asset: ${a}`)}if("texture"!==e&&"textureatlas"!==e||(t=t??{},null!==this._addressU&&(t.addressu=this._addressU),null!==this._addressV&&(t.addressv=this._addressV),null!==this._anisotropy&&(t.anisotropy=this._anisotropy),null!==this._flipY&&(t.flipY=this._flipY),null!==this._magFilter&&(t.magfilter=ra(this._magFilter)),null!==this._minFilter&&(t.minfilter=ra(this._minFilter)),null!==this._mipmaps&&(t.mipmaps=this._mipmaps),null!==this._srgb&&(t.srgb=this._srgb)),"sprite"===e){t=t??{};const e=this.getAttribute("atlas")??t.textureAtlasAsset;if("string"==typeof e){const a=ba.get(e);a?t.textureAtlasAsset=a.id:console.warn(`pc-asset sprite '${this.getAttribute("id")}' could not find atlas '${e}'`)}const a=this.getAttribute("frame-keys");null!==a&&(t.frameKeys=a.split(/[\s,]+/).filter(Boolean));const s=this.getAttribute("pixels-per-unit");null!==s&&(t.pixelsPerUnit=Kt(s,1,"pixels-per-unit"));const i=this.getAttribute("render-mode");null!==i&&(t.renderMode=sa.get(Wt(i,sa,"simple","render-mode"))),t.renderMode=t.renderMode??fe,t.pixelsPerUnit=t.pixelsPerUnit??1,t.frameKeys=t.frameKeys??[]}return t}_texture(){const e=this.asset;return e?.resource?"texture"===e.type?e.resource:"textureatlas"===e.type?e.resource.texture??null:null:null}_applyTextureOption(e,t,a,s){const i=this.asset;if(!i||"texture"!==i.type&&"textureatlas"!==i.type)return;const n=i.data;null===a?delete n[e]:n[e]=a;const o=this._texture();o&&(o[t]=s??ha[t])}_destroyAsset(){this.asset&&(this.asset.off("load",this._onAssetLoad,this),this.asset.off("error",this._onAssetError,this),this.asset.registry?.remove(this.asset),this.asset.unload(),this.asset=null)}set addressU(e){this._addressU=e;const t=null===e?null:ia.get(e)??ye;this._applyTextureOption("addressu","addressU",e,t)}get addressU(){return this._addressU}set addressV(e){this._addressV=e;const t=null===e?null:ia.get(e)??ye;this._applyTextureOption("addressv","addressV",e,t)}get addressV(){return this._addressV}set anisotropy(e){this._anisotropy=e,this._applyTextureOption("anisotropy","anisotropy",e,e)}get anisotropy(){return this._anisotropy}set flipY(e){this._flipY=e,this._applyTextureOption("flipY","flipY",e,e)}get flipY(){return this._flipY}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e)}get lazy(){return this._lazy}set magFilter(e){this._magFilter=e;const t=null===e?null:ra(e),a=null===e?null:oa.get(e)??ve;this._applyTextureOption("magfilter","magFilter",t,a)}get magFilter(){return this._magFilter}set minFilter(e){this._minFilter=e;const t=null===e?null:ra(e),a=null===e?null:na.get(e)??_e;this._applyTextureOption("minfilter","minFilter",t,a)}get minFilter(){return this._minFilter}set mipmaps(e){this._mipmaps=e,this._applyTextureOption("mipmaps","mipmaps",e,e)}get mipmaps(){return this._mipmaps}set srgb(e){this._srgb=e,this._applyTextureOption("srgb","srgb",e,e)}get srgb(){return this._srgb}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return t?.asset}static get observedAttributes(){return["address-u","address-v","anisotropy","flip-y","lazy","mag-filter","min-filter","mipmaps","srgb"]}attributeChangedCallback(e,t,a){switch(e){case"address-u":this.addressU=null!==a?Wt(a,ia,"repeat",e):null;break;case"address-v":this.addressV=null!==a?Wt(a,ia,"repeat",e):null;break;case"anisotropy":this.anisotropy=null!==a?Kt(a,1,e):null;break;case"flip-y":this.flipY=null!==a?Lt(a,!1):null;break;case"lazy":this.lazy=Lt(a,!1);break;case"mag-filter":this.magFilter=null!==a?Wt(a,oa,"linear",e):null;break;case"min-filter":this.minFilter=null!==a?Wt(a,na,"linear-mip-linear",e):null;break;case"mipmaps":this.mipmaps=null!==a?Lt(a,!0):null;break;case"srgb":this.srgb=null!==a?Lt(a,!1):null}}}customElements.define("pc-asset",ba);class da extends Tt{_componentName;_enabled=!0;_component=null;_appElement=null;_hostElement=null;_hostReadyListener=null;_connectionGeneration=0;constructor(e){super(),this._componentName=e}getInitialComponentData(){return{}}_applyComponent(){const e=this._hostElement?.entity??null;if(this._component&&this._component.entity===e)return;const t=this._component;if(t?.entity&&t.entity.c[this._componentName]===t&&t.entity.removeComponent(this._componentName),this._component=null,e){if(e.c[this._componentName]){const t=this.id?` '${this.id}'`:"";return void console.warn(`${this.tagName.toLowerCase()}${t} - '${e.name}' already has a '${this._componentName}' component - component not added`)}this._component=e.addComponent(this._componentName,this.getInitialComponentData())}}async _addComponent(){const e=this._connectionGeneration,t=this.closestEntity;if(!t){const e=this.id?` '${this.id}'`:"";return void console.warn(`${this.tagName.toLowerCase()}${e} must be a descendant of pc-entity - component not added`)}await t.ready(),e===this._connectionGeneration&&(this._hostElement=t,this._applyComponent(),this._hostReadyListener=t=>{t.target===this._hostElement&&e===this._connectionGeneration&&this._hostCycled()},t.addEventListener("ready",this._hostReadyListener))}_hostCycled(){this._resetReady(),this._applyComponent(),this._hostElement?.entity&&(this.initComponent(),this._onReady())}initComponent(){}async connectedCallback(){const e=++this._connectionGeneration;this._appElement=this.closestApp??null,await(this._appElement?.ready()),e===this._connectionGeneration&&(await this._addComponent(),e===this._connectionGeneration&&(this.initComponent(),this._onReady()))}disconnectedCallback(){this._connectionGeneration++,this._hostElement&&this._hostReadyListener&&this._hostElement.removeEventListener("ready",this._hostReadyListener),this._hostElement=null,this._hostReadyListener=null,this._appElement?.app&&this._component?.entity&&this._component.entity.removeComponent(this._componentName),this._component=null,this._appElement=null,this._resetReady()}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=Lt(a,!0)}}class ua extends da{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",ua);const ma=new Map([["tint",Ee],["sprite",je]]);class ga extends da{_active=!0;_image="";_hitPadding=new i(0,0,0,0);_transitionMode="tint";_hoverTint=new s(1,1,1,1);_pressedTint=new s(1,1,1,1);_inactiveTint=new s(1,1,1,1);_fadeDuration=0;_hoverSpriteAsset="";_hoverSpriteFrame=0;_pressedSpriteAsset="";_pressedSpriteFrame=0;_inactiveSpriteAsset="";_inactiveSpriteFrame=0;constructor(){super("button")}getInitialComponentData(){const e={active:this._active,hitPadding:this._hitPadding,transitionMode:ma.get(this._transitionMode),hoverTint:this._hoverTint,pressedTint:this._pressedTint,inactiveTint:this._inactiveTint,fadeDuration:this._fadeDuration,hoverSpriteFrame:this._hoverSpriteFrame,pressedSpriteFrame:this._pressedSpriteFrame,inactiveSpriteFrame:this._inactiveSpriteFrame},t=this._image?Yt(this._image):this.closestEntity?.entity;t&&(e.imageEntity=t);const a=ba.get(this._hoverSpriteAsset);a&&(e.hoverSpriteAsset=a.id);const s=ba.get(this._pressedSpriteAsset);s&&(e.pressedSpriteAsset=s.id);const i=ba.get(this._inactiveSpriteAsset);return i&&(e.inactiveSpriteAsset=i.id),e}get component(){return super.component}set active(e){this._active=e,this.component&&(this.component.active=e)}get active(){return this._active}set image(e){this._image=e;const t=Yt(e);this.component&&t&&(this.component.imageEntity=t)}get image(){return this._image}set hitPadding(e){this._hitPadding=e,this.component&&(this.component.hitPadding=e)}get hitPadding(){return this._hitPadding}set transitionMode(e){this._transitionMode=e,this.component&&(this.component.transitionMode=ma.get(e)??Ee)}get transitionMode(){return this._transitionMode}set hoverTint(e){this._hoverTint=e,this.component&&(this.component.hoverTint=e)}get hoverTint(){return this._hoverTint}set pressedTint(e){this._pressedTint=e,this.component&&(this.component.pressedTint=e)}get pressedTint(){return this._pressedTint}set inactiveTint(e){this._inactiveTint=e,this.component&&(this.component.inactiveTint=e)}get inactiveTint(){return this._inactiveTint}set fadeDuration(e){this._fadeDuration=e,this.component&&(this.component.fadeDuration=e)}get fadeDuration(){return this._fadeDuration}set hoverSpriteAsset(e){this._hoverSpriteAsset=e;const t=ba.get(e);this.component&&t&&(this.component.hoverSpriteAsset=t.id)}get hoverSpriteAsset(){return this._hoverSpriteAsset}set hoverSpriteFrame(e){this._hoverSpriteFrame=e,this.component&&(this.component.hoverSpriteFrame=e)}get hoverSpriteFrame(){return this._hoverSpriteFrame}set pressedSpriteAsset(e){this._pressedSpriteAsset=e;const t=ba.get(e);this.component&&t&&(this.component.pressedSpriteAsset=t.id)}get pressedSpriteAsset(){return this._pressedSpriteAsset}set pressedSpriteFrame(e){this._pressedSpriteFrame=e,this.component&&(this.component.pressedSpriteFrame=e)}get pressedSpriteFrame(){return this._pressedSpriteFrame}set inactiveSpriteAsset(e){this._inactiveSpriteAsset=e;const t=ba.get(e);this.component&&t&&(this.component.inactiveSpriteAsset=t.id)}get inactiveSpriteAsset(){return this._inactiveSpriteAsset}set inactiveSpriteFrame(e){this._inactiveSpriteFrame=e,this.component&&(this.component.inactiveSpriteFrame=e)}get inactiveSpriteFrame(){return this._inactiveSpriteFrame}static get observedAttributes(){return[...super.observedAttributes,"active","image","hit-padding","transition-mode","hover-tint","pressed-tint","inactive-tint","fade-duration","hover-sprite-asset","hover-sprite-frame","pressed-sprite-asset","pressed-sprite-frame","inactive-sprite-asset","inactive-sprite-frame"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"active":this.active=Lt(a,!0);break;case"image":this.image=a??"";break;case"hit-padding":this.hitPadding=Vt(a,i.ZERO,e);break;case"transition-mode":this.transitionMode=Wt(a,ma,"tint",e);break;case"hover-tint":this.hoverTint=qt(a,s.WHITE,e);break;case"pressed-tint":this.pressedTint=qt(a,s.WHITE,e);break;case"inactive-tint":this.inactiveTint=qt(a,s.WHITE,e);break;case"fade-duration":this.fadeDuration=Kt(a,0,e);break;case"hover-sprite-asset":this.hoverSpriteAsset=a??"";break;case"hover-sprite-frame":this.hoverSpriteFrame=Kt(a,0,e);break;case"pressed-sprite-asset":this.pressedSpriteAsset=a??"";break;case"pressed-sprite-frame":this.pressedSpriteFrame=Kt(a,0,e);break;case"inactive-sprite-asset":this.inactiveSpriteAsset=a??"";break;case"inactive-sprite-frame":this.inactiveSpriteFrame=Kt(a,0,e)}}}customElements.define("pc-button",ga);const fa=new Map([["perspective",Oe],["orthographic",qe]]),_a=new Map([["none",Re],["linear",Pe],["filmic",Ge],["hejl",Ue],["aces",De],["aces2",Be],["neutral",Le]]);class va extends da{_clearColor=new s(.75,.75,.75,1);_clearColorBuffer=!0;_clearDepthBuffer=!0;_clearStencilBuffer=!1;_cullFaces=!0;_farClip=1e3;_flipFaces=!1;_fov=45;_frustumCulling=!0;_gamma="srgb";_horizontalFov=!1;_nearClip=.1;_projection="perspective";_orthoHeight=10;_priority=0;_rect=new i(0,0,1,1);_scissorRect=new i(0,0,1,1);_tonemap="none";constructor(){super("camera")}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?ze:Te,horizontalFov:this._horizontalFov,nearClip:this._nearClip,projection:fa.get(this._projection)??Oe,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:_a.get(this._tonemap)??Re}}get xrAvailable(){const e=this.component?.system.app.xr;return e&&e.supported&&e.isAvailable(He)}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?ze:Te)}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 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 projection(e){this._projection=e,this.component&&(this.component.projection=fa.get(e)??Oe)}get projection(){return this._projection}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){this._tonemap=e,this.component&&(this.component.toneMapping=_a.get(e)??Re)}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","ortho-height","priority","projection","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"clear-color":this.clearColor=qt(a,new s(.75,.75,.75,1),e);break;case"clear-color-buffer":this.clearColorBuffer=Lt(a,!0);break;case"clear-depth-buffer":this.clearDepthBuffer=Lt(a,!0);break;case"clear-stencil-buffer":this.clearStencilBuffer=Lt(a,!1);break;case"cull-faces":this.cullFaces=Lt(a,!0);break;case"far-clip":this.farClip=Kt(a,1e3,e);break;case"flip-faces":this.flipFaces=Lt(a,!1);break;case"fov":this.fov=Kt(a,45,e);break;case"frustum-culling":this.frustumCulling=Lt(a,!0);break;case"gamma":this.gamma=Wt(a,["linear","srgb"],"srgb",e);break;case"horizontal-fov":this.horizontalFov=Lt(a,!1);break;case"near-clip":this.nearClip=Kt(a,.1,e);break;case"ortho-height":this.orthoHeight=Kt(a,10,e);break;case"priority":this.priority=Kt(a,0,e);break;case"projection":this.projection=Wt(a,fa,"perspective",e);break;case"rect":this.rect=Vt(a,new i(0,0,1,1),e);break;case"scissor-rect":this.scissorRect=Vt(a,new i(0,0,1,1),e);break;case"tonemap":this.tonemap=Wt(a,_a,"none",e)}}}customElements.define("pc-camera",va);class ya extends da{_angularOffset=new n;_axis=1;_convexHull=!1;_halfExtents=new a(.5,.5,.5);_height=2;_linearOffset=new a;_radius=.5;_type="box";constructor(){super("collision")}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}}initComponent(){this._applyMeshGeometryDefault()}_applyMeshGeometryDefault(){const e=this.component;if(!e||"mesh"!==this._type||null!==e.renderAsset)return;const t=e.entity.render?.asset??null;null!==t?e.renderAsset=t:console.warn(`pc-collision type="mesh" on '${e.entity.name}' found no asset-backed render component to take geometry from - collider has no shape`)}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,this._applyMeshGeometryDefault())}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,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"angular-offset":this.angularOffset=Qt(s,n.IDENTITY,e);break;case"axis":this.axis=Kt(s,1,e);break;case"convex-hull":this.convexHull=Lt(s,!1);break;case"half-extents":this.halfExtents=$t(s,new a(.5,.5,.5),e);break;case"height":this.height=Kt(s,2,e);break;case"linear-offset":this.linearOffset=$t(s,a.ZERO,e);break;case"radius":this.radius=Kt(s,.5,e);break;case"type":this.type=Wt(s,["box","capsule","compound","cone","cylinder","mesh","sphere"],"box",e)}}}customElements.define("pc-collision",ya);class ka extends da{_anchor=new i(.5,.5,.5,.5);_autoWidth=!0;_autoHeight=!0;_autoFitWidth=!1;_autoFitHeight=!1;_color=new s(1,1,1,1);_enableMarkup=!1;_fontAsset="";_fontSize=32;_maxFontSize=32;_minFontSize=8;_height=0;_lineHeight=32;_margin=null;_mask=!1;_opacity=1;_pivot=new o(.5,.5);_pixelsPerUnit=null;_spriteAsset="";_spriteFrame=0;_text="";_textureAsset="";_type="group";_useInput=!1;_width=0;_wrapLines=!1;constructor(){super("element")}initComponent(){const e=this.component;e&&(e._text?._material&&(e._text._material.useFog=!0),e._dirtifyMask?.())}getInitialComponentData(){const e={anchor:this._anchor,autoWidth:this._autoWidth,autoHeight:this._autoHeight,autoFitWidth:this._autoFitWidth,autoFitHeight:this._autoFitHeight,color:this._color,enableMarkup:this._enableMarkup,fontSize:this._fontSize,maxFontSize:this._maxFontSize,minFontSize:this._minFontSize,height:this._height,lineHeight:this._lineHeight,mask:this._mask,opacity:this._opacity,pivot:this._pivot,spriteFrame:this._spriteFrame,type:this._type,text:this._text,useInput:this._useInput,width:this._width,wrapLines:this._wrapLines},t=ba.get(this._fontAsset);t&&(e.fontAsset=t.id);const a=ba.get(this._spriteAsset);a&&(e.spriteAsset=a.id);const s=ba.get(this._textureAsset);return s&&(e.textureAsset=s.id),this._margin&&(e.margin=this._margin),null!==this._pixelsPerUnit&&(e.pixelsPerUnit=this._pixelsPerUnit),e}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set autoHeight(e){this._autoHeight=e,this.component&&(this.component.autoHeight=e)}get autoHeight(){return this._autoHeight}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set enableMarkup(e){this._enableMarkup=e,this.component&&(this.component.enableMarkup=e)}get enableMarkup(){return this._enableMarkup}set fontAsset(e){this._fontAsset=e;const t=ba.get(e);this.component&&t&&(this.component.fontAsset=t.id)}get fontAsset(){return this._fontAsset}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set margin(e){this._margin=e,this.component&&e&&(this.component.margin=e)}get margin(){return this._margin}set mask(e){this._mask=e,this.component&&(this.component.mask=e)}get mask(){return this._mask}set opacity(e){this._opacity=e,this.component&&(this.component.opacity=e)}get opacity(){return this._opacity}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set pixelsPerUnit(e){this._pixelsPerUnit=e,this.component&&null!==e&&(this.component.pixelsPerUnit=e)}get pixelsPerUnit(){return this._pixelsPerUnit}set spriteAsset(e){this._spriteAsset=e;const t=ba.get(e);this.component&&t&&(this.component.spriteAsset=t.id)}get spriteAsset(){return this._spriteAsset}set spriteFrame(e){this._spriteFrame=e,this.component&&(this.component.spriteFrame=e)}get spriteFrame(){return this._spriteFrame}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set textureAsset(e){this._textureAsset=e;const t=ba.get(e);this.component&&t&&(this.component.textureAsset=t.id)}get textureAsset(){return this._textureAsset}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set useInput(e){this._useInput=e,this.component&&(this.component.useInput=e)}get useInput(){return this._useInput}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}set autoFitWidth(e){this._autoFitWidth=e,this.component&&(this.component.autoFitWidth=e)}get autoFitWidth(){return this._autoFitWidth}set autoFitHeight(e){this._autoFitHeight=e,this.component&&(this.component.autoFitHeight=e)}get autoFitHeight(){return this._autoFitHeight}set minFontSize(e){this._minFontSize=e,this.component&&(this.component.minFontSize=e)}get minFontSize(){return this._minFontSize}set maxFontSize(e){this._maxFontSize=e,this.component&&(this.component.maxFontSize=e)}get maxFontSize(){return this._maxFontSize}static get observedAttributes(){return[...super.observedAttributes,"anchor","auto-width","auto-height","auto-fit-width","auto-fit-height","color","enable-markup","font-asset","font-size","max-font-size","min-font-size","height","line-height","margin","mask","opacity","pivot","pixels-per-unit","sprite-asset","sprite-frame","text","texture-asset","type","use-input","width","wrap-lines"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"anchor":this.anchor=Vt(a,new i(.5,.5,.5,.5),e);break;case"auto-width":this.autoWidth=Lt(a,!0);break;case"auto-height":this.autoHeight=Lt(a,!0);break;case"auto-fit-width":this.autoFitWidth=Lt(a,!1);break;case"auto-fit-height":this.autoFitHeight=Lt(a,!1);break;case"color":this.color=qt(a,s.WHITE,e);break;case"enable-markup":this.enableMarkup=Lt(a,!1);break;case"font-asset":this.fontAsset=a??"";break;case"font-size":this.fontSize=Kt(a,32,e);break;case"max-font-size":this.maxFontSize=Kt(a,32,e);break;case"min-font-size":this.minFontSize=Kt(a,8,e);break;case"height":this.height=Kt(a,0,e);break;case"line-height":this.lineHeight=Kt(a,32,e);break;case"margin":this.margin=Vt(a,null,e);break;case"mask":this.mask=Lt(a,!1);break;case"opacity":this.opacity=Kt(a,1,e);break;case"pivot":this.pivot=Jt(a,new o(.5,.5),e);break;case"pixels-per-unit":this.pixelsPerUnit=Kt(a,null,e);break;case"sprite-asset":this.spriteAsset=a??"";break;case"sprite-frame":this.spriteFrame=Kt(a,0,e);break;case"text":this.text=a??"";break;case"texture-asset":this.textureAsset=a??"";break;case"type":this.type=Wt(a,["group","image","text"],"group",e);break;case"use-input":this.useInput=Lt(a,!1);break;case"width":this.width=Kt(a,0,e);break;case"wrap-lines":this.wrapLines=Lt(a,!1)}}}customElements.define("pc-element",ka);class wa extends da{_minWidth=0;_minHeight=0;_maxWidth=null;_maxHeight=null;_fitWidthProportion=0;_fitHeightProportion=0;_excludeFromLayout=!1;constructor(){super("layoutchild")}getInitialComponentData(){return{minWidth:this._minWidth,minHeight:this._minHeight,maxWidth:this._maxWidth,maxHeight:this._maxHeight,fitWidthProportion:this._fitWidthProportion,fitHeightProportion:this._fitHeightProportion,excludeFromLayout:this._excludeFromLayout}}get component(){return super.component}set minWidth(e){this._minWidth=e,this.component&&(this.component.minWidth=e)}get minWidth(){return this._minWidth}set minHeight(e){this._minHeight=e,this.component&&(this.component.minHeight=e)}get minHeight(){return this._minHeight}set maxWidth(e){this._maxWidth=e,this.component&&(this.component.maxWidth=e)}get maxWidth(){return this._maxWidth}set maxHeight(e){this._maxHeight=e,this.component&&(this.component.maxHeight=e)}get maxHeight(){return this._maxHeight}set fitWidthProportion(e){this._fitWidthProportion=e,this.component&&(this.component.fitWidthProportion=e)}get fitWidthProportion(){return this._fitWidthProportion}set fitHeightProportion(e){this._fitHeightProportion=e,this.component&&(this.component.fitHeightProportion=e)}get fitHeightProportion(){return this._fitHeightProportion}set excludeFromLayout(e){this._excludeFromLayout=e,this.component&&(this.component.excludeFromLayout=e)}get excludeFromLayout(){return this._excludeFromLayout}static get observedAttributes(){return[...super.observedAttributes,"min-width","min-height","max-width","max-height","fit-width-proportion","fit-height-proportion","exclude-from-layout"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"min-width":this.minWidth=Kt(a,0,e);break;case"min-height":this.minHeight=Kt(a,0,e);break;case"max-width":this.maxWidth=Kt(a,null,e);break;case"max-height":this.maxHeight=Kt(a,null,e);break;case"fit-width-proportion":this.fitWidthProportion=Kt(a,0,e);break;case"fit-height-proportion":this.fitHeightProportion=Kt(a,0,e);break;case"exclude-from-layout":this.excludeFromLayout=Lt(a,!1)}}}customElements.define("pc-layoutchild",wa);const Ma=new Map([["horizontal",We],["vertical",$e]]),xa=new Map([["none",Ke],["stretch",Qe],["shrink",Ie],["both",Je]]);class Sa extends da{_orientation="horizontal";_reverseX=!1;_reverseY=!1;_alignment=new o(0,1);_padding=new i(0,0,0,0);_spacing=new o(0,0);_widthFitting="none";_heightFitting="none";_wrap=!1;constructor(){super("layoutgroup")}getInitialComponentData(){return{orientation:Ma.get(this._orientation),reverseX:this._reverseX,reverseY:this._reverseY,alignment:this._alignment,padding:this._padding,spacing:this._spacing,widthFitting:xa.get(this._widthFitting),heightFitting:xa.get(this._heightFitting),wrap:this._wrap}}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=Ma.get(e)??We)}get orientation(){return this._orientation}set reverseX(e){this._reverseX=e,this.component&&(this.component.reverseX=e)}get reverseX(){return this._reverseX}set reverseY(e){this._reverseY=e,this.component&&(this.component.reverseY=e)}get reverseY(){return this._reverseY}set alignment(e){this._alignment=e,this.component&&(this.component.alignment=e)}get alignment(){return this._alignment}set padding(e){this._padding=e,this.component&&(this.component.padding=e)}get padding(){return this._padding}set spacing(e){this._spacing=e,this.component&&(this.component.spacing=e)}get spacing(){return this._spacing}set widthFitting(e){this._widthFitting=e,this.component&&(this.component.widthFitting=xa.get(e)??Ke)}get widthFitting(){return this._widthFitting}set heightFitting(e){this._heightFitting=e,this.component&&(this.component.heightFitting=xa.get(e)??Ke)}get heightFitting(){return this._heightFitting}set wrap(e){this._wrap=e,this.component&&(this.component.wrap=e)}get wrap(){return this._wrap}static get observedAttributes(){return[...super.observedAttributes,"orientation","reverse-x","reverse-y","alignment","padding","spacing","width-fitting","height-fitting","wrap"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"orientation":this.orientation=Wt(a,Ma,"horizontal",e);break;case"reverse-x":this.reverseX=Lt(a,!1);break;case"reverse-y":this.reverseY=Lt(a,!1);break;case"alignment":this.alignment=Jt(a,new o(0,1),e);break;case"padding":this.padding=Vt(a,i.ZERO,e);break;case"spacing":this.spacing=Jt(a,o.ZERO,e);break;case"width-fitting":this.widthFitting=Wt(a,xa,"none",e);break;case"height-fitting":this.heightFitting=Wt(a,xa,"none",e);break;case"wrap":this.wrap=Lt(a,!1)}}}customElements.define("pc-layoutgroup",Sa);const Ca=new Map([["pcf1-16f",Ye],["pcf1-32f",Ne],["pcf3-16f",Xe],["pcf3-32f",Ve],["pcf5-16f",Ze],["pcf5-32f",et],["vsm-16f",tt],["vsm-32f",at],["pcss-32f",st]]);class Aa extends da{_castShadows=!1;_color=new s(1,1,1);_innerConeAngle=40;_intensity=1;_normalOffsetBias=.05;_outerConeAngle=45;_range=10;_shadowBias=.2;_shadowDistance=16;_shadowIntensity=1;_shadowResolution=1024;_shadowType="pcf3-32f";_type="directional";_vsmBias=.01;_vsmBlurSize=11;_penumbraSize=1;_penumbraFalloff=1;_shadowSamples=16;_shadowBlockerSamples=16;constructor(){super("light")}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,penumbraFalloff:this._penumbraFalloff,penumbraSize:this._penumbraSize,range:this._range,shadowBias:this._shadowBias,shadowBlockerSamples:this._shadowBlockerSamples,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowSamples:this._shadowSamples,shadowType:Ca.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){this._shadowType=e,this.component&&(this.component.shadowType=Ca.get(e)??Ve)}get shadowType(){return this._shadowType}set type(e){this._type=e,this.component&&(this.component.type=e)}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}set penumbraSize(e){this._penumbraSize=e,this.component&&(this.component.penumbraSize=e)}get penumbraSize(){return this._penumbraSize}set penumbraFalloff(e){this._penumbraFalloff=e,this.component&&(this.component.penumbraFalloff=e)}get penumbraFalloff(){return this._penumbraFalloff}set shadowSamples(e){this._shadowSamples=e,this.component&&(this.component.shadowSamples=e)}get shadowSamples(){return this._shadowSamples}set shadowBlockerSamples(e){this._shadowBlockerSamples=e,this.component&&(this.component.shadowBlockerSamples=e)}get shadowBlockerSamples(){return this._shadowBlockerSamples}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","penumbra-falloff","penumbra-size","range","shadow-bias","shadow-blocker-samples","shadow-distance","shadow-intensity","shadow-resolution","shadow-samples","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"color":this.color=qt(a,s.WHITE,e);break;case"cast-shadows":this.castShadows=Lt(a,!1);break;case"inner-cone-angle":this.innerConeAngle=Kt(a,40,e);break;case"intensity":this.intensity=Kt(a,1,e);break;case"normal-offset-bias":this.normalOffsetBias=Kt(a,.05,e);break;case"outer-cone-angle":this.outerConeAngle=Kt(a,45,e);break;case"penumbra-falloff":this.penumbraFalloff=Kt(a,1,e);break;case"penumbra-size":this.penumbraSize=Kt(a,1,e);break;case"range":this.range=Kt(a,10,e);break;case"shadow-bias":this.shadowBias=Kt(a,.2,e);break;case"shadow-distance":this.shadowDistance=Kt(a,16,e);break;case"shadow-blocker-samples":this.shadowBlockerSamples=Kt(a,16,e);break;case"shadow-resolution":this.shadowResolution=Kt(a,1024,e);break;case"shadow-intensity":this.shadowIntensity=Kt(a,1,e);break;case"shadow-samples":this.shadowSamples=Kt(a,16,e);break;case"shadow-type":this.shadowType=Wt(a,Ca,"pcf3-32f",e);break;case"type":this.type=Wt(a,["directional","omni","spot"],"directional",e);break;case"vsm-bias":this.vsmBias=Kt(a,.01,e);break;case"vsm-blur-size":this.vsmBlurSize=Kt(a,11,e)}}}customElements.define("pc-light",Aa);class Fa extends da{_asset="";constructor(){super("particlesystem")}getInitialComponentData(){const e=ba.get(this._asset);if(!e)return{};if(e.resource.colorMapAsset){const t=e.resource.colorMapAsset,a=ba.get(t)?.id;a&&(e.resource.colorMapAsset=a)}return e.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)Object.hasOwn(e,t)&&(this.component[t]=e[t])}async _loadAsset(){const e=await(this.closestApp?.ready()),t=e?.app,a=ba.get(this._asset);a&&(a.loaded?this.applyConfig(a.resource):(a.once("load",()=>{this.applyConfig(a.resource)}),t.assets.load(a)))}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",Fa);const Ea=new Map([["none",nt],["normal",ct],["additive",lt],["additive-alpha",pt],["premultiplied",bt],["multiplicative",dt],["multiplicative-2x",ut],["screen",mt],["min",gt],["max",ft],["subtractive",_t]]),ja=new Map([["none",vt],["back",ot],["front",yt],["front-and-back",kt]]),Ra=new Map([["none",wt],["schlick",rt]]),Oa=new Map([["none",Mt],["ao",ht],["gloss-dependent",xt]]),za=["none","bayer8","bluenoise","ignnoise"],Ta=["r","g","b","a","rgb"],Ha=["r","g","b","a"],Pa=["gloss","gloss-invert","gloss-map"],Ga=["roughness","roughness-map"];class Ua extends HTMLElement{_alphaTest=0;_alphaToCoverage=!1;_aoIntensity=1;_aoMap="";_aoMapChannel="g";_aoMapOffset=new o(0,0);_aoMapRotation=0;_aoMapTiling=new o(1,1);_aoMapUv=0;_blendType="none";_bumpiness=1;_cull="back";_depthBias=0;_depthTest=!0;_depthWrite=!0;_diffuse=new s(1,1,1);_diffuseMap="";_diffuseMapChannel="rgb";_diffuseMapOffset=new o(0,0);_diffuseMapRotation=0;_diffuseMapTiling=new o(1,1);_diffuseMapUv=0;_emissive=new s(0,0,0);_emissiveIntensity=1;_emissiveMap="";_emissiveMapChannel="rgb";_emissiveMapOffset=new o(0,0);_emissiveMapRotation=0;_emissiveMapTiling=new o(1,1);_emissiveMapUv=0;_enableGGXSpecular=!1;_fresnelModel="schlick";_gloss=.25;_glossInvert=!1;_glossMap="";_glossMapChannel="g";_glossMapOffset=new o(0,0);_glossMapRotation=0;_glossMapTiling=new o(1,1);_glossMapUv=0;_heightMap="";_heightMapChannel="g";_heightMapFactor=1;_heightMapOffset=new o(0,0);_heightMapRotation=0;_heightMapTiling=new o(1,1);_heightMapUv=0;_metalness=0;_metalnessMap="";_metalnessMapChannel="g";_metalnessMapOffset=new o(0,0);_metalnessMapRotation=0;_metalnessMapTiling=new o(1,1);_metalnessMapUv=0;_normalMap="";_normalMapOffset=new o(0,0);_normalMapRotation=0;_normalMapTiling=new o(1,1);_normalMapUv=0;_occludeDirect=!1;_occludeSpecular="ao";_opacity=1;_opacityDither="none";_opacityFadesSpecular=!0;_opacityMap="";_opacityMapChannel="a";_opacityMapOffset=new o(0,0);_opacityMapRotation=0;_opacityMapTiling=new o(1,1);_opacityMapUv=0;_slopeDepthBias=0;_specular=new s(0,0,0);_specularityFactor=1;_twoSidedLighting=!1;_useFog=!0;_useLighting=!0;_useMetalness=!0;_useMetalnessSpecularColor=!1;_useSkybox=!0;_useTonemap=!0;_mapHandles=new Map;_updateScheduled=!1;_glossConflictWarned=!1;material=null;async connectedCallback(){const e=this.parentElement?.closest("pc-app")??null;if(e&&this.parentElement===e){if(await e.ready(),this.isConnected&&this.parentElement===e&&!this.material){if(!e.app)return;this._createMaterial()}}else console.warn(`pc-material '${this.id}' must be a direct child of pc-app - material not created`)}_createMaterial(){const e=new it;this.material=e,e.alphaTest=this._alphaTest,e.alphaToCoverage=this._alphaToCoverage,e.aoIntensity=this._aoIntensity,e.aoMapChannel=this._aoMapChannel,e.aoMapOffset=this._aoMapOffset,e.aoMapRotation=this._aoMapRotation,e.aoMapTiling=this._aoMapTiling,e.aoMapUv=this._aoMapUv,e.blendType=Ea.get(this._blendType)??nt,e.bumpiness=this._bumpiness,e.cull=ja.get(this._cull)??ot,e.depthBias=this._depthBias,e.depthTest=this._depthTest,e.depthWrite=this._depthWrite,e.diffuse=this._diffuse,e.diffuseMapChannel=this._diffuseMapChannel,e.diffuseMapOffset=this._diffuseMapOffset,e.diffuseMapRotation=this._diffuseMapRotation,e.diffuseMapTiling=this._diffuseMapTiling,e.diffuseMapUv=this._diffuseMapUv,e.emissive=this._emissive,e.emissiveIntensity=this._emissiveIntensity,e.emissiveMapChannel=this._emissiveMapChannel,e.emissiveMapOffset=this._emissiveMapOffset,e.emissiveMapRotation=this._emissiveMapRotation,e.emissiveMapTiling=this._emissiveMapTiling,e.emissiveMapUv=this._emissiveMapUv,e.enableGGXSpecular=this._enableGGXSpecular,e.fresnelModel=Ra.get(this._fresnelModel)??rt,e.gloss=this._gloss,e.glossInvert=this._glossInvert,e.glossMapChannel=this._glossMapChannel,e.glossMapOffset=this._glossMapOffset,e.glossMapRotation=this._glossMapRotation,e.glossMapTiling=this._glossMapTiling,e.glossMapUv=this._glossMapUv,e.heightMapChannel=this._heightMapChannel,e.heightMapFactor=this._heightMapFactor,e.heightMapOffset=this._heightMapOffset,e.heightMapRotation=this._heightMapRotation,e.heightMapTiling=this._heightMapTiling,e.heightMapUv=this._heightMapUv,e.metalness=this._metalness,e.metalnessMapChannel=this._metalnessMapChannel,e.metalnessMapOffset=this._metalnessMapOffset,e.metalnessMapRotation=this._metalnessMapRotation,e.metalnessMapTiling=this._metalnessMapTiling,e.metalnessMapUv=this._metalnessMapUv,e.normalMapOffset=this._normalMapOffset,e.normalMapRotation=this._normalMapRotation,e.normalMapTiling=this._normalMapTiling,e.normalMapUv=this._normalMapUv,e.occludeDirect=this._occludeDirect,e.occludeSpecular=Oa.get(this._occludeSpecular)??ht,e.opacity=this._opacity,e.opacityDither=this._opacityDither,e.opacityFadesSpecular=this._opacityFadesSpecular,e.opacityMapChannel=this._opacityMapChannel,e.opacityMapOffset=this._opacityMapOffset,e.opacityMapRotation=this._opacityMapRotation,e.opacityMapTiling=this._opacityMapTiling,e.opacityMapUv=this._opacityMapUv,e.slopeDepthBias=this._slopeDepthBias,e.specular=this._specular,e.specularityFactor=this._specularityFactor,e.twoSidedLighting=this._twoSidedLighting,e.useFog=this._useFog,e.useLighting=this._useLighting,e.useMetalness=this._useMetalness,e.useMetalnessSpecularColor=this._useMetalnessSpecularColor,e.useSkybox=this._useSkybox,e.useTonemap=this._useTonemap,this.aoMap=this._aoMap,this.diffuseMap=this._diffuseMap,this.emissiveMap=this._emissiveMap,this.glossMap=this._glossMap,this.heightMap=this._heightMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.opacityMap=this._opacityMap,e.update()}disconnectedCallback(){for(const e of this._mapHandles.values())e.off();this._mapHandles.clear(),this.material&&(this.material.destroy(),this.material=null)}_scheduleUpdate(){this._updateScheduled||(this._updateScheduled=!0,queueMicrotask(()=>{this._updateScheduled=!1,this.material?.update()}))}_warnGlossConflict(){const e=e=>`'${e.join("', '")}'`,t=Ga.filter(e=>this.hasAttribute(e)),a=Pa.filter(e=>this.hasAttribute(e));0!==t.length&&0!==a.length?this._glossConflictWarned||(this._glossConflictWarned=!0,console.warn(`pc-material '${this.id}' sets both ${e(t)} and ${e(a)} - the roughness-* attributes invert gloss, so the two families contradict each other. Use one or the other.`)):this._glossConflictWarned=!1}_setMap(e,t){if(this._mapHandles.get(t)?.off(),this._mapHandles.delete(t),!this.material)return;if(!e)return this.material[t]=null,void this._scheduleUpdate();const a=ba.get(e);a&&(a.loaded?this._applyMap(t,a.resource):this._mapHandles.set(t,a.once("load",()=>{this._mapHandles.delete(t),this._applyMap(t,a.resource)})))}_applyMap(e,t){this.material&&(this.material[e]=t,this._scheduleUpdate())}set alphaTest(e){this._alphaTest=e,this.material&&(this.material.alphaTest=e,this._scheduleUpdate())}get alphaTest(){return this._alphaTest}set alphaToCoverage(e){this._alphaToCoverage=e,this.material&&(this.material.alphaToCoverage=e,this._scheduleUpdate())}get alphaToCoverage(){return this._alphaToCoverage}set aoIntensity(e){this._aoIntensity=e,this.material&&(this.material.aoIntensity=e,this._scheduleUpdate())}get aoIntensity(){return this._aoIntensity}set aoMap(e){this._aoMap=e,this._setMap(e,"aoMap")}get aoMap(){return this._aoMap}set aoMapChannel(e){this._aoMapChannel=e,this.material&&(this.material.aoMapChannel=e,this._scheduleUpdate())}get aoMapChannel(){return this._aoMapChannel}set aoMapOffset(e){this._aoMapOffset=e,this.material&&(this.material.aoMapOffset=e,this._scheduleUpdate())}get aoMapOffset(){return this._aoMapOffset}set aoMapRotation(e){this._aoMapRotation=e,this.material&&(this.material.aoMapRotation=e,this._scheduleUpdate())}get aoMapRotation(){return this._aoMapRotation}set aoMapTiling(e){this._aoMapTiling=e,this.material&&(this.material.aoMapTiling=e,this._scheduleUpdate())}get aoMapTiling(){return this._aoMapTiling}set aoMapUv(e){this._aoMapUv=e,this.material&&(this.material.aoMapUv=e,this._scheduleUpdate())}get aoMapUv(){return this._aoMapUv}set blendType(e){this._blendType=e,this.material&&(this.material.blendType=Ea.get(e)??nt,this._scheduleUpdate())}get blendType(){return this._blendType}set bumpiness(e){this._bumpiness=e,this.material&&(this.material.bumpiness=e,this._scheduleUpdate())}get bumpiness(){return this._bumpiness}set cull(e){this._cull=e,this.material&&(this.material.cull=ja.get(e)??ot,this._scheduleUpdate())}get cull(){return this._cull}set depthBias(e){this._depthBias=e,this.material&&(this.material.depthBias=e,this._scheduleUpdate())}get depthBias(){return this._depthBias}set depthTest(e){this._depthTest=e,this.material&&(this.material.depthTest=e,this._scheduleUpdate())}get depthTest(){return this._depthTest}set depthWrite(e){this._depthWrite=e,this.material&&(this.material.depthWrite=e,this._scheduleUpdate())}get depthWrite(){return this._depthWrite}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e,this._scheduleUpdate())}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this._setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set diffuseMapChannel(e){this._diffuseMapChannel=e,this.material&&(this.material.diffuseMapChannel=e,this._scheduleUpdate())}get diffuseMapChannel(){return this._diffuseMapChannel}set diffuseMapOffset(e){this._diffuseMapOffset=e,this.material&&(this.material.diffuseMapOffset=e,this._scheduleUpdate())}get diffuseMapOffset(){return this._diffuseMapOffset}set diffuseMapRotation(e){this._diffuseMapRotation=e,this.material&&(this.material.diffuseMapRotation=e,this._scheduleUpdate())}get diffuseMapRotation(){return this._diffuseMapRotation}set diffuseMapTiling(e){this._diffuseMapTiling=e,this.material&&(this.material.diffuseMapTiling=e,this._scheduleUpdate())}get diffuseMapTiling(){return this._diffuseMapTiling}set diffuseMapUv(e){this._diffuseMapUv=e,this.material&&(this.material.diffuseMapUv=e,this._scheduleUpdate())}get diffuseMapUv(){return this._diffuseMapUv}set emissive(e){this._emissive=e,this.material&&(this.material.emissive=e,this._scheduleUpdate())}get emissive(){return this._emissive}set emissiveIntensity(e){this._emissiveIntensity=e,this.material&&(this.material.emissiveIntensity=e,this._scheduleUpdate())}get emissiveIntensity(){return this._emissiveIntensity}set emissiveMap(e){this._emissiveMap=e,this._setMap(e,"emissiveMap")}get emissiveMap(){return this._emissiveMap}set emissiveMapChannel(e){this._emissiveMapChannel=e,this.material&&(this.material.emissiveMapChannel=e,this._scheduleUpdate())}get emissiveMapChannel(){return this._emissiveMapChannel}set emissiveMapOffset(e){this._emissiveMapOffset=e,this.material&&(this.material.emissiveMapOffset=e,this._scheduleUpdate())}get emissiveMapOffset(){return this._emissiveMapOffset}set emissiveMapRotation(e){this._emissiveMapRotation=e,this.material&&(this.material.emissiveMapRotation=e,this._scheduleUpdate())}get emissiveMapRotation(){return this._emissiveMapRotation}set emissiveMapTiling(e){this._emissiveMapTiling=e,this.material&&(this.material.emissiveMapTiling=e,this._scheduleUpdate())}get emissiveMapTiling(){return this._emissiveMapTiling}set emissiveMapUv(e){this._emissiveMapUv=e,this.material&&(this.material.emissiveMapUv=e,this._scheduleUpdate())}get emissiveMapUv(){return this._emissiveMapUv}set enableGGXSpecular(e){this._enableGGXSpecular=e,this.material&&(this.material.enableGGXSpecular=e,this._scheduleUpdate())}get enableGGXSpecular(){return this._enableGGXSpecular}set fresnelModel(e){this._fresnelModel=e,this.material&&(this.material.fresnelModel=Ra.get(e)??rt,this._scheduleUpdate())}get fresnelModel(){return this._fresnelModel}set gloss(e){this._gloss=e,this.material&&(this.material.gloss=e,this._scheduleUpdate())}get gloss(){return this._gloss}set glossInvert(e){this._glossInvert=e,this.material&&(this.material.glossInvert=e,this._scheduleUpdate())}get glossInvert(){return this._glossInvert}set glossMap(e){this._glossMap=e,this._setMap(e,"glossMap")}get glossMap(){return this._glossMap}set glossMapChannel(e){this._glossMapChannel=e,this.material&&(this.material.glossMapChannel=e,this._scheduleUpdate())}get glossMapChannel(){return this._glossMapChannel}set glossMapOffset(e){this._glossMapOffset=e,this.material&&(this.material.glossMapOffset=e,this._scheduleUpdate())}get glossMapOffset(){return this._glossMapOffset}set glossMapRotation(e){this._glossMapRotation=e,this.material&&(this.material.glossMapRotation=e,this._scheduleUpdate())}get glossMapRotation(){return this._glossMapRotation}set glossMapTiling(e){this._glossMapTiling=e,this.material&&(this.material.glossMapTiling=e,this._scheduleUpdate())}get glossMapTiling(){return this._glossMapTiling}set glossMapUv(e){this._glossMapUv=e,this.material&&(this.material.glossMapUv=e,this._scheduleUpdate())}get glossMapUv(){return this._glossMapUv}set heightMap(e){this._heightMap=e,this._setMap(e,"heightMap")}get heightMap(){return this._heightMap}set heightMapChannel(e){this._heightMapChannel=e,this.material&&(this.material.heightMapChannel=e,this._scheduleUpdate())}get heightMapChannel(){return this._heightMapChannel}set heightMapFactor(e){this._heightMapFactor=e,this.material&&(this.material.heightMapFactor=e,this._scheduleUpdate())}get heightMapFactor(){return this._heightMapFactor}set heightMapOffset(e){this._heightMapOffset=e,this.material&&(this.material.heightMapOffset=e,this._scheduleUpdate())}get heightMapOffset(){return this._heightMapOffset}set heightMapRotation(e){this._heightMapRotation=e,this.material&&(this.material.heightMapRotation=e,this._scheduleUpdate())}get heightMapRotation(){return this._heightMapRotation}set heightMapTiling(e){this._heightMapTiling=e,this.material&&(this.material.heightMapTiling=e,this._scheduleUpdate())}get heightMapTiling(){return this._heightMapTiling}set heightMapUv(e){this._heightMapUv=e,this.material&&(this.material.heightMapUv=e,this._scheduleUpdate())}get heightMapUv(){return this._heightMapUv}set metalness(e){this._metalness=e,this.material&&(this.material.metalness=e,this._scheduleUpdate())}get metalness(){return this._metalness}set metalnessMap(e){this._metalnessMap=e,this._setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set metalnessMapChannel(e){this._metalnessMapChannel=e,this.material&&(this.material.metalnessMapChannel=e,this._scheduleUpdate())}get metalnessMapChannel(){return this._metalnessMapChannel}set metalnessMapOffset(e){this._metalnessMapOffset=e,this.material&&(this.material.metalnessMapOffset=e,this._scheduleUpdate())}get metalnessMapOffset(){return this._metalnessMapOffset}set metalnessMapRotation(e){this._metalnessMapRotation=e,this.material&&(this.material.metalnessMapRotation=e,this._scheduleUpdate())}get metalnessMapRotation(){return this._metalnessMapRotation}set metalnessMapTiling(e){this._metalnessMapTiling=e,this.material&&(this.material.metalnessMapTiling=e,this._scheduleUpdate())}get metalnessMapTiling(){return this._metalnessMapTiling}set metalnessMapUv(e){this._metalnessMapUv=e,this.material&&(this.material.metalnessMapUv=e,this._scheduleUpdate())}get metalnessMapUv(){return this._metalnessMapUv}set normalMap(e){this._normalMap=e,this._setMap(e,"normalMap")}get normalMap(){return this._normalMap}set normalMapOffset(e){this._normalMapOffset=e,this.material&&(this.material.normalMapOffset=e,this._scheduleUpdate())}get normalMapOffset(){return this._normalMapOffset}set normalMapRotation(e){this._normalMapRotation=e,this.material&&(this.material.normalMapRotation=e,this._scheduleUpdate())}get normalMapRotation(){return this._normalMapRotation}set normalMapTiling(e){this._normalMapTiling=e,this.material&&(this.material.normalMapTiling=e,this._scheduleUpdate())}get normalMapTiling(){return this._normalMapTiling}set normalMapUv(e){this._normalMapUv=e,this.material&&(this.material.normalMapUv=e,this._scheduleUpdate())}get normalMapUv(){return this._normalMapUv}set occludeDirect(e){this._occludeDirect=e,this.material&&(this.material.occludeDirect=e,this._scheduleUpdate())}get occludeDirect(){return this._occludeDirect}set occludeSpecular(e){this._occludeSpecular=e,this.material&&(this.material.occludeSpecular=Oa.get(e)??ht,this._scheduleUpdate())}get occludeSpecular(){return this._occludeSpecular}set opacity(e){this._opacity=e,this.material&&(this.material.opacity=e,this._scheduleUpdate())}get opacity(){return this._opacity}set opacityDither(e){this._opacityDither=e,this.material&&(this.material.opacityDither=e,this._scheduleUpdate())}get opacityDither(){return this._opacityDither}set opacityFadesSpecular(e){this._opacityFadesSpecular=e,this.material&&(this.material.opacityFadesSpecular=e,this._scheduleUpdate())}get opacityFadesSpecular(){return this._opacityFadesSpecular}set opacityMap(e){this._opacityMap=e,this._setMap(e,"opacityMap")}get opacityMap(){return this._opacityMap}set opacityMapChannel(e){this._opacityMapChannel=e,this.material&&(this.material.opacityMapChannel=e,this._scheduleUpdate())}get opacityMapChannel(){return this._opacityMapChannel}set opacityMapOffset(e){this._opacityMapOffset=e,this.material&&(this.material.opacityMapOffset=e,this._scheduleUpdate())}get opacityMapOffset(){return this._opacityMapOffset}set opacityMapRotation(e){this._opacityMapRotation=e,this.material&&(this.material.opacityMapRotation=e,this._scheduleUpdate())}get opacityMapRotation(){return this._opacityMapRotation}set opacityMapTiling(e){this._opacityMapTiling=e,this.material&&(this.material.opacityMapTiling=e,this._scheduleUpdate())}get opacityMapTiling(){return this._opacityMapTiling}set opacityMapUv(e){this._opacityMapUv=e,this.material&&(this.material.opacityMapUv=e,this._scheduleUpdate())}get opacityMapUv(){return this._opacityMapUv}set roughness(e){this.gloss=e,this.glossInvert=!0}get roughness(){return this._gloss}set roughnessMap(e){this.glossMap=e,this.glossInvert=!0}get roughnessMap(){return this._glossMap}set slopeDepthBias(e){this._slopeDepthBias=e,this.material&&(this.material.slopeDepthBias=e,this._scheduleUpdate())}get slopeDepthBias(){return this._slopeDepthBias}set specular(e){this._specular=e,this.material&&(this.material.specular=e,this._scheduleUpdate())}get specular(){return this._specular}set specularityFactor(e){this._specularityFactor=e,this.material&&(this.material.specularityFactor=e,this._scheduleUpdate())}get specularityFactor(){return this._specularityFactor}set twoSidedLighting(e){this._twoSidedLighting=e,this.material&&(this.material.twoSidedLighting=e,this._scheduleUpdate())}get twoSidedLighting(){return this._twoSidedLighting}set useFog(e){this._useFog=e,this.material&&(this.material.useFog=e,this._scheduleUpdate())}get useFog(){return this._useFog}set useLighting(e){this._useLighting=e,this.material&&(this.material.useLighting=e,this._scheduleUpdate())}get useLighting(){return this._useLighting}set useMetalness(e){this._useMetalness=e,this.material&&(this.material.useMetalness=e,this._scheduleUpdate())}get useMetalness(){return this._useMetalness}set useMetalnessSpecularColor(e){this._useMetalnessSpecularColor=e,this.material&&(this.material.useMetalnessSpecularColor=e,this._scheduleUpdate())}get useMetalnessSpecularColor(){return this._useMetalnessSpecularColor}set useSkybox(e){this._useSkybox=e,this.material&&(this.material.useSkybox=e,this._scheduleUpdate())}get useSkybox(){return this._useSkybox}set useTonemap(e){this._useTonemap=e,this.material&&(this.material.useTonemap=e,this._scheduleUpdate())}get useTonemap(){return this._useTonemap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return t?.material}static get observedAttributes(){return["alpha-test","alpha-to-coverage","ao-intensity","ao-map","ao-map-channel","ao-map-offset","ao-map-rotation","ao-map-tiling","ao-map-uv","blend-type","bumpiness","cull","depth-bias","depth-test","depth-write","diffuse","diffuse-map","diffuse-map-channel","diffuse-map-offset","diffuse-map-rotation","diffuse-map-tiling","diffuse-map-uv","emissive","emissive-intensity","emissive-map","emissive-map-channel","emissive-map-offset","emissive-map-rotation","emissive-map-tiling","emissive-map-uv","enable-ggx-specular","fresnel-model","gloss","gloss-invert","gloss-map","gloss-map-channel","gloss-map-offset","gloss-map-rotation","gloss-map-tiling","gloss-map-uv","height-map","height-map-channel","height-map-factor","height-map-offset","height-map-rotation","height-map-tiling","height-map-uv","metalness","metalness-map","metalness-map-channel","metalness-map-offset","metalness-map-rotation","metalness-map-tiling","metalness-map-uv","normal-map","normal-map-offset","normal-map-rotation","normal-map-tiling","normal-map-uv","occlude-direct","occlude-specular","opacity","opacity-dither","opacity-fades-specular","opacity-map","opacity-map-channel","opacity-map-offset","opacity-map-rotation","opacity-map-tiling","opacity-map-uv","roughness","roughness-map","slope-depth-bias","specular","specularity-factor","two-sided-lighting","use-fog","use-lighting","use-metalness","use-metalness-specular-color","use-skybox","use-tonemap"]}attributeChangedCallback(e,t,a){switch(e){case"alpha-test":this.alphaTest=Kt(a,0,e);break;case"alpha-to-coverage":this.alphaToCoverage=Lt(a,!1);break;case"ao-intensity":this.aoIntensity=Kt(a,1,e);break;case"ao-map":this.aoMap=a??"";break;case"ao-map-channel":this.aoMapChannel=Wt(a,Ha,"g",e);break;case"ao-map-offset":this.aoMapOffset=Jt(a,new o(0,0),e);break;case"ao-map-rotation":this.aoMapRotation=Kt(a,0,e);break;case"ao-map-tiling":this.aoMapTiling=Jt(a,new o(1,1),e);break;case"ao-map-uv":this.aoMapUv=Kt(a,0,e);break;case"blend-type":this.blendType=Wt(a,Ea,"none",e);break;case"bumpiness":this.bumpiness=Kt(a,1,e);break;case"cull":this.cull=Wt(a,ja,"back",e);break;case"depth-bias":this.depthBias=Kt(a,0,e);break;case"depth-test":this.depthTest=Lt(a,!0);break;case"depth-write":this.depthWrite=Lt(a,!0);break;case"diffuse":this.diffuse=qt(a,new s(1,1,1),e);break;case"diffuse-map":this.diffuseMap=a??"";break;case"diffuse-map-channel":this.diffuseMapChannel=Wt(a,Ta,"rgb",e);break;case"diffuse-map-offset":this.diffuseMapOffset=Jt(a,new o(0,0),e);break;case"diffuse-map-rotation":this.diffuseMapRotation=Kt(a,0,e);break;case"diffuse-map-tiling":this.diffuseMapTiling=Jt(a,new o(1,1),e);break;case"diffuse-map-uv":this.diffuseMapUv=Kt(a,0,e);break;case"emissive":this.emissive=qt(a,new s(0,0,0),e);break;case"emissive-intensity":this.emissiveIntensity=Kt(a,1,e);break;case"emissive-map":this.emissiveMap=a??"";break;case"emissive-map-channel":this.emissiveMapChannel=Wt(a,Ta,"rgb",e);break;case"emissive-map-offset":this.emissiveMapOffset=Jt(a,new o(0,0),e);break;case"emissive-map-rotation":this.emissiveMapRotation=Kt(a,0,e);break;case"emissive-map-tiling":this.emissiveMapTiling=Jt(a,new o(1,1),e);break;case"emissive-map-uv":this.emissiveMapUv=Kt(a,0,e);break;case"enable-ggx-specular":this.enableGGXSpecular=Lt(a,!1);break;case"fresnel-model":this.fresnelModel=Wt(a,Ra,"schlick",e);break;case"gloss":this.gloss=Kt(a,.25,e),this._warnGlossConflict();break;case"gloss-invert":this.glossInvert=Lt(a,!1),this._warnGlossConflict();break;case"gloss-map":this.glossMap=a??"",this._warnGlossConflict();break;case"gloss-map-channel":this.glossMapChannel=Wt(a,Ha,"g",e);break;case"gloss-map-offset":this.glossMapOffset=Jt(a,new o(0,0),e);break;case"gloss-map-rotation":this.glossMapRotation=Kt(a,0,e);break;case"gloss-map-tiling":this.glossMapTiling=Jt(a,new o(1,1),e);break;case"gloss-map-uv":this.glossMapUv=Kt(a,0,e);break;case"height-map":this.heightMap=a??"";break;case"height-map-channel":this.heightMapChannel=Wt(a,Ha,"g",e);break;case"height-map-factor":this.heightMapFactor=Kt(a,1,e);break;case"height-map-offset":this.heightMapOffset=Jt(a,new o(0,0),e);break;case"height-map-rotation":this.heightMapRotation=Kt(a,0,e);break;case"height-map-tiling":this.heightMapTiling=Jt(a,new o(1,1),e);break;case"height-map-uv":this.heightMapUv=Kt(a,0,e);break;case"metalness":this.metalness=Kt(a,0,e);break;case"metalness-map":this.metalnessMap=a??"";break;case"metalness-map-channel":this.metalnessMapChannel=Wt(a,Ha,"g",e);break;case"metalness-map-offset":this.metalnessMapOffset=Jt(a,new o(0,0),e);break;case"metalness-map-rotation":this.metalnessMapRotation=Kt(a,0,e);break;case"metalness-map-tiling":this.metalnessMapTiling=Jt(a,new o(1,1),e);break;case"metalness-map-uv":this.metalnessMapUv=Kt(a,0,e);break;case"normal-map":this.normalMap=a??"";break;case"normal-map-offset":this.normalMapOffset=Jt(a,new o(0,0),e);break;case"normal-map-rotation":this.normalMapRotation=Kt(a,0,e);break;case"normal-map-tiling":this.normalMapTiling=Jt(a,new o(1,1),e);break;case"normal-map-uv":this.normalMapUv=Kt(a,0,e);break;case"occlude-direct":this.occludeDirect=Lt(a,!1);break;case"occlude-specular":this.occludeSpecular=Wt(a,Oa,"ao",e);break;case"opacity":this.opacity=Kt(a,1,e);break;case"opacity-dither":this.opacityDither=Wt(a,za,"none",e);break;case"opacity-fades-specular":this.opacityFadesSpecular=Lt(a,!0);break;case"opacity-map":this.opacityMap=a??"";break;case"opacity-map-channel":this.opacityMapChannel=Wt(a,Ha,"a",e);break;case"opacity-map-offset":this.opacityMapOffset=Jt(a,new o(0,0),e);break;case"opacity-map-rotation":this.opacityMapRotation=Kt(a,0,e);break;case"opacity-map-tiling":this.opacityMapTiling=Jt(a,new o(1,1),e);break;case"opacity-map-uv":this.opacityMapUv=Kt(a,0,e);break;case"roughness":this.gloss=Kt(a,.25,e),this.glossInvert=null!==a,this._warnGlossConflict();break;case"roughness-map":this.glossMap=a??"",this.glossInvert=null!==a,this._warnGlossConflict();break;case"slope-depth-bias":this.slopeDepthBias=Kt(a,0,e);break;case"specular":this.specular=qt(a,new s(0,0,0),e);break;case"specularity-factor":this.specularityFactor=Kt(a,1,e);break;case"two-sided-lighting":this.twoSidedLighting=Lt(a,!1);break;case"use-fog":this.useFog=Lt(a,!0);break;case"use-lighting":this.useLighting=Lt(a,!0);break;case"use-metalness":this.useMetalness=Lt(a,!0);break;case"use-metalness-specular-color":this.useMetalnessSpecularColor=Lt(a,!1);break;case"use-skybox":this.useSkybox=Lt(a,!0);break;case"use-tonemap":this.useTonemap=Lt(a,!0)}}}customElements.define("pc-material",Ua);class Da extends da{_castShadows=!0;_material="";_receiveShadows=!0;_type="box";constructor(){super("render")}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:Ua.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;const t=Ua.get(e);this.component&&t&&(this.component.material=t)}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=Lt(a,!0);break;case"material":this.material=a??"";break;case"receive-shadows":this.receiveShadows=Lt(a,!0);break;case"type":this.type=Wt(a,["box","capsule","cone","cylinder","plane","sphere"],"box",e)}}}customElements.define("pc-render",Da);class Ba extends da{_angularDamping=0;_angularFactor=new a(1,1,1);_friction=.5;_linearDamping=0;_linearFactor=new a(1,1,1);_mass=1;_restitution=0;_rollingFriction=0;_type="static";constructor(){super("rigidbody")}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,s){switch(super.attributeChangedCallback(e,t,s),e){case"angular-damping":this.angularDamping=Kt(s,0,e);break;case"angular-factor":this.angularFactor=$t(s,a.ONE,e);break;case"friction":this.friction=Kt(s,.5,e);break;case"linear-damping":this.linearDamping=Kt(s,0,e);break;case"linear-factor":this.linearFactor=$t(s,a.ONE,e);break;case"mass":this.mass=Kt(s,1,e);break;case"restitution":this.restitution=Kt(s,0,e);break;case"rolling-friction":this.rollingFriction=Kt(s,0,e);break;case"type":this.type=Wt(s,["static","dynamic","kinematic"],"static",e)}}}customElements.define("pc-rigidbody",Ba);const La=new Map([["none",St],["blend",Ct]]);class qa extends da{_screenSpace=!1;_resolution=new o(640,320);_referenceResolution=new o(640,320);_priority=0;_scaleMode="none";_scaleBlend=.5;constructor(){super("screen")}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:La.get(this._scaleMode)??St,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 scaleMode(e){this._scaleMode=e,this.component&&(this.component.scaleMode=La.get(e)??St)}get scaleMode(){return this._scaleMode}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"screen-space","resolution","reference-resolution","priority","scale-blend","scale-mode"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"priority":this.priority=Kt(a,0,e);break;case"reference-resolution":this.referenceResolution=Jt(a,new o(640,320),e);break;case"resolution":this.resolution=Jt(a,new o(640,320),e);break;case"scale-blend":this.scaleBlend=Kt(a,.5,e);break;case"scale-mode":this.scaleMode=Wt(a,La,"none",e);break;case"screen-space":this.screenSpace=Lt(a,!1)}}}customElements.define("pc-screen",qa);const Wa=new Map([["horizontal",We],["vertical",$e]]);class Ka extends da{_orientation="horizontal";_value=0;_handleSize=.5;_handle="";constructor(){super("scrollbar")}getInitialComponentData(){const e={orientation:Wa.get(this._orientation),value:this._value,handleSize:this._handleSize},t=Yt(this._handle);return t&&(e.handleEntity=t),e}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=Wa.get(e)??We)}get orientation(){return this._orientation}set value(e){this._value=e,this.component&&(this.component.value=e)}get value(){return this._value}set handleSize(e){this._handleSize=e,this.component&&(this.component.handleSize=e)}get handleSize(){return this._handleSize}set handle(e){this._handle=e;const t=Yt(e);this.component&&t&&(this.component.handleEntity=t)}get handle(){return this._handle}static get observedAttributes(){return[...super.observedAttributes,"orientation","value","handle-size","handle"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"orientation":this.orientation=Wt(a,Wa,"horizontal",e);break;case"value":this.value=Kt(a,0,e);break;case"handle-size":this.handleSize=Kt(a,.5,e);break;case"handle":this.handle=a??""}}}customElements.define("pc-scrollbar",Ka);const Qa=new Map([["clamp",jt],["bounce",At],["infinite",Rt]]),Ia=new Map([["always",Et],["when-required",Ft]]);class Ja extends da{_horizontal=!0;_vertical=!0;_scrollMode="bounce";_bounceAmount=.1;_friction=.05;_useMouseWheel=!0;_mouseWheelSensitivity=new o(1,1);_horizontalScrollbarVisibility="when-required";_verticalScrollbarVisibility="when-required";_viewport="";_content="";_horizontalScrollbar="";_verticalScrollbar="";constructor(){super("scrollview")}getInitialComponentData(){const e={horizontal:this._horizontal,vertical:this._vertical,scrollMode:Qa.get(this._scrollMode),bounceAmount:this._bounceAmount,friction:this._friction,useMouseWheel:this._useMouseWheel,mouseWheelSensitivity:this._mouseWheelSensitivity,horizontalScrollbarVisibility:Ia.get(this._horizontalScrollbarVisibility),verticalScrollbarVisibility:Ia.get(this._verticalScrollbarVisibility)},t=Yt(this._viewport);t&&(e.viewportEntity=t);const a=Yt(this._content);a&&(e.contentEntity=a);const s=Yt(this._horizontalScrollbar);s&&(e.horizontalScrollbarEntity=s);const i=Yt(this._verticalScrollbar);return i&&(e.verticalScrollbarEntity=i),e}get component(){return super.component}set horizontal(e){this._horizontal=e,this.component&&(this.component.horizontal=e)}get horizontal(){return this._horizontal}set vertical(e){this._vertical=e,this.component&&(this.component.vertical=e)}get vertical(){return this._vertical}set scrollMode(e){this._scrollMode=e,this.component&&(this.component.scrollMode=Qa.get(e)??At)}get scrollMode(){return this._scrollMode}set bounceAmount(e){this._bounceAmount=e,this.component&&(this.component.bounceAmount=e)}get bounceAmount(){return this._bounceAmount}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set useMouseWheel(e){this._useMouseWheel=e,this.component&&(this.component.useMouseWheel=e)}get useMouseWheel(){return this._useMouseWheel}set mouseWheelSensitivity(e){this._mouseWheelSensitivity=e,this.component&&(this.component.mouseWheelSensitivity=e)}get mouseWheelSensitivity(){return this._mouseWheelSensitivity}set horizontalScrollbarVisibility(e){this._horizontalScrollbarVisibility=e,this.component&&(this.component.horizontalScrollbarVisibility=Ia.get(e)??Ft)}get horizontalScrollbarVisibility(){return this._horizontalScrollbarVisibility}set verticalScrollbarVisibility(e){this._verticalScrollbarVisibility=e,this.component&&(this.component.verticalScrollbarVisibility=Ia.get(e)??Ft)}get verticalScrollbarVisibility(){return this._verticalScrollbarVisibility}set viewport(e){this._viewport=e;const t=Yt(e);this.component&&t&&(this.component.viewportEntity=t)}get viewport(){return this._viewport}set content(e){this._content=e;const t=Yt(e);this.component&&t&&(this.component.contentEntity=t)}get content(){return this._content}set horizontalScrollbar(e){this._horizontalScrollbar=e;const t=Yt(e);this.component&&t&&(this.component.horizontalScrollbarEntity=t)}get horizontalScrollbar(){return this._horizontalScrollbar}set verticalScrollbar(e){this._verticalScrollbar=e;const t=Yt(e);this.component&&t&&(this.component.verticalScrollbarEntity=t)}get verticalScrollbar(){return this._verticalScrollbar}static get observedAttributes(){return[...super.observedAttributes,"horizontal","vertical","scroll-mode","bounce-amount","friction","use-mouse-wheel","mouse-wheel-sensitivity","horizontal-scrollbar-visibility","vertical-scrollbar-visibility","viewport","content","horizontal-scrollbar","vertical-scrollbar"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"horizontal":this.horizontal=Lt(a,!0);break;case"vertical":this.vertical=Lt(a,!0);break;case"scroll-mode":this.scrollMode=Wt(a,Qa,"bounce",e);break;case"bounce-amount":this.bounceAmount=Kt(a,.1,e);break;case"friction":this.friction=Kt(a,.05,e);break;case"use-mouse-wheel":this.useMouseWheel=Lt(a,!0);break;case"mouse-wheel-sensitivity":this.mouseWheelSensitivity=Jt(a,o.ONE,e);break;case"horizontal-scrollbar-visibility":this.horizontalScrollbarVisibility=Wt(a,Ia,"when-required",e);break;case"vertical-scrollbar-visibility":this.verticalScrollbarVisibility=Wt(a,Ia,"when-required",e);break;case"viewport":this.viewport=a??"";break;case"content":this.content=a??"";break;case"horizontal-scrollbar":this.horizontalScrollbar=a??"";break;case"vertical-scrollbar":this.verticalScrollbar=a??""}}}customElements.define("pc-scrollview",Ja);class $a extends Tt{_attributes={};_enabled=!0;_script=null;set scriptAttributes(e){this._attributes=e??{},this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:this._attributes},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.setAttribute("name",e)}get name(){return this.getAttribute("name")??""}get script(){return this._script}connectedCallback(){"PC-SCRIPTS"!==this.parentElement?.tagName&&console.warn(`pc-script '${this.getAttribute("name")}' must be a direct child of pc-scripts - script not created`)}disconnectedCallback(){this._resetReady()}_onScriptCreated(){this._onReady()}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,a){switch(e){case"attributes":if(null===a){this.scriptAttributes={};break}try{this.scriptAttributes=JSON.parse(a)}catch(e){console.warn(`Invalid 'attributes' JSON on pc-script '${this.getAttribute("name")}': ${e.message}`)}break;case"enabled":this.enabled=Lt(a,!0);break;case"name":null!==t&&t!==a&&this.dispatchEvent(new CustomEvent("scriptnamechange",{detail:{oldName:t,newName:a},bubbles:!0}))}}}customElements.define("pc-script",$a);const Va=new Set([...$a.observedAttributes,"accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","exportparts","hidden","id","inert","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","role","slot","spellcheck","style","tabindex","title","translate"]),Ya=e=>Va.has(e)||e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("on")&&e in HTMLElement.prototype,Na=new Set(["app","entity","destroy","initialize","postInitialize","postUpdate","swap","update"]),Xa=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),Za=(e,t)=>(a,s)=>{const i=Dt(a,e);return i?new t(i):(console.warn(`Invalid script attribute value '${s}'. Expected ${e} space-separated numbers after 'vec${e}:'.`),s)},es=new Map([["asset",(e,t)=>{const a=ba.get(e);return a||(console.warn(`Unable to resolve '${t}' in script attributes - no pc-asset found with id '${e}'.`),t)}],["entity",(e,t)=>{const a=Yt(e);return a||(console.warn(`Unable to resolve '${t}' in script attributes - no pc-entity found matching '${e}'.`),t)}],["vec2",Za(2,o)],["vec3",Za(3,a)],["vec4",Za(4,i)],["color",(e,t)=>{const a=Dt(e,4)??Dt(e,3);return a?new s(a):(console.warn(`Invalid script attribute value '${t}'. Expected 3 or 4 space-separated numbers after 'color:'.`),t)}]]),ts=e=>{const t=e.indexOf(":");if(t<=0)return null;const a=es.get(e.slice(0,t));return a?{convert:a,rest:e.slice(t+1)}:null};class as extends da{observer;constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this)),this.addEventListener("scriptnamechange",this.handleScriptNameChange.bind(this))}connectedCallback(){return this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0}),super.connectedCallback()}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{this.createScript(e)})}convertAttributes(e){if("string"==typeof e){const t=ts(e);return t?t.convert(t.rest,e):e}if(Array.isArray(e))return 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}mergeDeep(e,t){for(const a in t){const s=t[a],i=e[a];if(this.isMathType(i)&&Array.isArray(s)){const t=this.arrayToMathType(i,s,a);t&&(e[a]=t);continue}s&&"object"==typeof s&&!Array.isArray(s)&&Object.getPrototypeOf(s)===Object.prototype?(i&&"object"==typeof i||(e[a]={}),this.mergeDeep(e[a],s)):e[a]=s}return e}isMathType(e){return e instanceof o||e instanceof a||e instanceof i||e instanceof s||e instanceof n}arrayToMathType(e,t,r){if(t.every(e=>"number"==typeof e&&Number.isFinite(e))){if(e instanceof o&&2===t.length)return new o(t);if(e instanceof a&&3===t.length)return new a(t);if(e instanceof i&&4===t.length)return new i(t);if(e instanceof s&&(3===t.length||4===t.length))return new s(t);if(e instanceof n&&3===t.length)return(new n).setFromEulerAngles(t[0],t[1],t[2])}return console.warn(`Cannot convert script attribute '${r}' array [${t}] to ${e.constructor.name}. Keeping the current value.`),null}applyAttributes(e,t,a){const s=this.convertAttributes(t);if(s&&"object"==typeof s&&(delete s.enabled,a))for(const e of a)delete s[e];this.mergeDeep(e,s)}inlineKeys(e){const t=new Set;for(const a of Array.from(e.attributes))Ya(a.name)||t.add(Xa(a.name));return t}scriptFor(e){const t=e.getAttribute("name");if(!t||!this.component)return null;const a=this.component.get(t);return a&&a===e._script?a:null}handleScriptAttributesChange(e){const t=e.target,a=this.scriptFor(t);a&&this.applyAttributes(a,e.detail.attributes,this.inlineKeys(t))}handleScriptEnableChange(e){const t=e.target;this.handleMutations(this.observer.takeRecords());const a=this.scriptFor(t);a&&(a.enabled=e.detail.enabled)}handleScriptNameChange(e){const t=e.target;if(t.parentElement!==this)return;if(!this.component)return;const{oldName:a}=e.detail;a&&t._script&&this.component.get(a)===t._script&&this.destroyScript(a),t._script=null,this.createScript(t)}createScript(e){const t=e.getAttribute("name");if(!t||!this.component)return null;const a=this.component.create(t,{enabled:!1});return a?(e._script=a,this.applyAttributes(a,e.scriptAttributes,this.inlineKeys(e)),this.applyInlineAttributes(a,e),a.enabled=e.enabled,e._onScriptCreated(),a):null}applyInlineAttributes(e,t){const a=t.getAttribute("name")??"";for(const s of Array.from(t.attributes))Ya(s.name)||this.setScriptProperty(e,a,s.name,s.value)}applyScriptProperty(e,t){const a=this.scriptFor(e);if(!a)return;const s=e.getAttribute(t);if(null===s){const s=Xa(t),i=e.scriptAttributes[s];return void(void 0!==i&&this.applyAttributes(a,{[s]:i}))}this.setScriptProperty(a,e.getAttribute("name")??"",t,s)}setScriptProperty(e,t,r,h){const c=Xa(r);try{const p=e[c];if("function"==typeof p||Na.has(c))return void console.warn(`Ignoring attribute '${r}' on pc-script '${t}' - '${c}' is part of the Script API.`);if("string"==typeof p)e[c]=h;else if(ts(h)){const t=this.convertAttributes(h);t===h&&null!=p||(e[c]=t)}else if("number"==typeof p)e[c]=Kt(h,p,r);else if("boolean"==typeof p)e[c]=Lt(h,p);else if(p instanceof o)e[c]=Jt(h,p,r);else if(p instanceof a)e[c]=$t(h,p,r);else if(p instanceof i)e[c]=Vt(h,p,r);else if(p instanceof s)e[c]=qt(h,p,r);else if(p instanceof n)e[c]=Qt(h,p,r);else{const a=((e,t)=>{const a=new Set(Object.keys(e));for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(e)))a.add(t);for(const e of a)if(e!==t&&e.toLowerCase()===t.toLowerCase())return e;return null})(e,c);if(a)return void console.warn(`Script '${t}' has no attribute '${c}' - did you mean '${l=a,l.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}'? Attribute names are kebab-case.`);console.warn(`Script '${t}' has no typed attribute '${c}' - assigning the raw string from '${r}'.`),e[c]=h}}catch(e){console.warn(`Error applying attribute '${r}' to script '${t}': ${e.message}`)}var l}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e){if("attributes"===t.type){const e=t.target;e instanceof $a&&e.parentElement===this&&t.attributeName&&!Ya(t.attributeName)&&this.applyScriptProperty(e,t.attributeName);continue}t.target===this&&(t.removedNodes.forEach(e=>{if(e instanceof $a){const t=e.getAttribute("name");t&&e._script&&this.component&&this.component.get(t)===e._script&&this.destroyScript(t),e._script=null}}),t.addedNodes.forEach(e=>{e instanceof $a&&this.createScript(e)}))}}disconnectedCallback(){this.observer.disconnect(),super.disconnectedCallback?.()}get component(){return super.component}}customElements.define("pc-scripts",as);class ss extends da{_distanceModel="linear";_maxDistance=1e4;_pitch=1;_positional=!1;_refDistance=1;_rollOffFactor=1;_volume=1;constructor(){super("sound")}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=Wt(a,["exponential","inverse","linear"],"linear",e);break;case"max-distance":this.maxDistance=Kt(a,1e4,e);break;case"pitch":this.pitch=Kt(a,1,e);break;case"positional":this.positional=Lt(a,!1);break;case"ref-distance":this.refDistance=Kt(a,1,e);break;case"roll-off-factor":this.rollOffFactor=Kt(a,1,e);break;case"volume":this.volume=Kt(a,1,e)}}}customElements.define("pc-sounds",ss);class is extends Tt{_asset="";_autoPlay=!1;_duration=null;_loop=!1;_name="";_overlap=!1;_pitch=1;_startTime=0;_volume=1;_soundElement=null;_connectionGeneration=0;soundSlot=null;async connectedCallback(){const e=++this._connectionGeneration,t=this.soundElement;await(t?.ready());const a=t?.component;if(e!==this._connectionGeneration||!a)return;const s={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(s.duration=this._duration),this._soundElement=t,this.soundSlot=a.addSlot(this._name,s),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this._connectionGeneration++,this._soundElement?.component?.removeSlot(this._name),this._soundElement=null,this.soundSlot=null,this._resetReady()}get soundElement(){const e=this.parentElement;return e instanceof ss?e:(console.warn("pc-sound must be a direct child of a pc-sounds element"),null)}set asset(e){if(this._asset=e,this.soundSlot){const t=ba.get(e)?.id;t&&(this.soundSlot.asset=t)}}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&&null!==e&&(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=Lt(a,!1);break;case"duration":this.duration=Kt(a,null,e);break;case"loop":this.loop=Lt(a,!1);break;case"name":this.name=a??"";break;case"overlap":this.overlap=Lt(a,!1);break;case"pitch":this.pitch=Kt(a,1,e);break;case"start-time":this.startTime=Kt(a,0,e);break;case"volume":this.volume=Kt(a,1,e)}}}customElements.define("pc-sound",is);class ns extends da{_asset="";_castShadows=!1;_lodBaseDistance=5;_lodMultiplier=3;_lodRangeMin=0;_lodRangeMax=99;constructor(){super("gsplat")}getInitialComponentData(){return{asset:ba.get(this._asset),castShadows:this._castShadows,lodBaseDistance:this._lodBaseDistance,lodMultiplier:this._lodMultiplier,lodRangeMin:this._lodRangeMin,lodRangeMax:this._lodRangeMax}}get component(){return super.component}set asset(e){this._asset=e;const t=ba.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 lodBaseDistance(e){this._lodBaseDistance=e,this.component&&(this.component.lodBaseDistance=e)}get lodBaseDistance(){return this._lodBaseDistance}set lodMultiplier(e){this._lodMultiplier=e,this.component&&(this.component.lodMultiplier=e)}get lodMultiplier(){return this._lodMultiplier}set lodRangeMin(e){this._lodRangeMin=e,this.component&&(this.component.lodRangeMin=e)}get lodRangeMin(){return this._lodRangeMin}set lodRangeMax(e){this._lodRangeMax=e,this.component&&(this.component.lodRangeMax=e)}get lodRangeMax(){return this._lodRangeMax}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows","lod-base-distance","lod-multiplier","lod-range-min","lod-range-max"]}attributeChangedCallback(e,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"asset":this.asset=a??"";break;case"cast-shadows":this.castShadows=Lt(a,!1);break;case"lod-base-distance":this.lodBaseDistance=Kt(a,5,e);break;case"lod-multiplier":this.lodMultiplier=Kt(a,3,e);break;case"lod-range-min":this.lodRangeMin=Kt(a,0,e);break;case"lod-range-max":this.lodRangeMax=Kt(a,99,e)}}}customElements.define("pc-gsplat",ns);class os extends Tt{_asset="";_entity=null;_loadGeneration=0;_loadHandle=null;_errorHandle=null;get entity(){return this._entity}connectedCallback(){if(!this.closestApp){const e=this._asset?` '${this._asset}'`:"";return void console.warn(`pc-model${e} must be a descendant of pc-app - model not created`)}this._loadModel()}disconnectedCallback(){this._loadGeneration++,this._detachLoadHandlers(),this._unloadModel(),this._resetReady()}_detachLoadHandlers(){this._loadHandle?.off(),this._loadHandle=null,this._errorHandle?.off(),this._errorHandle=null}_announceLoad(){this._onReady(),this.dispatchEvent(new Event("load"))}_instantiate(e){const t=this._loadGeneration,a=e.instantiateRenderEntity();this._entity=a,e.animations.length>0&&(a.addComponent("anim"),a.anim.assignAnimation("animation",e.animations[0].resource));const s=this.closestEntity;if(s)s.ready().then(()=>{t===this._loadGeneration&&(s.entity.addChild(a),this._announceLoad())});else{const e=this.closestApp;e&&e.ready().then(()=>{t===this._loadGeneration&&(e.app.root.addChild(a),this._announceLoad())})}}async _loadModel(){this._unloadModel();const e=++this._loadGeneration;this._detachLoadHandlers(),this._resetReady();const t=this.closestApp;if(!t)return;if(await t.ready(),e!==this._loadGeneration)return;const a=t.app,s=ba.get(this._asset);s?s.loaded?this._instantiate(s.resource):(this._loadHandle=s.once("load",()=>{this._detachLoadHandlers(),e===this._loadGeneration&&this._instantiate(s.resource)}),this._errorHandle=s.once("error",t=>{this._detachLoadHandlers(),e===this._loadGeneration&&(this.dispatchEvent(new ErrorEvent("error",{message:t instanceof Error?t.message:String(t)})),this._onReady())}),a.assets.load(s)):this._asset&&console.warn(`pc-model could not find asset '${this._asset}' - model not created`)}_unloadModel(){this._entity?.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",os);class rs extends ea{_name="";_index=null;_state="pending";_path=null;_host=null;_hostListener=null;_destroyHandle=null;_authored={};_enabled=null;_position=null;_rotation=null;_scale=null;_tags=null;get state(){return this._state}get path(){return this._path}connectedCallback(){const e=this.parentElement?.closest("pc-model, pc-node")??null;if(!e){const e=this._name?` '${this._name}'`:"";return void console.warn(`pc-node${e} must be a descendant of pc-model - node not bound`)}this._host=e,this._hostListener=e=>{e.target===this._host&&this._rebind()},e.addEventListener("ready",this._hostListener),this._rebind()}disconnectedCallback(){this._host&&this._hostListener&&this._host.removeEventListener("ready",this._hostListener),this._host=null,this._hostListener=null,this._unbind(),this._state="pending"}_rebind(){const e=this._host?.entity??null;if(!e||!this._name)return this._unbind(),void(this._state="pending");const t=this._resolve(e);t&&t===this._entity?this._path=this._pathOf(t,e):(this._unbind(),t&&this._bind(t,e))}_resolve(e){const t=e.find(e=>e.name===this._name);if(0===t.length){const t=this._closestName(e),a=t?` - closest match: '${t}'`:"";return console.warn(`pc-node '${this._name}' not found in ${this._describeHost()}${a}`),this._state="missing",null}let a;if(null!==this._index){if(this._index>=t.length)return console.warn(`pc-node '${this._name}' index ${this._index} is out of range - ${t.length} match(es) in ${this._describeHost()}`),this._state="missing",null;a=t[this._index]}else{if(t.length>1){const a=t.map((t,a)=>`[${a}] ${this._pathOf(t,e)}`).join(", ");return console.warn(`pc-node '${this._name}' is ambiguous in ${this._describeHost()} - specify index: ${a}`),this._state="ambiguous",null}a=t[0]}const s=this.closestApp?.elementFromEntity(a);return s&&s!==this?(console.warn(`pc-node '${this._name}' resolves to a node already bound by another element - element ignored`),this._state="duplicate",null):a}_bind(e,t){this._entity=e,this._registerEntity(e),this._destroyHandle=e.once("destroy",this._onEntityDestroy,this),this._state="bound",this._path=this._pathOf(e,t),this._applyOverrides(),this._onReady(),this._buildChildren()}_unbind(){const e=this._entity;e&&(this._revertOverrides(),this.querySelectorAll("pc-entity").forEach(e=>{e.closestEntity===this&&e.entity?.destroy()}),this._destroyHandle?.off(),this._destroyHandle=null,this._unregisterEntity(e),this._entity=null,this._path=null,this._authored={},this.querySelectorAll("*").forEach(e=>{e instanceof da&&e.closestEntity===this&&e._hostCycled()}),this._resetReady())}_onEntityDestroy(e){this._destroyHandle=null,this._unregisterEntity(e),this._entity=null,this._path=null,this._authored={},this._state="pending",this._resetReady()}_buildChildren(){const e=this.closestApp?.app;if(!e)return;const t=this.querySelectorAll("pc-entity");t.forEach(t=>{t._createEntity(e)}),t.forEach(t=>{t._buildHierarchy(e)})}_applyOverrides(){null!==this._enabled&&(this.enabled=this._enabled),null!==this._position&&(this.position=this._position),null!==this._rotation&&(this.rotation=this._rotation),null!==this._scale&&(this.scale=this._scale),null!==this._tags&&(this.tags=this._tags)}_revertOverrides(){const e=this._entity,t=this._authored;void 0!==t.enabled&&(e.enabled=t.enabled),t.position&&e.setLocalPosition(t.position),t.rotation&&e.setLocalRotation(t.rotation),t.scale&&e.setLocalScale(t.scale),t.tags&&(e.tags.clear(),e.tags.add(t.tags)),this._authored={}}_pathOf(e,t){const a=[];for(let s=e;s&&s!==t;s=s.parent)a.unshift(s.name);return a.join("/")||e.name}_describeHost(){return this._host instanceof os?`model '${this._host.asset}'`:`pc-node '${this._host?.name??""}' subtree`}_closestName(e){let t=null,a=3;return e.find(e=>{const s=((e,t)=>{const a=Array.from({length:t.length+1},(e,t)=>t);for(let s=1;s<=e.length;s++){let i=a[0];a[0]=s;for(let n=1;n<=t.length;n++){const o=a[n];a[n]=Math.min(a[n]+1,a[n-1]+1,i+(e[s-1]===t[n-1]?0:1)),i=o}}return a[t.length]})(this._name,e.name);return s<a&&(a=s,t=e.name),!1}),t}set name(e){this._name=e,this.isConnected&&this._host&&this._rebind()}get name(){return this._name}set index(e){this._index=e,this.isConnected&&this._host&&this._rebind()}get index(){return this._index}set enabled(e){this._enabled=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.enabled??=t.enabled,t.enabled=e):void 0!==this._authored.enabled&&(t.enabled=this._authored.enabled,delete this._authored.enabled))}get enabled(){return this._enabled}set position(e){this._position=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.position??=t.getLocalPosition().clone(),t.setLocalPosition(e)):this._authored.position&&(t.setLocalPosition(this._authored.position),delete this._authored.position))}get position(){return this._position}set rotation(e){this._rotation=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.rotation??=t.getLocalRotation().clone(),t.setLocalEulerAngles(e)):this._authored.rotation&&(t.setLocalRotation(this._authored.rotation),delete this._authored.rotation))}get rotation(){return this._rotation}set scale(e){this._scale=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.scale??=t.getLocalScale().clone(),t.setLocalScale(e)):this._authored.scale&&(t.setLocalScale(this._authored.scale),delete this._authored.scale))}get scale(){return this._scale}set tags(e){this._tags=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.tags??=t.tags.list().slice(),t.tags.clear(),t.tags.add(e)):this._authored.tags&&(t.tags.clear(),t.tags.add(this._authored.tags),delete this._authored.tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","index","name","position","rotation","scale","tags",...Zt]}attributeChangedCallback(e,t,s){switch(e){case"enabled":this.enabled=null===s?null:Lt(s,!0);break;case"index":if(null===s)this.index=null;else{const e=""===s.trim()?NaN:Number(s);!Number.isInteger(e)||e<0?(console.warn(`pc-node index '${s}' is not a non-negative integer - treated as absent`),this.index=null):this.index=e}break;case"name":this.name=s??"";break;case"position":this.position=null===s?null:$t(s,a.ZERO,e);break;case"rotation":this.rotation=null===s?null:$t(s,a.ZERO,e);break;case"scale":this.scale=null===s?null:$t(s,a.ONE,e);break;case"tags":this.tags=null===s?null:It(s);break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":this._updateInlineHandler(e,s)}}}customElements.define("pc-node",rs);class hs extends Tt{_fog="none";_fogColor=new s(1,1,1);_fogDensity=0;_fogStart=0;_fogEnd=1e3;_gravity=new a(0,-9.81,0);_scene=null;get scene(){return this._scene}async connectedCallback(){const e=this.closestApp;if(!e)return void console.warn("pc-scene must be a descendant of pc-app - scene settings not applied");if(await e.ready(),!this.isConnected||this.closestApp!==e)return;const t=e.app;t&&(this._scene=t.scene,this._updateSceneSettings(),this._onReady())}disconnectedCallback(){this._scene=null,this._resetReady()}_updateSceneSettings(){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._applyGravity(this._gravity))}_applyGravity(e){this.closestApp?.app?.systems.rigidbody?.gravity.copy(e)}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){this._gravity=e,this._scene&&this._applyGravity(e)}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,i){switch(e){case"fog":this.fog=Wt(i,["none","linear","exp","exp2"],"none",e);break;case"fog-color":this.fogColor=qt(i,s.WHITE,e);break;case"fog-density":this.fogDensity=Kt(i,0,e);break;case"fog-start":this.fogStart=Kt(i,0,e);break;case"fog-end":this.fogEnd=Kt(i,1e3,e);break;case"gravity":this.gravity=$t(i,new a(0,-9.81,0),e)}}}customElements.define("pc-scene",hs);class cs extends Tt{_asset="";_center=new a(0,.01,0);_intensity=1;_rotation=new a;_mipLevel=0;_lighting=!1;_scale=new a(100,100,100);_type="infinite";_scene=null;_appElement=null;_loadGeneration=0;_loadHandle=null;connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._loadGeneration++,this._detachLoadHandler(),this._unloadSkybox(),this._appElement=null,this._resetReady()}_detachLoadHandler(){this._loadHandle?.off(),this._loadHandle=null}_generateSkybox(e){if(!this._scene)return;const t=e.resource,a=Ot.generateSkyboxCubemap(t);if(this._scene.skybox?.destroy(),this._scene.skybox=a,this._lighting){const e=Ot.generateLightingSource(t),a=Ot.generateAtlas(e);e.destroy(),this._scene.envAtlas?.destroy(),this._scene.envAtlas=a}const s=this._scene.layers.getLayerById(zt);s&&(s.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._mipLevel}async _loadSkybox(){const e=++this._loadGeneration;this._detachLoadHandler();const t=await(this.closestApp?.ready());if(e!==this._loadGeneration)return;const a=t?.app;if(!t||!a)return;this._appElement=t;const s=ba.get(this._asset);s&&(this._scene=a.scene,s.loaded?this._generateSkybox(s):(this._loadHandle=s.once("load",()=>{this._loadHandle=null,e===this._loadGeneration&&this._generateSkybox(s)}),a.assets.load(s)))}_unloadSkybox(){const e=this._scene;e&&(this._scene=null,this._appElement?.app&&(e.skybox?.destroy(),e.skybox=null,e.envAtlas?.destroy(),e.envAtlas=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 lighting(e){this._lighting=e}get lighting(){return this._lighting}set mipLevel(e){this._mipLevel=e,this._scene&&(this._scene.skyboxMip=this._mipLevel)}get mipLevel(){return this._mipLevel}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new n).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(zt);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","lighting","mip-level","rotation","scale","type"]}attributeChangedCallback(e,t,s){switch(e){case"asset":this.asset=s??"";break;case"center":this.center=$t(s,new a(0,.01,0),e);break;case"intensity":this.intensity=Kt(s,1,e);break;case"lighting":this.lighting=Lt(s,!1);break;case"mip-level":this.mipLevel=Kt(s,0,e);break;case"rotation":this.rotation=$t(s,a.ZERO,e);break;case"scale":this.scale=$t(s,new a(100,100,100),e);break;case"type":this.type=Wt(s,["box","dome","infinite","none"],"infinite",e)}}}customElements.define("pc-sky",cs);export{Xt as AppElement,ba as AssetElement,Tt as AsyncElement,ga as ButtonComponentElement,va as CameraComponentElement,ya as CollisionComponentElement,da as ComponentElement,ka as ElementComponentElement,ea as EntityBaseElement,ta as EntityElement,ns as GSplatComponentElement,wa as LayoutChildComponentElement,Sa as LayoutGroupComponentElement,Aa as LightComponentElement,ua as ListenerComponentElement,Ua as MaterialElement,os as ModelElement,Pt as ModuleElement,rs as NodeElement,Fa as ParticleSystemComponentElement,Da as RenderComponentElement,Ba as RigidBodyComponentElement,hs as SceneElement,qa as ScreenComponentElement,as as ScriptComponentElement,$a as ScriptElement,Ja as ScrollViewComponentElement,Ka as ScrollbarComponentElement,cs as SkyElement,ss as SoundComponentElement,is as SoundSlotElement,Ht as whenReady};
1
+ import{basisInitialize as e,WasmModule as t,Vec3 as s,Color as a,Vec4 as i,Quat as n,Vec2 as o,createGraphicsDevice as r,AppOptions as c,Keyboard as h,Mouse as l,ElementInput as p,AnimComponentSystem as b,AnimationComponentSystem as d,AudioListenerComponentSystem as u,ButtonComponentSystem as m,CameraComponentSystem as g,CollisionComponentSystem as f,ElementComponentSystem as _,GSplatComponentSystem as v,JointComponentSystem as y,LayoutChildComponentSystem as k,LayoutGroupComponentSystem as w,LightComponentSystem as M,ModelComponentSystem as x,ParticleSystemComponentSystem as S,RenderComponentSystem as C,RigidBodyComponentSystem as A,ScreenComponentSystem as F,ScriptComponentSystem as E,ScrollbarComponentSystem as j,ScrollViewComponentSystem as R,SoundComponentSystem as O,SpriteComponentSystem as z,ZoneComponentSystem as T,AnimClipHandler as H,AnimationHandler as P,AnimStateGraphHandler as G,AudioHandler as U,BinaryHandler as D,CssHandler as B,ContainerHandler as L,CubemapHandler as q,FolderHandler as W,FontHandler as K,GSplatHandler as Q,HierarchyHandler as I,HtmlHandler as $,JsonHandler as J,MaterialHandler as Y,ModelHandler as V,RenderHandler as N,ScriptHandler as X,SceneHandler as Z,ShaderHandler as ee,SpriteHandler as te,TemplateHandler as se,TextHandler as ae,TextureAtlasHandler as ie,TextureHandler as ne,SoundManager as oe,Lightmapper as re,BatchManager as ce,XrManager as he,AppBase as le,FILLMODE_NONE as pe,RESOLUTION_AUTO as be,Picker as de,MeshInstance as ue,Entity as me,Asset as ge,SPRITE_RENDERMODE_SIMPLE as fe,FILTER_LINEAR_MIPMAP_LINEAR as _e,FILTER_LINEAR as ve,ADDRESS_REPEAT as ye,SPRITE_RENDERMODE_SLICED as ke,SPRITE_RENDERMODE_TILED as we,ADDRESS_CLAMP_TO_EDGE as Me,ADDRESS_MIRRORED_REPEAT as xe,FILTER_NEAREST as Se,FILTER_NEAREST_MIPMAP_NEAREST as Ce,FILTER_LINEAR_MIPMAP_NEAREST as Ae,FILTER_NEAREST_MIPMAP_LINEAR as Fe,BUTTON_TRANSITION_MODE_TINT as Ee,BUTTON_TRANSITION_MODE_SPRITE_CHANGE as je,TONEMAP_NONE as Re,PROJECTION_PERSPECTIVE as Oe,GAMMA_SRGB as ze,GAMMA_NONE as Te,XRTYPE_VR as He,TONEMAP_LINEAR as Pe,TONEMAP_FILMIC as Ge,TONEMAP_HEJL as Ue,TONEMAP_ACES as De,TONEMAP_ACES2 as Be,TONEMAP_NEUTRAL as Le,PROJECTION_ORTHOGRAPHIC as qe,ORIENTATION_HORIZONTAL as We,FITTING_NONE as Ke,FITTING_STRETCH as Qe,FITTING_SHRINK as Ie,FITTING_BOTH as $e,ORIENTATION_VERTICAL as Je,SHADOW_PCF3_32F as Ye,SHADOW_PCF1_16F as Ve,SHADOW_PCF1_32F as Ne,SHADOW_PCF3_16F as Xe,SHADOW_PCF5_16F as Ze,SHADOW_PCF5_32F as et,SHADOW_VSM_16F as tt,SHADOW_VSM_32F as st,SHADOW_PCSS_32F as at,StandardMaterial as it,BLEND_NONE as nt,CULLFACE_BACK as ot,FRESNEL_SCHLICK as rt,SPECOCC_AO as ct,BLEND_NORMAL as ht,BLEND_ADDITIVE as lt,BLEND_ADDITIVEALPHA as pt,BLEND_PREMULTIPLIED as bt,BLEND_MULTIPLICATIVE as dt,BLEND_MULTIPLICATIVE2X as ut,BLEND_SCREEN as mt,BLEND_MIN as gt,BLEND_MAX as ft,BLEND_SUBTRACTIVE as _t,CULLFACE_NONE as vt,CULLFACE_FRONT as yt,CULLFACE_FRONTANDBACK as kt,FRESNEL_NONE as wt,SPECOCC_NONE as Mt,SPECOCC_GLOSSDEPENDENT as xt,SCALEMODE_NONE as St,SCALEMODE_BLEND as Ct,SCROLL_MODE_BOUNCE as At,SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIRED as Ft,SCROLLBAR_VISIBILITY_SHOW_ALWAYS as Et,SCROLL_MODE_CLAMP as jt,SCROLL_MODE_INFINITE as Rt,EnvLighting as Ot,LAYERID_SKYBOX as zt}from"playcanvas";class Tt extends HTMLElement{_readyPromise;_readyResolve;_readyResolved=!1;constructor(){super(),this._readyPromise=new Promise(e=>{this._readyResolve=e})}get closestApp(){return this.parentElement?.closest("pc-app")??null}get closestEntity(){return this.parentElement?.closest("pc-entity, pc-node")??null}_onReady(){this._readyResolved||(this._readyResolved=!0,this._readyResolve(),this.dispatchEvent(new CustomEvent("ready",{bubbles:!0,composed:!0})))}_resetReady(){this._readyResolved&&(this._readyResolved=!1,this._readyPromise=new Promise(e=>{this._readyResolve=e}))}ready(){return this._readyPromise.then(()=>this)}}async function Ht(e){let t;if("string"==typeof e){"loading"===document.readyState&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e,{once:!0})});try{t=document.querySelector(e)}catch{throw new Error(`whenReady: '${e}' is not a valid CSS selector`)}if(!t)throw new Error(`whenReady: no element found matching '${e}'`)}else t=e;if(!(t instanceof Tt)){const s=t instanceof Element?`<${t.tagName.toLowerCase()}>`:String(e);throw new Error(`whenReady: ${s} does not initialize asynchronously`)}return await t.ready(),t}class Pt extends Tt{_loadPromise=null;connectedCallback(){this._getLoadPromise()}async _loadModule(){const s=this.getAttribute("name");if(!s)return void console.warn("pc-module requires a 'name' attribute - no module was configured");const a={glueUrl:this.getAttribute("glue")??void 0,wasmUrl:this.getAttribute("wasm")??void 0,fallbackUrl:this.getAttribute("fallback")??void 0};"Basis"===s?e(a):(t.setConfig(s,a),await new Promise(e=>{t.getInstance(s,()=>e())})),this._onReady()}_getLoadPromise(){return this._loadPromise||(this._loadPromise=this._loadModule()),this._loadPromise}}customElements.define("pc-module",Pt);class Gt{_track;_fill;_sweep=null;_removal=null;constructor(e){this._track=document.createElement("div"),this._track.setAttribute("role","progressbar"),this._track.setAttribute("aria-label","Loading"),this._track.setAttribute("aria-valuemin","0"),this._track.setAttribute("aria-valuemax","100"),this._track.style.cssText=["position: absolute","top: 0","left: 0","width: 100%","height: var(--pc-loading-bar-height, 3px)","background: var(--pc-loading-bar-background, rgba(0, 0, 0, 0.1))","z-index: 10000","pointer-events: none","opacity: 1","transition: opacity 0.2s ease"].join("; "),this._fill=document.createElement("div"),this._fill.style.cssText=["width: 100%","height: 100%","transform-origin: left center","transform: scaleX(0)","background: var(--pc-loading-bar-color, #f60)","transition: transform 0.2s ease"].join("; "),this._track.appendChild(this._fill),e.appendChild(this._track),"function"==typeof this._fill.animate&&(this._sweep=this._fill.animate([{transform:"scaleX(0.25) translateX(-100%)"},{transform:"scaleX(0.25) translateX(500%)"}],{duration:1e3,iterations:1/0,easing:"ease-in-out"}))}progress(e,t){this._sweep&&(this._sweep.cancel(),this._sweep=null);const s=0===t?1:e/t;this._track.setAttribute("aria-valuenow",String(Math.round(100*s))),this._fill.style.transform=`scaleX(${s})`}complete(){null===this._removal&&(this._sweep&&(this._sweep.cancel(),this._sweep=null),this._track.setAttribute("aria-valuenow","100"),this._fill.style.transform="scaleX(1)",this._track.style.opacity="0",this._removal=setTimeout(()=>this._track.remove(),250))}destroy(){this._sweep&&(this._sweep.cancel(),this._sweep=null),null!==this._removal&&(clearTimeout(this._removal),this._removal=null),this._track.remove()}}const Ut={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"},Dt=(e,t)=>{const s=e.trim().split(/\s+/).map(Number);return s.length!==t||s.some(e=>!Number.isFinite(e))?null:s},Bt=e=>null===e?null:e.clone(),Lt=(e,t)=>null===e?t:"false"!==e,qt=(e,t,s)=>{if(null===e)return Bt(t);const i=Ut[e.toLowerCase()];if(i)return(new a).fromString(i);if(/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)){let t=e.slice(1);return 3!==t.length&&4!==t.length||(t=t.split("").map(e=>e+e).join("")),(new a).fromString(`#${t}`)}const n=Dt(e,4)??Dt(e,3);return n?new a(n):(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected a CSS color name, a hex color or 3 or 4 space-separated numbers. Using '${t}'.`),Bt(t))},Wt=(e,t,s,a)=>{if(null===e)return s;const i=Array.isArray(t)?t:[...t.keys()];return i.includes(e)?e:(console.warn(`Invalid value '${e}' for attribute '${a}'. Valid values: ${i.join(", ")}. Using '${s}'.`),s)},Kt=(e,t,s)=>{if(null===e)return t;const a=""===e.trim()?NaN:Number(e);return Number.isFinite(a)?a:(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected a finite number. Using '${t}'.`),t)},Qt=(e,t,s)=>{if(null===e)return Bt(t);const a=Dt(e,3);return a?(new n).setFromEulerAngles(a[0],a[1],a[2]):(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected 3 space-separated numbers. Using '${t}'.`),Bt(t))},It=(e,t=[])=>null===e?[...t]:e.split(",").map(e=>e.trim()).filter(e=>""!==e),$t=(e,t,s)=>{if(null===e)return Bt(t);const a=Dt(e,2);return a?new o(a):(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected 2 space-separated numbers. Using '${t}'.`),Bt(t))},Jt=(e,t,a)=>{if(null===e)return Bt(t);const i=Dt(e,3);return i?new s(i):(console.warn(`Invalid value '${e}' for attribute '${a}'. Expected 3 space-separated numbers. Using '${t}'.`),Bt(t))},Yt=(e,t,s)=>{if(null===e)return Bt(t);const a=Dt(e,4);return a?new i(a):(console.warn(`Invalid value '${e}' for attribute '${s}'. Expected 4 space-separated numbers. Using '${t}'.`),Bt(t))},Vt=e=>{if(!e)return null;let t=null;try{t=document.querySelector(e)}catch{t=null}return t||(t=document.getElementById(e)??document.querySelector(`pc-entity[name="${e}"]`)),t?.entity??null},Nt=["pointermove","pointerdown","pointerup","pointerenter","pointerleave"];class Xt extends Tt{_canvas=null;_alpha=!0;_backend="webgpu";_antialias=!0;_depthBuffer=!0;_stencilBuffer=!0;_maxPixelRatio=1/0;_loadingBar=!0;_optionsLocked=!1;_bar=null;_hierarchyReady=!1;_bootGeneration=0;_entityElements=new Map;_picker=null;_hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1};_hoveredEntity=null;_pickToken=0;_pointerHandlers={pointermove:null,pointerdown:null,pointerup:null};_app=null;_loadProgress=0;_resizeObserver=null;get app(){return this._app}get loadProgress(){return this._loadProgress}constructor(){super(),Nt.forEach(e=>{this.addEventListener(`${e}:connect`,()=>this._onPointerListenerAdded(e)),this.addEventListener(`${e}:disconnect`,()=>this._onPointerListenerRemoved(e))})}async connectedCallback(){const e=++this._bootGeneration;(()=>{const e="pc-app-styles";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent=":where(pc-app) { display: block; position: relative; width: 300px; height: 150px; }",document.head.appendChild(t)})(),this._loadingBar&&!this._bar&&(this._bar=new Gt(this));const t=this.querySelectorAll(":scope > pc-module");if(await Promise.all(Array.from(t).map(e=>e._getLoadPromise())),e!==this._bootGeneration)return;this._canvas=document.createElement("canvas"),this._canvas.style.cssText="display: block; width: 100%; height: 100%; touch-action: none;",this.appendChild(this._canvas);const s={webgpu:["webgpu","webgl2"],webgl2:["webgl2"],null:["null"]}[this._backend]||[];this._optionsLocked=!0;const a=s.join(", ");let i;try{i=await r(this._canvas,{alpha:this._alpha,antialias:this._antialias,depth:this._depthBuffer,deviceTypes:s,stencil:this._stencilBuffer})}catch(t){if(e!==this._bootGeneration)return;this._canvas&&this.contains(this._canvas)&&this.removeChild(this._canvas),this._canvas=null,this._bar?.destroy(),this._bar=null;const s=`pc-app failed to create a graphics device (${a}) - ${t instanceof Error?t.message:String(t)}`;return console.error(s,t),void this.dispatchEvent(new ErrorEvent("error",{message:s,error:t}))}if(e!==this._bootGeneration)return void i.destroy();i.maxPixelRatio=this._maxPixelRatio;const n=new c;n.graphicsDevice=i,n.keyboard=new h(window),n.mouse=new l(this._canvas),n.elementInput=new p(this._canvas,{useMouse:!0,useTouch:!0}),n.componentSystems=[b,d,u,m,g,f,_,v,y,k,w,M,x,S,C,A,F,E,j,R,O,z,T],n.resourceHandlers=[H,P,G,U,D,B,L,q,W,K,Q,I,$,J,Y,V,N,X,Z,ee,te,se,ae,ie,ne],n.soundManager=new oe,n.lightmapper=re,n.batchManager=ce,n.xr=he;const o=new le(this._canvas);this._app=o,o.init(n),o.setCanvasFillMode(pe),o.setCanvasResolution(be),this._pickerCreate(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>this._syncCanvasSize()),this._resizeObserver.observe(this));const de=this.querySelectorAll(":scope > pc-asset");for(const t of Array.from(de)){t._createAsset();const s=t.asset;if(s&&(o.assets.add(s),e!==this._bootGeneration))return}const ue=this.querySelectorAll(":scope > pc-material");Array.from(ue).forEach(e=>{e._createMaterial()});const me=this.querySelectorAll("pc-entity");if(Array.from(me).forEach(e=>{e._createEntity(o)}),me.forEach(e=>{e._buildHierarchy(o)}),e!==this._bootGeneration)return;this._hierarchyReady=!0;const ge=o.assets.list({preload:!0}).length;let fe=0;const _e=()=>{fe+=1,this._loadProgress=fe/ge,this._bar?.progress(fe,ge),this.dispatchEvent(new ProgressEvent("progress",{lengthComputable:!0,loaded:fe,total:ge}))};o.on("preload:progress",_e),this._loadProgress=0===ge?1:0,this._bar?.progress(0,ge),this.dispatchEvent(new ProgressEvent("progress",{lengthComputable:!0,loaded:0,total:ge})),e===this._bootGeneration&&o.preload(()=>{e===this._bootGeneration&&(o.off("preload:progress",_e),this._loadProgress=1,o.start(),o.once("frameend",()=>this._bar?.complete()),this._onReady())})}disconnectedCallback(){this._bootGeneration++,this._optionsLocked=!1,this._pickerDestroy(),this._app&&(this._app.destroy(),this._app=null),this._entityElements.clear(),this._loadProgress=0,this._bar?.destroy(),this._bar=null,this._hierarchyReady=!1,this._resetReady(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._canvas&&this.contains(this._canvas)&&(this.removeChild(this._canvas),this._canvas=null)}_syncCanvasSize(){if(!this.app||this.app.xr?.active)return;this.app.updateCanvasSize();const{width:e,height:t}=this.app.graphicsDevice;this._picker?.resize(e,t)}_pickerCreate(){const{width:e,height:t}=this.app.graphicsDevice;this._picker=new de(this.app,e,t);const s=e=>t=>{e.call(this,t)};this._pointerHandlers.pointermove=s(this._onPointerMove),this._pointerHandlers.pointerdown=s(this._onPointerDown),this._pointerHandlers.pointerup=s(this._onPointerUp),Nt.forEach(e=>{Array.from(this.querySelectorAll("pc-entity, pc-node")).some(t=>t._hasListeners(e))&&this._onPointerListenerAdded(e)})}_pickerDestroy(){this._canvas&&Object.entries(this._pointerHandlers).forEach(([e,t])=>{t&&this._canvas.removeEventListener(e,t)}),this._picker=null,this._hoveredEntity=null,this._pointerHandlers={pointermove:null,pointerdown:null,pointerup:null},this._hasPointerListeners={pointerenter:!1,pointerleave:!1,pointerdown:!1,pointerup:!1,pointermove:!1}}_registerEntityElement(e,t){this._entityElements.set(e,t)}_unregisterEntityElement(e){this._entityElements.delete(e)}elementFromEntity(e){return this._entityElements.get(e)??null}_elementFromNode(e){for(;null!==e;){const t=this._entityElements.get(e);if(t)return t;e=e.parent}return null}_elementWithListener(e,t){for(;null!==e;){const s=this._entityElements.get(e);if(s?._hasListeners(t))return s;e=e.parent}return null}_getPickerCoordinates(e,t){const s=t.getBoundingClientRect();if(0===s.width||0===s.height)return{x:e.clientX,y:e.clientY,mapped:!1};const a=t.width/s.width,i=t.height/s.height;return{x:(e.clientX-s.left)*a,y:(e.clientY-s.top)*i,mapped:!0}}_cameraContains(e,t,s,a){const i=e.rect,n=i.x*a.width,o=(1-i.y)*a.height,r=o-i.w*a.height;return t>=n&&t<n+i.z*a.width&&s>=r&&s<o}async _pickNode(e){const t=this.app,s=this._picker,a=this._canvas;if(!t||!s||!a)return null;const{x:i,y:n,mapped:o}=this._getPickerCoordinates(e,a),r=t.systems.camera?.cameras??[];for(let e=r.length-1;e>=0;e--){const c=r.at(e);if(!c||c.renderTarget)continue;if(o&&!this._cameraContains(c,i,n,a))continue;s.prepare(c,t.scene);const h=await s.getSelectionAsync(i,n);if(!this._picker||!this.app)return null;if(h.length>0){const e=h[0];return e instanceof ue?e.node:e.entity}if(c.clearColorBuffer)return null}return null}async _onPointerMove(e){if(!this._picker||!this.app)return;const t=++this._pickToken,s=await this._pickNode(e);if(t!==this._pickToken||!this._picker)return;const a=this._elementFromNode(s);this._hoveredEntity!==a&&(this._hoveredEntity&&this._hoveredEntity._hasListeners("pointerleave")&&this._hoveredEntity.dispatchEvent(new PointerEvent("pointerleave",e)),a&&a._hasListeners("pointerenter")&&a.dispatchEvent(new PointerEvent("pointerenter",e))),this._hoveredEntity=a,a&&a._hasListeners("pointermove")&&a.dispatchEvent(new PointerEvent("pointermove",e))}async _onPointerDown(e){if(!this._picker||!this.app)return;const t=await this._pickNode(e);if(!this._picker)return;const s=this._elementWithListener(t,"pointerdown");s&&s.dispatchEvent(new PointerEvent("pointerdown",e))}async _onPointerUp(e){if(!this._picker||!this.app)return;const t=await this._pickNode(e);if(!this._picker)return;const s=this._elementWithListener(t,"pointerup");s&&s.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, pc-node")).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)}}_warnIfBooted(e){this._optionsLocked&&console.warn(`Attribute '${e}' on <pc-app> is only read when the application boots, so this change has no effect. Set it before the element is connected, or remove and re-insert the element to reboot with the new value.`)}set alpha(e){this._warnIfBooted("alpha"),this._alpha=e}get alpha(){return this._alpha}set antialias(e){this._warnIfBooted("antialias"),this._antialias=e}get antialias(){return this._antialias}set backend(e){this._warnIfBooted("backend"),this._backend=e}get backend(){return this._backend}set depthBuffer(e){this._warnIfBooted("depth-buffer"),this._depthBuffer=e}get depthBuffer(){return this._depthBuffer}set loadingBar(e){this._loadingBar=e,!e&&this._bar&&(this._bar.destroy(),this._bar=null)}get loadingBar(){return this._loadingBar}set maxPixelRatio(e){this._maxPixelRatio=e,this.app&&(this.app.graphicsDevice.maxPixelRatio=e,this._syncCanvasSize())}get maxPixelRatio(){return this._maxPixelRatio}set stencilBuffer(e){this._warnIfBooted("stencil-buffer"),this._stencilBuffer=e}get stencilBuffer(){return this._stencilBuffer}static get observedAttributes(){return["alpha","antialias","backend","depth-buffer","loading-bar","max-pixel-ratio","stencil-buffer"]}attributeChangedCallback(e,t,s){switch(e){case"alpha":this.alpha=Lt(s,!0);break;case"antialias":this.antialias=Lt(s,!0);break;case"backend":this.backend=Wt(s,["webgpu","webgl2","null"],"webgpu",e);break;case"depth-buffer":this.depthBuffer=Lt(s,!0);break;case"loading-bar":this.loadingBar=Lt(s,!0);break;case"max-pixel-ratio":this.maxPixelRatio=Kt(s,1/0,e);break;case"stencil-buffer":this.stencilBuffer=Lt(s,!0)}}}customElements.define("pc-app",Xt);const Zt=["onpointerenter","onpointerleave","onpointerdown","onpointerup","onpointermove"];class es extends Tt{_entity=null;_appElement=null;_listeners={};_inlineHandlerTypes=new Set;get entity(){return this._entity}_registerEntity(e){this._appElement=this.closestApp,this._appElement?._registerEntityElement(e,this)}_unregisterEntity(e){this._appElement?._unregisterEntityElement(e),this._appElement=null}_updateInlineHandler(e,t){const s=e.substring(2),a=this._inlineHandlerTypes.has(s),i=null!==t;i&&!a?(this._inlineHandlerTypes.add(s),this.dispatchEvent(new CustomEvent(`${s}:connect`,{bubbles:!0}))):!i&&a&&(this._inlineHandlerTypes.delete(s),this.dispatchEvent(new CustomEvent(`${s}:disconnect`,{bubbles:!0})))}addEventListener(e,t,s){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),super.addEventListener(e,t,s),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:connect`,{bubbles:!0}))}removeEventListener(e,t,s){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),super.removeEventListener(e,t,s),e.startsWith("pointer")&&this.dispatchEvent(new CustomEvent(`${e}:disconnect`,{bubbles:!0}))}_hasListeners(e){return Boolean(this._listeners[e]?.length)||this._inlineHandlerTypes.has(e)}}class ts extends es{_enabled=!0;_name="Untitled";_position=new s;_rotation=new s;_scale=new s(1,1,1);_tags=[];_built=!1;_createEntity(e){if(this._entity)return;const t=new me(this._name,e);this._entity=t,t.enabled=this._enabled,t.setLocalPosition(this._position),t.setLocalEulerAngles(this._rotation),t.setLocalScale(this._scale),this._tags.length>0&&t.tags.add(this._tags),this._registerEntity(t),t.once("destroy",this._onEntityDestroy,this)}_onEntityDestroy(e){this._unregisterEntity(e),this._entity=null,this._built=!1,this._resetReady()}_buildHierarchy(e){if(!this.entity||this._built)return;const t=this.closestEntity;t&&!t.entity||(this._built=!0,t?.entity?t.entity.addChild(this.entity):e.root.addChild(this.entity),this._onReady())}connectedCallback(){const e=this.closestApp;if(!e){const e=this.getAttribute("name"),t=e?` '${e}'`:"";return void console.warn(`pc-entity${t} must be a descendant of pc-app - entity not created`)}if(e._hierarchyReady){const t=e.app;this._createEntity(t),this._buildHierarchy(t);const s=this.querySelectorAll("pc-entity");s.forEach(e=>{e._createEntity(t)}),s.forEach(e=>{e._buildHierarchy(t)})}}disconnectedCallback(){this._entity?.destroy()}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",...Zt]}attributeChangedCallback(e,t,a){switch(e){case"enabled":this.enabled=Lt(a,!0);break;case"name":this.name=a??"Untitled";break;case"position":this.position=Jt(a,s.ZERO,e);break;case"rotation":this.rotation=Jt(a,s.ZERO,e);break;case"scale":this.scale=Jt(a,s.ONE,e);break;case"tags":this.tags=It(a);break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":this._updateInlineHandler(e,a)}}}customElements.define("pc-entity",ts);var ss=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 s,a=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(a),{}).then(function(e){(s=e.instance).exports.__wasm_call_ctors()});function n(e){for(var s=new Uint8Array(e.length),a=0;a<e.length;++a){var i=e.charCodeAt(a);s[a]=i>96?i-97:i>64?i-39:i+4}var n=0;for(a=0;a<e.length;++a)s[n++]=s[a]<60?t[s[a]]:64*(s[a]-60)+s[++a];return s.buffer.slice(0,n)}function o(e,t,a,i,n,o){var r=s.exports.sbrk,c=a+3&-4,h=r(c*i),l=r(n.length),p=new Uint8Array(s.exports.memory.buffer);p.set(n,l);var b=e(h,a,i,l,n.length);if(0==b&&o&&o(h,c,i),t.set(p.subarray(h,h+a*i)),r(h-r(0)),0!=b)throw new Error("Malformed buffer data: "+b)}var r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],l=0;function p(e){var t={object:new Worker(e),pending:0,requests:{}};return t.object.onmessage=function(e){var s=e.data;t.pending-=s.count,t.requests[s.id][s.action](s.value),delete t.requests[s.id]},t}function b(e){for(var t="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n(a))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+o.toString()+d.toString(),s=new Blob([t],{type:"text/javascript"}),i=URL.createObjectURL(s),r=0;r<e;++r)h[r]=p(i);URL.revokeObjectURL(i)}function d(e){i.then(function(){var t=e.data;try{var a=new Uint8Array(t.count*t.size);o(s.exports[t.mode],a,t.count,t.size,t.source,s.exports[t.filter]),self.postMessage({id:t.id,count:t.count,action:"resolve",value:a},[a.buffer])}catch(e){self.postMessage({id:t.id,count:t.count,action:"reject",value:e})}})}return{ready:i,supported:!0,useWorkers:function(e){b(e)},decodeVertexBuffer:function(e,t,a,i,n){o(s.exports.meshopt_decodeVertexBuffer,e,t,a,i,s.exports[r[n]])},decodeIndexBuffer:function(e,t,a,i){o(s.exports.meshopt_decodeIndexBuffer,e,t,a,i)},decodeIndexSequence:function(e,t,a,i){o(s.exports.meshopt_decodeIndexSequence,e,t,a,i)},decodeGltfBuffer:function(e,t,a,i,n,h){o(s.exports[c[n]],e,t,a,i,s.exports[r[h]])},decodeGltfBufferAsync:function(e,t,a,n,p){return h.length>0?function(e,t,s,a,i){for(var n=h[0],o=1;o<h.length;++o)h[o].pending<n.pending&&(n=h[o]);return new Promise(function(o,r){var c=new Uint8Array(s),h=l++;n.pending+=e,n.requests[h]={resolve:o,reject:r},n.object.postMessage({id:h,count:e,size:t,source:c,mode:a,filter:i},[c.buffer])})}(e,t,a,c[n],r[p]):i.then(function(){var i=new Uint8Array(e*t);return o(s.exports[c[n]],i,e,t,a,s.exports[r[p]]),i})}}}();const as=new Map([["simple",fe],["sliced",ke],["tiled",we]]),is=new Map([["repeat",ye],["clamp",Me],["mirror",xe]]),ns=new Map([["nearest",Se],["linear",ve],["nearest-mip-nearest",Ce],["linear-mip-nearest",Ae],["nearest-mip-linear",Fe],["linear-mip-linear",_e]]),os=new Map([["nearest",Se],["linear",ve]]),rs=e=>e.replace(/-/g,"_"),cs={addressU:ye,addressV:ye,anisotropy:1,flipY:!1,magFilter:ve,minFilter:_e,mipmaps:!0,srgb:!1},hs=[[["address-u","address-v","anisotropy","flip-y","mag-filter","min-filter","mipmaps","srgb"],["texture","textureatlas"]],[["atlas","frame-keys","pixels-per-unit","render-mode"],["sprite"]]],ls=new Map([["bin","binary"],["css","css"],["frag","shader"],["glb","container"],["glsl","shader"],["gltf","container"],["hdr","texture"],["html","html"],["jpg","texture"],["js","script"],["json","json"],["ktx2","texture"],["mp3","audio"],["mjs","script"],["ply","gsplat"],["png","texture"],["sog","gsplat"],["txt","text"],["vert","shader"],["webp","texture"]]),ps=(e,t,s)=>{if(e.extensions&&e.extensions.EXT_meshopt_compression){const a=e.extensions.EXT_meshopt_compression;Promise.all([ss.ready,t[a.buffer]]).then(e=>{const t=e[1],i=a.byteOffset||0,n=a.byteLength||0,o=a.count,r=a.byteStride,c=new Uint8Array(o*r),h=new Uint8Array(t.buffer,t.byteOffset+i,n);ss.decodeGltfBuffer(c,o,r,h,a.mode,a.filter),s(null,c)})}else s(null,null)};class bs extends Tt{_addressU=null;_addressV=null;_anisotropy=null;_flipY=null;_lazy=!1;_magFilter=null;_minFilter=null;_mipmaps=null;_srgb=null;asset=null;async connectedCallback(){const e=this.closestApp;if(e)if(this.parentElement===e){if(await e.ready(),this.isConnected&&this.parentElement===e){if(!this.asset){const t=e.app;if(!t)return;this._createAsset(),this.asset&&(t.assets.add(this.asset),this.lazy||t.assets.load(this.asset))}this.asset&&this._onReady()}}else console.warn(`pc-asset '${this.getAttribute("id")??this.getAttribute("src")}' must be a direct child of pc-app - asset not created`)}disconnectedCallback(){this._destroyAsset(),this._resetReady()}_onAssetLoad(){this.dispatchEvent(new Event("load"))}_onAssetError(e){this.dispatchEvent(new ErrorEvent("error",{message:e instanceof Error?e.message:String(e)}))}_createAsset(){const e=this.getAttribute("id")||"",t=this.getAttribute("src")||"";let s=this.getAttribute("type");if(!s){const e=t.split(".").pop();s=ls.get(e||"")??null}if(!s)return void console.warn(`Unsupported asset type: ${t}`);const a=hs.filter(([,e])=>!e.includes(s)).flatMap(([e])=>e).filter(e=>this.hasAttribute(e));a.length>0&&console.warn(`pc-asset '${e||t}' has attributes that do not apply to asset type '${s}' and are ignored: ${a.join(", ")}`);const i=this._buildData(s);this.asset="container"===s?new ge(e,s,{url:t},void 0,{bufferView:{processAsync:ps.bind(this)}}):new ge(e,s,"sprite"===s?null:t?{url:t}:null,i),this.asset.preload=!this._lazy,this.asset.on("load",this._onAssetLoad,this),this.asset.on("error",this._onAssetError,this)}_buildData(e){let t;const s=this.getAttribute("data");if(s)try{t=JSON.parse(s)}catch(e){console.warn(`Invalid 'data' JSON on pc-asset: ${s}`)}if("texture"!==e&&"textureatlas"!==e||(t=t??{},null!==this._addressU&&(t.addressu=this._addressU),null!==this._addressV&&(t.addressv=this._addressV),null!==this._anisotropy&&(t.anisotropy=this._anisotropy),null!==this._flipY&&(t.flipY=this._flipY),null!==this._magFilter&&(t.magfilter=rs(this._magFilter)),null!==this._minFilter&&(t.minfilter=rs(this._minFilter)),null!==this._mipmaps&&(t.mipmaps=this._mipmaps),null!==this._srgb&&(t.srgb=this._srgb)),"sprite"===e){t=t??{};const e=this.getAttribute("atlas")??t.textureAtlasAsset;if("string"==typeof e){const s=bs.get(e);s?t.textureAtlasAsset=s.id:console.warn(`pc-asset sprite '${this.getAttribute("id")}' could not find atlas '${e}'`)}const s=this.getAttribute("frame-keys");null!==s&&(t.frameKeys=s.split(/[\s,]+/).filter(Boolean));const a=this.getAttribute("pixels-per-unit");null!==a&&(t.pixelsPerUnit=Kt(a,1,"pixels-per-unit"));const i=this.getAttribute("render-mode");null!==i&&(t.renderMode=as.get(Wt(i,as,"simple","render-mode"))),t.renderMode=t.renderMode??fe,t.pixelsPerUnit=t.pixelsPerUnit??1,t.frameKeys=t.frameKeys??[]}return t}_texture(){const e=this.asset;return e?.resource?"texture"===e.type?e.resource:"textureatlas"===e.type?e.resource.texture??null:null:null}_applyTextureOption(e,t,s,a){const i=this.asset;if(!i||"texture"!==i.type&&"textureatlas"!==i.type)return;const n=i.data;null===s?delete n[e]:n[e]=s;const o=this._texture();o&&(o[t]=a??cs[t])}_destroyAsset(){this.asset&&(this.asset.off("load",this._onAssetLoad,this),this.asset.off("error",this._onAssetError,this),this.asset.registry?.remove(this.asset),this.asset.unload(),this.asset=null)}set addressU(e){this._addressU=e;const t=null===e?null:is.get(e)??ye;this._applyTextureOption("addressu","addressU",e,t)}get addressU(){return this._addressU}set addressV(e){this._addressV=e;const t=null===e?null:is.get(e)??ye;this._applyTextureOption("addressv","addressV",e,t)}get addressV(){return this._addressV}set anisotropy(e){this._anisotropy=e,this._applyTextureOption("anisotropy","anisotropy",e,e)}get anisotropy(){return this._anisotropy}set flipY(e){this._flipY=e,this._applyTextureOption("flipY","flipY",e,e)}get flipY(){return this._flipY}set lazy(e){this._lazy=e,this.asset&&(this.asset.preload=!e,e||this.asset.registry?.load(this.asset))}get lazy(){return this._lazy}set magFilter(e){this._magFilter=e;const t=null===e?null:rs(e),s=null===e?null:os.get(e)??ve;this._applyTextureOption("magfilter","magFilter",t,s)}get magFilter(){return this._magFilter}set minFilter(e){this._minFilter=e;const t=null===e?null:rs(e),s=null===e?null:ns.get(e)??_e;this._applyTextureOption("minfilter","minFilter",t,s)}get minFilter(){return this._minFilter}set mipmaps(e){this._mipmaps=e,this._applyTextureOption("mipmaps","mipmaps",e,e)}get mipmaps(){return this._mipmaps}set srgb(e){this._srgb=e,this._applyTextureOption("srgb","srgb",e,e)}get srgb(){return this._srgb}static get(e){const t=document.querySelector(`pc-asset[id="${e}"]`);return t?.asset}static get observedAttributes(){return["address-u","address-v","anisotropy","flip-y","lazy","mag-filter","min-filter","mipmaps","srgb"]}attributeChangedCallback(e,t,s){switch(e){case"address-u":this.addressU=null!==s?Wt(s,is,"repeat",e):null;break;case"address-v":this.addressV=null!==s?Wt(s,is,"repeat",e):null;break;case"anisotropy":this.anisotropy=null!==s?Kt(s,1,e):null;break;case"flip-y":this.flipY=null!==s?Lt(s,!1):null;break;case"lazy":this.lazy=Lt(s,!1);break;case"mag-filter":this.magFilter=null!==s?Wt(s,os,"linear",e):null;break;case"min-filter":this.minFilter=null!==s?Wt(s,ns,"linear-mip-linear",e):null;break;case"mipmaps":this.mipmaps=null!==s?Lt(s,!0):null;break;case"srgb":this.srgb=null!==s?Lt(s,!1):null}}}customElements.define("pc-asset",bs);const ds=e=>{const t=bs.get(e);return t&&t.registry?.load(t),t};class us extends Tt{_componentName;_enabled=!0;_component=null;_appElement=null;_hostElement=null;_hostReadyListener=null;_connectionGeneration=0;constructor(e){super(),this._componentName=e}getInitialComponentData(){return{}}_applyComponent(){const e=this._hostElement?.entity??null;if(this._component&&this._component.entity===e)return;const t=this._component;if(t?.entity&&t.entity.c[this._componentName]===t&&t.entity.removeComponent(this._componentName),this._component=null,e){if(e.c[this._componentName]){const t=this.id?` '${this.id}'`:"";return void console.warn(`${this.tagName.toLowerCase()}${t} - '${e.name}' already has a '${this._componentName}' component - component not added`)}this._component=e.addComponent(this._componentName,this.getInitialComponentData())}}async _addComponent(){const e=this._connectionGeneration,t=this.closestEntity;if(!t){const e=this.id?` '${this.id}'`:"";return void console.warn(`${this.tagName.toLowerCase()}${e} must be a descendant of pc-entity - component not added`)}await t.ready(),e===this._connectionGeneration&&(this._hostElement=t,this._applyComponent(),this._hostReadyListener=t=>{t.target===this._hostElement&&e===this._connectionGeneration&&this._hostCycled()},t.addEventListener("ready",this._hostReadyListener))}_hostCycled(){this._resetReady(),this._applyComponent(),this._hostElement?.entity&&(this.initComponent(),this._onReady())}initComponent(){}async connectedCallback(){const e=++this._connectionGeneration;this._appElement=this.closestApp??null,await(this._appElement?.ready()),e===this._connectionGeneration&&(await this._addComponent(),e===this._connectionGeneration&&(this.initComponent(),this._onReady()))}disconnectedCallback(){this._connectionGeneration++,this._hostElement&&this._hostReadyListener&&this._hostElement.removeEventListener("ready",this._hostReadyListener),this._hostElement=null,this._hostReadyListener=null,this._appElement?.app&&this._component?.entity&&this._component.entity.removeComponent(this._componentName),this._component=null,this._appElement=null,this._resetReady()}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,s){if("enabled"===e)this.enabled=Lt(s,!0)}}class ms extends us{constructor(){super("audiolistener")}get component(){return super.component}}customElements.define("pc-listener",ms);const gs=new Map([["tint",Ee],["sprite",je]]);class fs extends us{_active=!0;_image="";_hitPadding=new i(0,0,0,0);_transitionMode="tint";_hoverTint=new a(1,1,1,1);_pressedTint=new a(1,1,1,1);_inactiveTint=new a(1,1,1,1);_fadeDuration=0;_hoverSpriteAsset="";_hoverSpriteFrame=0;_pressedSpriteAsset="";_pressedSpriteFrame=0;_inactiveSpriteAsset="";_inactiveSpriteFrame=0;constructor(){super("button")}getInitialComponentData(){const e={active:this._active,hitPadding:this._hitPadding,transitionMode:gs.get(this._transitionMode),hoverTint:this._hoverTint,pressedTint:this._pressedTint,inactiveTint:this._inactiveTint,fadeDuration:this._fadeDuration,hoverSpriteFrame:this._hoverSpriteFrame,pressedSpriteFrame:this._pressedSpriteFrame,inactiveSpriteFrame:this._inactiveSpriteFrame},t=this._image?Vt(this._image):this.closestEntity?.entity;t&&(e.imageEntity=t);const s=ds(this._hoverSpriteAsset);s&&(e.hoverSpriteAsset=s.id);const a=ds(this._pressedSpriteAsset);a&&(e.pressedSpriteAsset=a.id);const i=ds(this._inactiveSpriteAsset);return i&&(e.inactiveSpriteAsset=i.id),e}get component(){return super.component}set active(e){this._active=e,this.component&&(this.component.active=e)}get active(){return this._active}set image(e){this._image=e;const t=Vt(e);this.component&&t&&(this.component.imageEntity=t)}get image(){return this._image}set hitPadding(e){this._hitPadding=e,this.component&&(this.component.hitPadding=e)}get hitPadding(){return this._hitPadding}set transitionMode(e){this._transitionMode=e,this.component&&(this.component.transitionMode=gs.get(e)??Ee)}get transitionMode(){return this._transitionMode}set hoverTint(e){this._hoverTint=e,this.component&&(this.component.hoverTint=e)}get hoverTint(){return this._hoverTint}set pressedTint(e){this._pressedTint=e,this.component&&(this.component.pressedTint=e)}get pressedTint(){return this._pressedTint}set inactiveTint(e){this._inactiveTint=e,this.component&&(this.component.inactiveTint=e)}get inactiveTint(){return this._inactiveTint}set fadeDuration(e){this._fadeDuration=e,this.component&&(this.component.fadeDuration=e)}get fadeDuration(){return this._fadeDuration}set hoverSpriteAsset(e){this._hoverSpriteAsset=e;const t=ds(e);this.component&&t&&(this.component.hoverSpriteAsset=t.id)}get hoverSpriteAsset(){return this._hoverSpriteAsset}set hoverSpriteFrame(e){this._hoverSpriteFrame=e,this.component&&(this.component.hoverSpriteFrame=e)}get hoverSpriteFrame(){return this._hoverSpriteFrame}set pressedSpriteAsset(e){this._pressedSpriteAsset=e;const t=ds(e);this.component&&t&&(this.component.pressedSpriteAsset=t.id)}get pressedSpriteAsset(){return this._pressedSpriteAsset}set pressedSpriteFrame(e){this._pressedSpriteFrame=e,this.component&&(this.component.pressedSpriteFrame=e)}get pressedSpriteFrame(){return this._pressedSpriteFrame}set inactiveSpriteAsset(e){this._inactiveSpriteAsset=e;const t=ds(e);this.component&&t&&(this.component.inactiveSpriteAsset=t.id)}get inactiveSpriteAsset(){return this._inactiveSpriteAsset}set inactiveSpriteFrame(e){this._inactiveSpriteFrame=e,this.component&&(this.component.inactiveSpriteFrame=e)}get inactiveSpriteFrame(){return this._inactiveSpriteFrame}static get observedAttributes(){return[...super.observedAttributes,"active","image","hit-padding","transition-mode","hover-tint","pressed-tint","inactive-tint","fade-duration","hover-sprite-asset","hover-sprite-frame","pressed-sprite-asset","pressed-sprite-frame","inactive-sprite-asset","inactive-sprite-frame"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"active":this.active=Lt(s,!0);break;case"image":this.image=s??"";break;case"hit-padding":this.hitPadding=Yt(s,i.ZERO,e);break;case"transition-mode":this.transitionMode=Wt(s,gs,"tint",e);break;case"hover-tint":this.hoverTint=qt(s,a.WHITE,e);break;case"pressed-tint":this.pressedTint=qt(s,a.WHITE,e);break;case"inactive-tint":this.inactiveTint=qt(s,a.WHITE,e);break;case"fade-duration":this.fadeDuration=Kt(s,0,e);break;case"hover-sprite-asset":this.hoverSpriteAsset=s??"";break;case"hover-sprite-frame":this.hoverSpriteFrame=Kt(s,0,e);break;case"pressed-sprite-asset":this.pressedSpriteAsset=s??"";break;case"pressed-sprite-frame":this.pressedSpriteFrame=Kt(s,0,e);break;case"inactive-sprite-asset":this.inactiveSpriteAsset=s??"";break;case"inactive-sprite-frame":this.inactiveSpriteFrame=Kt(s,0,e)}}}customElements.define("pc-button",fs);const _s=new Map([["perspective",Oe],["orthographic",qe]]),vs=new Map([["none",Re],["linear",Pe],["filmic",Ge],["hejl",Ue],["aces",De],["aces2",Be],["neutral",Le]]);class ys extends us{_clearColor=new a(.75,.75,.75,1);_clearColorBuffer=!0;_clearDepthBuffer=!0;_clearStencilBuffer=!1;_cullFaces=!0;_farClip=1e3;_flipFaces=!1;_fov=45;_frustumCulling=!0;_gamma="srgb";_horizontalFov=!1;_nearClip=.1;_projection="perspective";_orthoHeight=10;_priority=0;_rect=new i(0,0,1,1);_scissorRect=new i(0,0,1,1);_tonemap="none";constructor(){super("camera")}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?ze:Te,horizontalFov:this._horizontalFov,nearClip:this._nearClip,projection:_s.get(this._projection)??Oe,orthoHeight:this._orthoHeight,priority:this._priority,rect:this._rect,scissorRect:this._scissorRect,toneMapping:vs.get(this._tonemap)??Re}}get xrAvailable(){const e=this.component?.system.app.xr;return e&&e.supported&&e.isAvailable(He)}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?ze:Te)}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 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 projection(e){this._projection=e,this.component&&(this.component.projection=_s.get(e)??Oe)}get projection(){return this._projection}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){this._tonemap=e,this.component&&(this.component.toneMapping=vs.get(e)??Re)}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","ortho-height","priority","projection","rect","scissor-rect","tonemap"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"clear-color":this.clearColor=qt(s,new a(.75,.75,.75,1),e);break;case"clear-color-buffer":this.clearColorBuffer=Lt(s,!0);break;case"clear-depth-buffer":this.clearDepthBuffer=Lt(s,!0);break;case"clear-stencil-buffer":this.clearStencilBuffer=Lt(s,!1);break;case"cull-faces":this.cullFaces=Lt(s,!0);break;case"far-clip":this.farClip=Kt(s,1e3,e);break;case"flip-faces":this.flipFaces=Lt(s,!1);break;case"fov":this.fov=Kt(s,45,e);break;case"frustum-culling":this.frustumCulling=Lt(s,!0);break;case"gamma":this.gamma=Wt(s,["linear","srgb"],"srgb",e);break;case"horizontal-fov":this.horizontalFov=Lt(s,!1);break;case"near-clip":this.nearClip=Kt(s,.1,e);break;case"ortho-height":this.orthoHeight=Kt(s,10,e);break;case"priority":this.priority=Kt(s,0,e);break;case"projection":this.projection=Wt(s,_s,"perspective",e);break;case"rect":this.rect=Yt(s,new i(0,0,1,1),e);break;case"scissor-rect":this.scissorRect=Yt(s,new i(0,0,1,1),e);break;case"tonemap":this.tonemap=Wt(s,vs,"none",e)}}}customElements.define("pc-camera",ys);class ks extends us{_angularOffset=new n;_axis=1;_convexHull=!1;_halfExtents=new s(.5,.5,.5);_height=2;_linearOffset=new s;_radius=.5;_type="box";constructor(){super("collision")}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}}initComponent(){this._applyMeshGeometryDefault()}_applyMeshGeometryDefault(){const e=this.component;if(!e||"mesh"!==this._type||null!==e.renderAsset)return;const t=e.entity.render?.asset??null;null!==t?e.renderAsset=t:console.warn(`pc-collision type="mesh" on '${e.entity.name}' found no asset-backed render component to take geometry from - collider has no shape`)}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,this._applyMeshGeometryDefault())}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,t,a){switch(super.attributeChangedCallback(e,t,a),e){case"angular-offset":this.angularOffset=Qt(a,n.IDENTITY,e);break;case"axis":this.axis=Kt(a,1,e);break;case"convex-hull":this.convexHull=Lt(a,!1);break;case"half-extents":this.halfExtents=Jt(a,new s(.5,.5,.5),e);break;case"height":this.height=Kt(a,2,e);break;case"linear-offset":this.linearOffset=Jt(a,s.ZERO,e);break;case"radius":this.radius=Kt(a,.5,e);break;case"type":this.type=Wt(a,["box","capsule","compound","cone","cylinder","mesh","sphere"],"box",e)}}}customElements.define("pc-collision",ks);class ws extends us{_anchor=new i(.5,.5,.5,.5);_autoWidth=!0;_autoHeight=!0;_autoFitWidth=!1;_autoFitHeight=!1;_color=new a(1,1,1,1);_enableMarkup=!1;_fontAsset="";_fontSize=32;_maxFontSize=32;_minFontSize=8;_height=0;_lineHeight=32;_margin=null;_mask=!1;_opacity=1;_pivot=new o(.5,.5);_pixelsPerUnit=null;_spriteAsset="";_spriteFrame=0;_text="";_textureAsset="";_type="group";_useInput=!1;_width=0;_wrapLines=!1;constructor(){super("element")}initComponent(){const e=this.component;e&&(e._text?._material&&(e._text._material.useFog=!0),e._dirtifyMask?.())}getInitialComponentData(){const e={anchor:this._anchor,autoWidth:this._autoWidth,autoHeight:this._autoHeight,autoFitWidth:this._autoFitWidth,autoFitHeight:this._autoFitHeight,color:this._color,enableMarkup:this._enableMarkup,fontSize:this._fontSize,maxFontSize:this._maxFontSize,minFontSize:this._minFontSize,height:this._height,lineHeight:this._lineHeight,mask:this._mask,opacity:this._opacity,pivot:this._pivot,spriteFrame:this._spriteFrame,type:this._type,text:this._text,useInput:this._useInput,width:this._width,wrapLines:this._wrapLines},t=ds(this._fontAsset);t&&(e.fontAsset=t.id);const s=ds(this._spriteAsset);s&&(e.spriteAsset=s.id);const a=ds(this._textureAsset);return a&&(e.textureAsset=a.id),this._margin&&(e.margin=this._margin),null!==this._pixelsPerUnit&&(e.pixelsPerUnit=this._pixelsPerUnit),e}get component(){return super.component}set anchor(e){this._anchor=e,this.component&&(this.component.anchor=e)}get anchor(){return this._anchor}set autoWidth(e){this._autoWidth=e,this.component&&(this.component.autoWidth=e)}get autoWidth(){return this._autoWidth}set autoHeight(e){this._autoHeight=e,this.component&&(this.component.autoHeight=e)}get autoHeight(){return this._autoHeight}set color(e){this._color=e,this.component&&(this.component.color=e)}get color(){return this._color}set enableMarkup(e){this._enableMarkup=e,this.component&&(this.component.enableMarkup=e)}get enableMarkup(){return this._enableMarkup}set fontAsset(e){this._fontAsset=e;const t=ds(e);this.component&&t&&(this.component.fontAsset=t.id)}get fontAsset(){return this._fontAsset}set fontSize(e){this._fontSize=e,this.component&&(this.component.fontSize=e)}get fontSize(){return this._fontSize}set height(e){this._height=e,this.component&&(this.component.height=e)}get height(){return this._height}set lineHeight(e){this._lineHeight=e,this.component&&(this.component.lineHeight=e)}get lineHeight(){return this._lineHeight}set margin(e){this._margin=e,this.component&&e&&(this.component.margin=e)}get margin(){return this._margin}set mask(e){this._mask=e,this.component&&(this.component.mask=e)}get mask(){return this._mask}set opacity(e){this._opacity=e,this.component&&(this.component.opacity=e)}get opacity(){return this._opacity}set pivot(e){this._pivot=e,this.component&&(this.component.pivot=e)}get pivot(){return this._pivot}set pixelsPerUnit(e){this._pixelsPerUnit=e,this.component&&null!==e&&(this.component.pixelsPerUnit=e)}get pixelsPerUnit(){return this._pixelsPerUnit}set spriteAsset(e){this._spriteAsset=e;const t=ds(e);this.component&&t&&(this.component.spriteAsset=t.id)}get spriteAsset(){return this._spriteAsset}set spriteFrame(e){this._spriteFrame=e,this.component&&(this.component.spriteFrame=e)}get spriteFrame(){return this._spriteFrame}set text(e){this._text=e,this.component&&(this.component.text=e)}get text(){return this._text}set textureAsset(e){this._textureAsset=e;const t=ds(e);this.component&&t&&(this.component.textureAsset=t.id)}get textureAsset(){return this._textureAsset}set type(e){this._type=e,this.component&&(this.component.type=e)}get type(){return this._type}set useInput(e){this._useInput=e,this.component&&(this.component.useInput=e)}get useInput(){return this._useInput}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}set autoFitWidth(e){this._autoFitWidth=e,this.component&&(this.component.autoFitWidth=e)}get autoFitWidth(){return this._autoFitWidth}set autoFitHeight(e){this._autoFitHeight=e,this.component&&(this.component.autoFitHeight=e)}get autoFitHeight(){return this._autoFitHeight}set minFontSize(e){this._minFontSize=e,this.component&&(this.component.minFontSize=e)}get minFontSize(){return this._minFontSize}set maxFontSize(e){this._maxFontSize=e,this.component&&(this.component.maxFontSize=e)}get maxFontSize(){return this._maxFontSize}static get observedAttributes(){return[...super.observedAttributes,"anchor","auto-width","auto-height","auto-fit-width","auto-fit-height","color","enable-markup","font-asset","font-size","max-font-size","min-font-size","height","line-height","margin","mask","opacity","pivot","pixels-per-unit","sprite-asset","sprite-frame","text","texture-asset","type","use-input","width","wrap-lines"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"anchor":this.anchor=Yt(s,new i(.5,.5,.5,.5),e);break;case"auto-width":this.autoWidth=Lt(s,!0);break;case"auto-height":this.autoHeight=Lt(s,!0);break;case"auto-fit-width":this.autoFitWidth=Lt(s,!1);break;case"auto-fit-height":this.autoFitHeight=Lt(s,!1);break;case"color":this.color=qt(s,a.WHITE,e);break;case"enable-markup":this.enableMarkup=Lt(s,!1);break;case"font-asset":this.fontAsset=s??"";break;case"font-size":this.fontSize=Kt(s,32,e);break;case"max-font-size":this.maxFontSize=Kt(s,32,e);break;case"min-font-size":this.minFontSize=Kt(s,8,e);break;case"height":this.height=Kt(s,0,e);break;case"line-height":this.lineHeight=Kt(s,32,e);break;case"margin":this.margin=Yt(s,null,e);break;case"mask":this.mask=Lt(s,!1);break;case"opacity":this.opacity=Kt(s,1,e);break;case"pivot":this.pivot=$t(s,new o(.5,.5),e);break;case"pixels-per-unit":this.pixelsPerUnit=Kt(s,null,e);break;case"sprite-asset":this.spriteAsset=s??"";break;case"sprite-frame":this.spriteFrame=Kt(s,0,e);break;case"text":this.text=s??"";break;case"texture-asset":this.textureAsset=s??"";break;case"type":this.type=Wt(s,["group","image","text"],"group",e);break;case"use-input":this.useInput=Lt(s,!1);break;case"width":this.width=Kt(s,0,e);break;case"wrap-lines":this.wrapLines=Lt(s,!1)}}}customElements.define("pc-element",ws);class Ms extends us{_minWidth=0;_minHeight=0;_maxWidth=null;_maxHeight=null;_fitWidthProportion=0;_fitHeightProportion=0;_excludeFromLayout=!1;constructor(){super("layoutchild")}getInitialComponentData(){return{minWidth:this._minWidth,minHeight:this._minHeight,maxWidth:this._maxWidth,maxHeight:this._maxHeight,fitWidthProportion:this._fitWidthProportion,fitHeightProportion:this._fitHeightProportion,excludeFromLayout:this._excludeFromLayout}}get component(){return super.component}set minWidth(e){this._minWidth=e,this.component&&(this.component.minWidth=e)}get minWidth(){return this._minWidth}set minHeight(e){this._minHeight=e,this.component&&(this.component.minHeight=e)}get minHeight(){return this._minHeight}set maxWidth(e){this._maxWidth=e,this.component&&(this.component.maxWidth=e)}get maxWidth(){return this._maxWidth}set maxHeight(e){this._maxHeight=e,this.component&&(this.component.maxHeight=e)}get maxHeight(){return this._maxHeight}set fitWidthProportion(e){this._fitWidthProportion=e,this.component&&(this.component.fitWidthProportion=e)}get fitWidthProportion(){return this._fitWidthProportion}set fitHeightProportion(e){this._fitHeightProportion=e,this.component&&(this.component.fitHeightProportion=e)}get fitHeightProportion(){return this._fitHeightProportion}set excludeFromLayout(e){this._excludeFromLayout=e,this.component&&(this.component.excludeFromLayout=e)}get excludeFromLayout(){return this._excludeFromLayout}static get observedAttributes(){return[...super.observedAttributes,"min-width","min-height","max-width","max-height","fit-width-proportion","fit-height-proportion","exclude-from-layout"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"min-width":this.minWidth=Kt(s,0,e);break;case"min-height":this.minHeight=Kt(s,0,e);break;case"max-width":this.maxWidth=Kt(s,null,e);break;case"max-height":this.maxHeight=Kt(s,null,e);break;case"fit-width-proportion":this.fitWidthProportion=Kt(s,0,e);break;case"fit-height-proportion":this.fitHeightProportion=Kt(s,0,e);break;case"exclude-from-layout":this.excludeFromLayout=Lt(s,!1)}}}customElements.define("pc-layoutchild",Ms);const xs=new Map([["horizontal",We],["vertical",Je]]),Ss=new Map([["none",Ke],["stretch",Qe],["shrink",Ie],["both",$e]]);class Cs extends us{_orientation="horizontal";_reverseX=!1;_reverseY=!1;_alignment=new o(0,1);_padding=new i(0,0,0,0);_spacing=new o(0,0);_widthFitting="none";_heightFitting="none";_wrap=!1;constructor(){super("layoutgroup")}getInitialComponentData(){return{orientation:xs.get(this._orientation),reverseX:this._reverseX,reverseY:this._reverseY,alignment:this._alignment,padding:this._padding,spacing:this._spacing,widthFitting:Ss.get(this._widthFitting),heightFitting:Ss.get(this._heightFitting),wrap:this._wrap}}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=xs.get(e)??We)}get orientation(){return this._orientation}set reverseX(e){this._reverseX=e,this.component&&(this.component.reverseX=e)}get reverseX(){return this._reverseX}set reverseY(e){this._reverseY=e,this.component&&(this.component.reverseY=e)}get reverseY(){return this._reverseY}set alignment(e){this._alignment=e,this.component&&(this.component.alignment=e)}get alignment(){return this._alignment}set padding(e){this._padding=e,this.component&&(this.component.padding=e)}get padding(){return this._padding}set spacing(e){this._spacing=e,this.component&&(this.component.spacing=e)}get spacing(){return this._spacing}set widthFitting(e){this._widthFitting=e,this.component&&(this.component.widthFitting=Ss.get(e)??Ke)}get widthFitting(){return this._widthFitting}set heightFitting(e){this._heightFitting=e,this.component&&(this.component.heightFitting=Ss.get(e)??Ke)}get heightFitting(){return this._heightFitting}set wrap(e){this._wrap=e,this.component&&(this.component.wrap=e)}get wrap(){return this._wrap}static get observedAttributes(){return[...super.observedAttributes,"orientation","reverse-x","reverse-y","alignment","padding","spacing","width-fitting","height-fitting","wrap"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"orientation":this.orientation=Wt(s,xs,"horizontal",e);break;case"reverse-x":this.reverseX=Lt(s,!1);break;case"reverse-y":this.reverseY=Lt(s,!1);break;case"alignment":this.alignment=$t(s,new o(0,1),e);break;case"padding":this.padding=Yt(s,i.ZERO,e);break;case"spacing":this.spacing=$t(s,o.ZERO,e);break;case"width-fitting":this.widthFitting=Wt(s,Ss,"none",e);break;case"height-fitting":this.heightFitting=Wt(s,Ss,"none",e);break;case"wrap":this.wrap=Lt(s,!1)}}}customElements.define("pc-layoutgroup",Cs);const As=new Map([["pcf1-16f",Ve],["pcf1-32f",Ne],["pcf3-16f",Xe],["pcf3-32f",Ye],["pcf5-16f",Ze],["pcf5-32f",et],["vsm-16f",tt],["vsm-32f",st],["pcss-32f",at]]);class Fs extends us{_castShadows=!1;_color=new a(1,1,1);_innerConeAngle=40;_intensity=1;_normalOffsetBias=.05;_outerConeAngle=45;_range=10;_shadowBias=.2;_shadowDistance=16;_shadowIntensity=1;_shadowResolution=1024;_shadowType="pcf3-32f";_type="directional";_vsmBias=.01;_vsmBlurSize=11;_penumbraSize=1;_penumbraFalloff=1;_shadowSamples=16;_shadowBlockerSamples=16;constructor(){super("light")}getInitialComponentData(){return{castShadows:this._castShadows,color:this._color,innerConeAngle:this._innerConeAngle,intensity:this._intensity,normalOffsetBias:this._normalOffsetBias,outerConeAngle:this._outerConeAngle,penumbraFalloff:this._penumbraFalloff,penumbraSize:this._penumbraSize,range:this._range,shadowBias:this._shadowBias,shadowBlockerSamples:this._shadowBlockerSamples,shadowDistance:this._shadowDistance,shadowIntensity:this._shadowIntensity,shadowResolution:this._shadowResolution,shadowSamples:this._shadowSamples,shadowType:As.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){this._shadowType=e,this.component&&(this.component.shadowType=As.get(e)??Ye)}get shadowType(){return this._shadowType}set type(e){this._type=e,this.component&&(this.component.type=e)}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}set penumbraSize(e){this._penumbraSize=e,this.component&&(this.component.penumbraSize=e)}get penumbraSize(){return this._penumbraSize}set penumbraFalloff(e){this._penumbraFalloff=e,this.component&&(this.component.penumbraFalloff=e)}get penumbraFalloff(){return this._penumbraFalloff}set shadowSamples(e){this._shadowSamples=e,this.component&&(this.component.shadowSamples=e)}get shadowSamples(){return this._shadowSamples}set shadowBlockerSamples(e){this._shadowBlockerSamples=e,this.component&&(this.component.shadowBlockerSamples=e)}get shadowBlockerSamples(){return this._shadowBlockerSamples}static get observedAttributes(){return[...super.observedAttributes,"color","cast-shadows","intensity","inner-cone-angle","normal-offset-bias","outer-cone-angle","penumbra-falloff","penumbra-size","range","shadow-bias","shadow-blocker-samples","shadow-distance","shadow-intensity","shadow-resolution","shadow-samples","shadow-type","type","vsm-bias","vsm-blur-size"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"color":this.color=qt(s,a.WHITE,e);break;case"cast-shadows":this.castShadows=Lt(s,!1);break;case"inner-cone-angle":this.innerConeAngle=Kt(s,40,e);break;case"intensity":this.intensity=Kt(s,1,e);break;case"normal-offset-bias":this.normalOffsetBias=Kt(s,.05,e);break;case"outer-cone-angle":this.outerConeAngle=Kt(s,45,e);break;case"penumbra-falloff":this.penumbraFalloff=Kt(s,1,e);break;case"penumbra-size":this.penumbraSize=Kt(s,1,e);break;case"range":this.range=Kt(s,10,e);break;case"shadow-bias":this.shadowBias=Kt(s,.2,e);break;case"shadow-distance":this.shadowDistance=Kt(s,16,e);break;case"shadow-blocker-samples":this.shadowBlockerSamples=Kt(s,16,e);break;case"shadow-resolution":this.shadowResolution=Kt(s,1024,e);break;case"shadow-intensity":this.shadowIntensity=Kt(s,1,e);break;case"shadow-samples":this.shadowSamples=Kt(s,16,e);break;case"shadow-type":this.shadowType=Wt(s,As,"pcf3-32f",e);break;case"type":this.type=Wt(s,["directional","omni","spot"],"directional",e);break;case"vsm-bias":this.vsmBias=Kt(s,.01,e);break;case"vsm-blur-size":this.vsmBlurSize=Kt(s,11,e)}}}customElements.define("pc-light",Fs);class Es extends us{_asset="";constructor(){super("particlesystem")}getInitialComponentData(){const e=ds(this._asset);if(!e||!e.resource)return{};if(e.resource.colorMapAsset){const t=e.resource.colorMapAsset,s=ds(t)?.id;s&&(e.resource.colorMapAsset=s)}return e.resource}get component(){return super.component}applyConfig(e){if(this.component)for(const t in e)Object.hasOwn(e,t)&&(this.component[t]=e[t])}async _loadAsset(){await(this.closestApp?.ready());const e=ds(this._asset);e&&(e.loaded?this.applyConfig(e.resource):e.once("load",()=>{this.applyConfig(e.resource)}))}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,s){if(super.attributeChangedCallback(e,t,s),"asset"===e)this.asset=s??""}}customElements.define("pc-particles",Es);const js=new Map([["none",nt],["normal",ht],["additive",lt],["additive-alpha",pt],["premultiplied",bt],["multiplicative",dt],["multiplicative-2x",ut],["screen",mt],["min",gt],["max",ft],["subtractive",_t]]),Rs=new Map([["none",vt],["back",ot],["front",yt],["front-and-back",kt]]),Os=new Map([["none",wt],["schlick",rt]]),zs=new Map([["none",Mt],["ao",ct],["gloss-dependent",xt]]),Ts=["none","bayer8","bluenoise","ignnoise"],Hs=["r","g","b","a","rgb"],Ps=["r","g","b","a"],Gs=["gloss","gloss-invert","gloss-map"],Us=["roughness","roughness-map"];class Ds extends HTMLElement{_alphaTest=0;_alphaToCoverage=!1;_aoIntensity=1;_aoMap="";_aoMapChannel="g";_aoMapOffset=new o(0,0);_aoMapRotation=0;_aoMapTiling=new o(1,1);_aoMapUv=0;_blendType="none";_bumpiness=1;_cull="back";_depthBias=0;_depthTest=!0;_depthWrite=!0;_diffuse=new a(1,1,1);_diffuseMap="";_diffuseMapChannel="rgb";_diffuseMapOffset=new o(0,0);_diffuseMapRotation=0;_diffuseMapTiling=new o(1,1);_diffuseMapUv=0;_emissive=new a(0,0,0);_emissiveIntensity=1;_emissiveMap="";_emissiveMapChannel="rgb";_emissiveMapOffset=new o(0,0);_emissiveMapRotation=0;_emissiveMapTiling=new o(1,1);_emissiveMapUv=0;_enableGGXSpecular=!1;_fresnelModel="schlick";_gloss=.25;_glossInvert=!1;_glossMap="";_glossMapChannel="g";_glossMapOffset=new o(0,0);_glossMapRotation=0;_glossMapTiling=new o(1,1);_glossMapUv=0;_heightMap="";_heightMapChannel="g";_heightMapFactor=1;_heightMapOffset=new o(0,0);_heightMapRotation=0;_heightMapTiling=new o(1,1);_heightMapUv=0;_metalness=0;_metalnessMap="";_metalnessMapChannel="g";_metalnessMapOffset=new o(0,0);_metalnessMapRotation=0;_metalnessMapTiling=new o(1,1);_metalnessMapUv=0;_normalMap="";_normalMapOffset=new o(0,0);_normalMapRotation=0;_normalMapTiling=new o(1,1);_normalMapUv=0;_occludeDirect=!1;_occludeSpecular="ao";_opacity=1;_opacityDither="none";_opacityFadesSpecular=!0;_opacityMap="";_opacityMapChannel="a";_opacityMapOffset=new o(0,0);_opacityMapRotation=0;_opacityMapTiling=new o(1,1);_opacityMapUv=0;_slopeDepthBias=0;_specular=new a(0,0,0);_specularityFactor=1;_twoSidedLighting=!1;_useFog=!0;_useLighting=!0;_useMetalness=!0;_useMetalnessSpecularColor=!1;_useSkybox=!0;_useTonemap=!0;_mapHandles=new Map;_updateScheduled=!1;_glossConflictWarned=!1;material=null;async connectedCallback(){const e=this.parentElement?.closest("pc-app")??null;if(e&&this.parentElement===e){if(await e.ready(),this.isConnected&&this.parentElement===e&&!this.material){if(!e.app)return;this._createMaterial()}}else console.warn(`pc-material '${this.id}' must be a direct child of pc-app - material not created`)}_createMaterial(){const e=new it;this.material=e,e.alphaTest=this._alphaTest,e.alphaToCoverage=this._alphaToCoverage,e.aoIntensity=this._aoIntensity,e.aoMapChannel=this._aoMapChannel,e.aoMapOffset=this._aoMapOffset,e.aoMapRotation=this._aoMapRotation,e.aoMapTiling=this._aoMapTiling,e.aoMapUv=this._aoMapUv,e.blendType=js.get(this._blendType)??nt,e.bumpiness=this._bumpiness,e.cull=Rs.get(this._cull)??ot,e.depthBias=this._depthBias,e.depthTest=this._depthTest,e.depthWrite=this._depthWrite,e.diffuse=this._diffuse,e.diffuseMapChannel=this._diffuseMapChannel,e.diffuseMapOffset=this._diffuseMapOffset,e.diffuseMapRotation=this._diffuseMapRotation,e.diffuseMapTiling=this._diffuseMapTiling,e.diffuseMapUv=this._diffuseMapUv,e.emissive=this._emissive,e.emissiveIntensity=this._emissiveIntensity,e.emissiveMapChannel=this._emissiveMapChannel,e.emissiveMapOffset=this._emissiveMapOffset,e.emissiveMapRotation=this._emissiveMapRotation,e.emissiveMapTiling=this._emissiveMapTiling,e.emissiveMapUv=this._emissiveMapUv,e.enableGGXSpecular=this._enableGGXSpecular,e.fresnelModel=Os.get(this._fresnelModel)??rt,e.gloss=this._gloss,e.glossInvert=this._glossInvert,e.glossMapChannel=this._glossMapChannel,e.glossMapOffset=this._glossMapOffset,e.glossMapRotation=this._glossMapRotation,e.glossMapTiling=this._glossMapTiling,e.glossMapUv=this._glossMapUv,e.heightMapChannel=this._heightMapChannel,e.heightMapFactor=this._heightMapFactor,e.heightMapOffset=this._heightMapOffset,e.heightMapRotation=this._heightMapRotation,e.heightMapTiling=this._heightMapTiling,e.heightMapUv=this._heightMapUv,e.metalness=this._metalness,e.metalnessMapChannel=this._metalnessMapChannel,e.metalnessMapOffset=this._metalnessMapOffset,e.metalnessMapRotation=this._metalnessMapRotation,e.metalnessMapTiling=this._metalnessMapTiling,e.metalnessMapUv=this._metalnessMapUv,e.normalMapOffset=this._normalMapOffset,e.normalMapRotation=this._normalMapRotation,e.normalMapTiling=this._normalMapTiling,e.normalMapUv=this._normalMapUv,e.occludeDirect=this._occludeDirect,e.occludeSpecular=zs.get(this._occludeSpecular)??ct,e.opacity=this._opacity,e.opacityDither=this._opacityDither,e.opacityFadesSpecular=this._opacityFadesSpecular,e.opacityMapChannel=this._opacityMapChannel,e.opacityMapOffset=this._opacityMapOffset,e.opacityMapRotation=this._opacityMapRotation,e.opacityMapTiling=this._opacityMapTiling,e.opacityMapUv=this._opacityMapUv,e.slopeDepthBias=this._slopeDepthBias,e.specular=this._specular,e.specularityFactor=this._specularityFactor,e.twoSidedLighting=this._twoSidedLighting,e.useFog=this._useFog,e.useLighting=this._useLighting,e.useMetalness=this._useMetalness,e.useMetalnessSpecularColor=this._useMetalnessSpecularColor,e.useSkybox=this._useSkybox,e.useTonemap=this._useTonemap,this.aoMap=this._aoMap,this.diffuseMap=this._diffuseMap,this.emissiveMap=this._emissiveMap,this.glossMap=this._glossMap,this.heightMap=this._heightMap,this.metalnessMap=this._metalnessMap,this.normalMap=this._normalMap,this.opacityMap=this._opacityMap,e.update()}disconnectedCallback(){for(const e of this._mapHandles.values())e.off();this._mapHandles.clear(),this.material&&(this.material.destroy(),this.material=null)}_scheduleUpdate(){this._updateScheduled||(this._updateScheduled=!0,queueMicrotask(()=>{this._updateScheduled=!1,this.material?.update()}))}_warnGlossConflict(){const e=e=>`'${e.join("', '")}'`,t=Us.filter(e=>this.hasAttribute(e)),s=Gs.filter(e=>this.hasAttribute(e));0!==t.length&&0!==s.length?this._glossConflictWarned||(this._glossConflictWarned=!0,console.warn(`pc-material '${this.id}' sets both ${e(t)} and ${e(s)} - the roughness-* attributes invert gloss, so the two families contradict each other. Use one or the other.`)):this._glossConflictWarned=!1}_setMap(e,t){if(this._mapHandles.get(t)?.off(),this._mapHandles.delete(t),!this.material)return;if(!e)return this.material[t]=null,void this._scheduleUpdate();const s=ds(e);s&&(s.loaded?this._applyMap(t,s.resource):this._mapHandles.set(t,s.once("load",()=>{this._mapHandles.delete(t),this._applyMap(t,s.resource)})))}_applyMap(e,t){this.material&&(this.material[e]=t,this._scheduleUpdate())}set alphaTest(e){this._alphaTest=e,this.material&&(this.material.alphaTest=e,this._scheduleUpdate())}get alphaTest(){return this._alphaTest}set alphaToCoverage(e){this._alphaToCoverage=e,this.material&&(this.material.alphaToCoverage=e,this._scheduleUpdate())}get alphaToCoverage(){return this._alphaToCoverage}set aoIntensity(e){this._aoIntensity=e,this.material&&(this.material.aoIntensity=e,this._scheduleUpdate())}get aoIntensity(){return this._aoIntensity}set aoMap(e){this._aoMap=e,this._setMap(e,"aoMap")}get aoMap(){return this._aoMap}set aoMapChannel(e){this._aoMapChannel=e,this.material&&(this.material.aoMapChannel=e,this._scheduleUpdate())}get aoMapChannel(){return this._aoMapChannel}set aoMapOffset(e){this._aoMapOffset=e,this.material&&(this.material.aoMapOffset=e,this._scheduleUpdate())}get aoMapOffset(){return this._aoMapOffset}set aoMapRotation(e){this._aoMapRotation=e,this.material&&(this.material.aoMapRotation=e,this._scheduleUpdate())}get aoMapRotation(){return this._aoMapRotation}set aoMapTiling(e){this._aoMapTiling=e,this.material&&(this.material.aoMapTiling=e,this._scheduleUpdate())}get aoMapTiling(){return this._aoMapTiling}set aoMapUv(e){this._aoMapUv=e,this.material&&(this.material.aoMapUv=e,this._scheduleUpdate())}get aoMapUv(){return this._aoMapUv}set blendType(e){this._blendType=e,this.material&&(this.material.blendType=js.get(e)??nt,this._scheduleUpdate())}get blendType(){return this._blendType}set bumpiness(e){this._bumpiness=e,this.material&&(this.material.bumpiness=e,this._scheduleUpdate())}get bumpiness(){return this._bumpiness}set cull(e){this._cull=e,this.material&&(this.material.cull=Rs.get(e)??ot,this._scheduleUpdate())}get cull(){return this._cull}set depthBias(e){this._depthBias=e,this.material&&(this.material.depthBias=e,this._scheduleUpdate())}get depthBias(){return this._depthBias}set depthTest(e){this._depthTest=e,this.material&&(this.material.depthTest=e,this._scheduleUpdate())}get depthTest(){return this._depthTest}set depthWrite(e){this._depthWrite=e,this.material&&(this.material.depthWrite=e,this._scheduleUpdate())}get depthWrite(){return this._depthWrite}set diffuse(e){this._diffuse=e,this.material&&(this.material.diffuse=e,this._scheduleUpdate())}get diffuse(){return this._diffuse}set diffuseMap(e){this._diffuseMap=e,this._setMap(e,"diffuseMap")}get diffuseMap(){return this._diffuseMap}set diffuseMapChannel(e){this._diffuseMapChannel=e,this.material&&(this.material.diffuseMapChannel=e,this._scheduleUpdate())}get diffuseMapChannel(){return this._diffuseMapChannel}set diffuseMapOffset(e){this._diffuseMapOffset=e,this.material&&(this.material.diffuseMapOffset=e,this._scheduleUpdate())}get diffuseMapOffset(){return this._diffuseMapOffset}set diffuseMapRotation(e){this._diffuseMapRotation=e,this.material&&(this.material.diffuseMapRotation=e,this._scheduleUpdate())}get diffuseMapRotation(){return this._diffuseMapRotation}set diffuseMapTiling(e){this._diffuseMapTiling=e,this.material&&(this.material.diffuseMapTiling=e,this._scheduleUpdate())}get diffuseMapTiling(){return this._diffuseMapTiling}set diffuseMapUv(e){this._diffuseMapUv=e,this.material&&(this.material.diffuseMapUv=e,this._scheduleUpdate())}get diffuseMapUv(){return this._diffuseMapUv}set emissive(e){this._emissive=e,this.material&&(this.material.emissive=e,this._scheduleUpdate())}get emissive(){return this._emissive}set emissiveIntensity(e){this._emissiveIntensity=e,this.material&&(this.material.emissiveIntensity=e,this._scheduleUpdate())}get emissiveIntensity(){return this._emissiveIntensity}set emissiveMap(e){this._emissiveMap=e,this._setMap(e,"emissiveMap")}get emissiveMap(){return this._emissiveMap}set emissiveMapChannel(e){this._emissiveMapChannel=e,this.material&&(this.material.emissiveMapChannel=e,this._scheduleUpdate())}get emissiveMapChannel(){return this._emissiveMapChannel}set emissiveMapOffset(e){this._emissiveMapOffset=e,this.material&&(this.material.emissiveMapOffset=e,this._scheduleUpdate())}get emissiveMapOffset(){return this._emissiveMapOffset}set emissiveMapRotation(e){this._emissiveMapRotation=e,this.material&&(this.material.emissiveMapRotation=e,this._scheduleUpdate())}get emissiveMapRotation(){return this._emissiveMapRotation}set emissiveMapTiling(e){this._emissiveMapTiling=e,this.material&&(this.material.emissiveMapTiling=e,this._scheduleUpdate())}get emissiveMapTiling(){return this._emissiveMapTiling}set emissiveMapUv(e){this._emissiveMapUv=e,this.material&&(this.material.emissiveMapUv=e,this._scheduleUpdate())}get emissiveMapUv(){return this._emissiveMapUv}set enableGGXSpecular(e){this._enableGGXSpecular=e,this.material&&(this.material.enableGGXSpecular=e,this._scheduleUpdate())}get enableGGXSpecular(){return this._enableGGXSpecular}set fresnelModel(e){this._fresnelModel=e,this.material&&(this.material.fresnelModel=Os.get(e)??rt,this._scheduleUpdate())}get fresnelModel(){return this._fresnelModel}set gloss(e){this._gloss=e,this.material&&(this.material.gloss=e,this._scheduleUpdate())}get gloss(){return this._gloss}set glossInvert(e){this._glossInvert=e,this.material&&(this.material.glossInvert=e,this._scheduleUpdate())}get glossInvert(){return this._glossInvert}set glossMap(e){this._glossMap=e,this._setMap(e,"glossMap")}get glossMap(){return this._glossMap}set glossMapChannel(e){this._glossMapChannel=e,this.material&&(this.material.glossMapChannel=e,this._scheduleUpdate())}get glossMapChannel(){return this._glossMapChannel}set glossMapOffset(e){this._glossMapOffset=e,this.material&&(this.material.glossMapOffset=e,this._scheduleUpdate())}get glossMapOffset(){return this._glossMapOffset}set glossMapRotation(e){this._glossMapRotation=e,this.material&&(this.material.glossMapRotation=e,this._scheduleUpdate())}get glossMapRotation(){return this._glossMapRotation}set glossMapTiling(e){this._glossMapTiling=e,this.material&&(this.material.glossMapTiling=e,this._scheduleUpdate())}get glossMapTiling(){return this._glossMapTiling}set glossMapUv(e){this._glossMapUv=e,this.material&&(this.material.glossMapUv=e,this._scheduleUpdate())}get glossMapUv(){return this._glossMapUv}set heightMap(e){this._heightMap=e,this._setMap(e,"heightMap")}get heightMap(){return this._heightMap}set heightMapChannel(e){this._heightMapChannel=e,this.material&&(this.material.heightMapChannel=e,this._scheduleUpdate())}get heightMapChannel(){return this._heightMapChannel}set heightMapFactor(e){this._heightMapFactor=e,this.material&&(this.material.heightMapFactor=e,this._scheduleUpdate())}get heightMapFactor(){return this._heightMapFactor}set heightMapOffset(e){this._heightMapOffset=e,this.material&&(this.material.heightMapOffset=e,this._scheduleUpdate())}get heightMapOffset(){return this._heightMapOffset}set heightMapRotation(e){this._heightMapRotation=e,this.material&&(this.material.heightMapRotation=e,this._scheduleUpdate())}get heightMapRotation(){return this._heightMapRotation}set heightMapTiling(e){this._heightMapTiling=e,this.material&&(this.material.heightMapTiling=e,this._scheduleUpdate())}get heightMapTiling(){return this._heightMapTiling}set heightMapUv(e){this._heightMapUv=e,this.material&&(this.material.heightMapUv=e,this._scheduleUpdate())}get heightMapUv(){return this._heightMapUv}set metalness(e){this._metalness=e,this.material&&(this.material.metalness=e,this._scheduleUpdate())}get metalness(){return this._metalness}set metalnessMap(e){this._metalnessMap=e,this._setMap(e,"metalnessMap")}get metalnessMap(){return this._metalnessMap}set metalnessMapChannel(e){this._metalnessMapChannel=e,this.material&&(this.material.metalnessMapChannel=e,this._scheduleUpdate())}get metalnessMapChannel(){return this._metalnessMapChannel}set metalnessMapOffset(e){this._metalnessMapOffset=e,this.material&&(this.material.metalnessMapOffset=e,this._scheduleUpdate())}get metalnessMapOffset(){return this._metalnessMapOffset}set metalnessMapRotation(e){this._metalnessMapRotation=e,this.material&&(this.material.metalnessMapRotation=e,this._scheduleUpdate())}get metalnessMapRotation(){return this._metalnessMapRotation}set metalnessMapTiling(e){this._metalnessMapTiling=e,this.material&&(this.material.metalnessMapTiling=e,this._scheduleUpdate())}get metalnessMapTiling(){return this._metalnessMapTiling}set metalnessMapUv(e){this._metalnessMapUv=e,this.material&&(this.material.metalnessMapUv=e,this._scheduleUpdate())}get metalnessMapUv(){return this._metalnessMapUv}set normalMap(e){this._normalMap=e,this._setMap(e,"normalMap")}get normalMap(){return this._normalMap}set normalMapOffset(e){this._normalMapOffset=e,this.material&&(this.material.normalMapOffset=e,this._scheduleUpdate())}get normalMapOffset(){return this._normalMapOffset}set normalMapRotation(e){this._normalMapRotation=e,this.material&&(this.material.normalMapRotation=e,this._scheduleUpdate())}get normalMapRotation(){return this._normalMapRotation}set normalMapTiling(e){this._normalMapTiling=e,this.material&&(this.material.normalMapTiling=e,this._scheduleUpdate())}get normalMapTiling(){return this._normalMapTiling}set normalMapUv(e){this._normalMapUv=e,this.material&&(this.material.normalMapUv=e,this._scheduleUpdate())}get normalMapUv(){return this._normalMapUv}set occludeDirect(e){this._occludeDirect=e,this.material&&(this.material.occludeDirect=e,this._scheduleUpdate())}get occludeDirect(){return this._occludeDirect}set occludeSpecular(e){this._occludeSpecular=e,this.material&&(this.material.occludeSpecular=zs.get(e)??ct,this._scheduleUpdate())}get occludeSpecular(){return this._occludeSpecular}set opacity(e){this._opacity=e,this.material&&(this.material.opacity=e,this._scheduleUpdate())}get opacity(){return this._opacity}set opacityDither(e){this._opacityDither=e,this.material&&(this.material.opacityDither=e,this._scheduleUpdate())}get opacityDither(){return this._opacityDither}set opacityFadesSpecular(e){this._opacityFadesSpecular=e,this.material&&(this.material.opacityFadesSpecular=e,this._scheduleUpdate())}get opacityFadesSpecular(){return this._opacityFadesSpecular}set opacityMap(e){this._opacityMap=e,this._setMap(e,"opacityMap")}get opacityMap(){return this._opacityMap}set opacityMapChannel(e){this._opacityMapChannel=e,this.material&&(this.material.opacityMapChannel=e,this._scheduleUpdate())}get opacityMapChannel(){return this._opacityMapChannel}set opacityMapOffset(e){this._opacityMapOffset=e,this.material&&(this.material.opacityMapOffset=e,this._scheduleUpdate())}get opacityMapOffset(){return this._opacityMapOffset}set opacityMapRotation(e){this._opacityMapRotation=e,this.material&&(this.material.opacityMapRotation=e,this._scheduleUpdate())}get opacityMapRotation(){return this._opacityMapRotation}set opacityMapTiling(e){this._opacityMapTiling=e,this.material&&(this.material.opacityMapTiling=e,this._scheduleUpdate())}get opacityMapTiling(){return this._opacityMapTiling}set opacityMapUv(e){this._opacityMapUv=e,this.material&&(this.material.opacityMapUv=e,this._scheduleUpdate())}get opacityMapUv(){return this._opacityMapUv}set roughness(e){this.gloss=e,this.glossInvert=!0}get roughness(){return this._gloss}set roughnessMap(e){this.glossMap=e,this.glossInvert=!0}get roughnessMap(){return this._glossMap}set slopeDepthBias(e){this._slopeDepthBias=e,this.material&&(this.material.slopeDepthBias=e,this._scheduleUpdate())}get slopeDepthBias(){return this._slopeDepthBias}set specular(e){this._specular=e,this.material&&(this.material.specular=e,this._scheduleUpdate())}get specular(){return this._specular}set specularityFactor(e){this._specularityFactor=e,this.material&&(this.material.specularityFactor=e,this._scheduleUpdate())}get specularityFactor(){return this._specularityFactor}set twoSidedLighting(e){this._twoSidedLighting=e,this.material&&(this.material.twoSidedLighting=e,this._scheduleUpdate())}get twoSidedLighting(){return this._twoSidedLighting}set useFog(e){this._useFog=e,this.material&&(this.material.useFog=e,this._scheduleUpdate())}get useFog(){return this._useFog}set useLighting(e){this._useLighting=e,this.material&&(this.material.useLighting=e,this._scheduleUpdate())}get useLighting(){return this._useLighting}set useMetalness(e){this._useMetalness=e,this.material&&(this.material.useMetalness=e,this._scheduleUpdate())}get useMetalness(){return this._useMetalness}set useMetalnessSpecularColor(e){this._useMetalnessSpecularColor=e,this.material&&(this.material.useMetalnessSpecularColor=e,this._scheduleUpdate())}get useMetalnessSpecularColor(){return this._useMetalnessSpecularColor}set useSkybox(e){this._useSkybox=e,this.material&&(this.material.useSkybox=e,this._scheduleUpdate())}get useSkybox(){return this._useSkybox}set useTonemap(e){this._useTonemap=e,this.material&&(this.material.useTonemap=e,this._scheduleUpdate())}get useTonemap(){return this._useTonemap}static get(e){const t=document.querySelector(`pc-material[id="${e}"]`);return t?.material}static get observedAttributes(){return["alpha-test","alpha-to-coverage","ao-intensity","ao-map","ao-map-channel","ao-map-offset","ao-map-rotation","ao-map-tiling","ao-map-uv","blend-type","bumpiness","cull","depth-bias","depth-test","depth-write","diffuse","diffuse-map","diffuse-map-channel","diffuse-map-offset","diffuse-map-rotation","diffuse-map-tiling","diffuse-map-uv","emissive","emissive-intensity","emissive-map","emissive-map-channel","emissive-map-offset","emissive-map-rotation","emissive-map-tiling","emissive-map-uv","enable-ggx-specular","fresnel-model","gloss","gloss-invert","gloss-map","gloss-map-channel","gloss-map-offset","gloss-map-rotation","gloss-map-tiling","gloss-map-uv","height-map","height-map-channel","height-map-factor","height-map-offset","height-map-rotation","height-map-tiling","height-map-uv","metalness","metalness-map","metalness-map-channel","metalness-map-offset","metalness-map-rotation","metalness-map-tiling","metalness-map-uv","normal-map","normal-map-offset","normal-map-rotation","normal-map-tiling","normal-map-uv","occlude-direct","occlude-specular","opacity","opacity-dither","opacity-fades-specular","opacity-map","opacity-map-channel","opacity-map-offset","opacity-map-rotation","opacity-map-tiling","opacity-map-uv","roughness","roughness-map","slope-depth-bias","specular","specularity-factor","two-sided-lighting","use-fog","use-lighting","use-metalness","use-metalness-specular-color","use-skybox","use-tonemap"]}attributeChangedCallback(e,t,s){switch(e){case"alpha-test":this.alphaTest=Kt(s,0,e);break;case"alpha-to-coverage":this.alphaToCoverage=Lt(s,!1);break;case"ao-intensity":this.aoIntensity=Kt(s,1,e);break;case"ao-map":this.aoMap=s??"";break;case"ao-map-channel":this.aoMapChannel=Wt(s,Ps,"g",e);break;case"ao-map-offset":this.aoMapOffset=$t(s,new o(0,0),e);break;case"ao-map-rotation":this.aoMapRotation=Kt(s,0,e);break;case"ao-map-tiling":this.aoMapTiling=$t(s,new o(1,1),e);break;case"ao-map-uv":this.aoMapUv=Kt(s,0,e);break;case"blend-type":this.blendType=Wt(s,js,"none",e);break;case"bumpiness":this.bumpiness=Kt(s,1,e);break;case"cull":this.cull=Wt(s,Rs,"back",e);break;case"depth-bias":this.depthBias=Kt(s,0,e);break;case"depth-test":this.depthTest=Lt(s,!0);break;case"depth-write":this.depthWrite=Lt(s,!0);break;case"diffuse":this.diffuse=qt(s,new a(1,1,1),e);break;case"diffuse-map":this.diffuseMap=s??"";break;case"diffuse-map-channel":this.diffuseMapChannel=Wt(s,Hs,"rgb",e);break;case"diffuse-map-offset":this.diffuseMapOffset=$t(s,new o(0,0),e);break;case"diffuse-map-rotation":this.diffuseMapRotation=Kt(s,0,e);break;case"diffuse-map-tiling":this.diffuseMapTiling=$t(s,new o(1,1),e);break;case"diffuse-map-uv":this.diffuseMapUv=Kt(s,0,e);break;case"emissive":this.emissive=qt(s,new a(0,0,0),e);break;case"emissive-intensity":this.emissiveIntensity=Kt(s,1,e);break;case"emissive-map":this.emissiveMap=s??"";break;case"emissive-map-channel":this.emissiveMapChannel=Wt(s,Hs,"rgb",e);break;case"emissive-map-offset":this.emissiveMapOffset=$t(s,new o(0,0),e);break;case"emissive-map-rotation":this.emissiveMapRotation=Kt(s,0,e);break;case"emissive-map-tiling":this.emissiveMapTiling=$t(s,new o(1,1),e);break;case"emissive-map-uv":this.emissiveMapUv=Kt(s,0,e);break;case"enable-ggx-specular":this.enableGGXSpecular=Lt(s,!1);break;case"fresnel-model":this.fresnelModel=Wt(s,Os,"schlick",e);break;case"gloss":this.gloss=Kt(s,.25,e),this._warnGlossConflict();break;case"gloss-invert":this.glossInvert=Lt(s,!1),this._warnGlossConflict();break;case"gloss-map":this.glossMap=s??"",this._warnGlossConflict();break;case"gloss-map-channel":this.glossMapChannel=Wt(s,Ps,"g",e);break;case"gloss-map-offset":this.glossMapOffset=$t(s,new o(0,0),e);break;case"gloss-map-rotation":this.glossMapRotation=Kt(s,0,e);break;case"gloss-map-tiling":this.glossMapTiling=$t(s,new o(1,1),e);break;case"gloss-map-uv":this.glossMapUv=Kt(s,0,e);break;case"height-map":this.heightMap=s??"";break;case"height-map-channel":this.heightMapChannel=Wt(s,Ps,"g",e);break;case"height-map-factor":this.heightMapFactor=Kt(s,1,e);break;case"height-map-offset":this.heightMapOffset=$t(s,new o(0,0),e);break;case"height-map-rotation":this.heightMapRotation=Kt(s,0,e);break;case"height-map-tiling":this.heightMapTiling=$t(s,new o(1,1),e);break;case"height-map-uv":this.heightMapUv=Kt(s,0,e);break;case"metalness":this.metalness=Kt(s,0,e);break;case"metalness-map":this.metalnessMap=s??"";break;case"metalness-map-channel":this.metalnessMapChannel=Wt(s,Ps,"g",e);break;case"metalness-map-offset":this.metalnessMapOffset=$t(s,new o(0,0),e);break;case"metalness-map-rotation":this.metalnessMapRotation=Kt(s,0,e);break;case"metalness-map-tiling":this.metalnessMapTiling=$t(s,new o(1,1),e);break;case"metalness-map-uv":this.metalnessMapUv=Kt(s,0,e);break;case"normal-map":this.normalMap=s??"";break;case"normal-map-offset":this.normalMapOffset=$t(s,new o(0,0),e);break;case"normal-map-rotation":this.normalMapRotation=Kt(s,0,e);break;case"normal-map-tiling":this.normalMapTiling=$t(s,new o(1,1),e);break;case"normal-map-uv":this.normalMapUv=Kt(s,0,e);break;case"occlude-direct":this.occludeDirect=Lt(s,!1);break;case"occlude-specular":this.occludeSpecular=Wt(s,zs,"ao",e);break;case"opacity":this.opacity=Kt(s,1,e);break;case"opacity-dither":this.opacityDither=Wt(s,Ts,"none",e);break;case"opacity-fades-specular":this.opacityFadesSpecular=Lt(s,!0);break;case"opacity-map":this.opacityMap=s??"";break;case"opacity-map-channel":this.opacityMapChannel=Wt(s,Ps,"a",e);break;case"opacity-map-offset":this.opacityMapOffset=$t(s,new o(0,0),e);break;case"opacity-map-rotation":this.opacityMapRotation=Kt(s,0,e);break;case"opacity-map-tiling":this.opacityMapTiling=$t(s,new o(1,1),e);break;case"opacity-map-uv":this.opacityMapUv=Kt(s,0,e);break;case"roughness":this.gloss=Kt(s,.25,e),this.glossInvert=null!==s,this._warnGlossConflict();break;case"roughness-map":this.glossMap=s??"",this.glossInvert=null!==s,this._warnGlossConflict();break;case"slope-depth-bias":this.slopeDepthBias=Kt(s,0,e);break;case"specular":this.specular=qt(s,new a(0,0,0),e);break;case"specularity-factor":this.specularityFactor=Kt(s,1,e);break;case"two-sided-lighting":this.twoSidedLighting=Lt(s,!1);break;case"use-fog":this.useFog=Lt(s,!0);break;case"use-lighting":this.useLighting=Lt(s,!0);break;case"use-metalness":this.useMetalness=Lt(s,!0);break;case"use-metalness-specular-color":this.useMetalnessSpecularColor=Lt(s,!1);break;case"use-skybox":this.useSkybox=Lt(s,!0);break;case"use-tonemap":this.useTonemap=Lt(s,!0)}}}customElements.define("pc-material",Ds);class Bs extends us{_castShadows=!0;_material="";_receiveShadows=!0;_type="box";constructor(){super("render")}getInitialComponentData(){return{type:this._type,castShadows:this._castShadows,material:Ds.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;const t=Ds.get(e);this.component&&t&&(this.component.material=t)}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,s){switch(super.attributeChangedCallback(e,t,s),e){case"cast-shadows":this.castShadows=Lt(s,!0);break;case"material":this.material=s??"";break;case"receive-shadows":this.receiveShadows=Lt(s,!0);break;case"type":this.type=Wt(s,["box","capsule","cone","cylinder","plane","sphere"],"box",e)}}}customElements.define("pc-render",Bs);class Ls extends us{_angularDamping=0;_angularFactor=new s(1,1,1);_friction=.5;_linearDamping=0;_linearFactor=new s(1,1,1);_mass=1;_restitution=0;_rollingFriction=0;_type="static";constructor(){super("rigidbody")}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=Kt(a,0,e);break;case"angular-factor":this.angularFactor=Jt(a,s.ONE,e);break;case"friction":this.friction=Kt(a,.5,e);break;case"linear-damping":this.linearDamping=Kt(a,0,e);break;case"linear-factor":this.linearFactor=Jt(a,s.ONE,e);break;case"mass":this.mass=Kt(a,1,e);break;case"restitution":this.restitution=Kt(a,0,e);break;case"rolling-friction":this.rollingFriction=Kt(a,0,e);break;case"type":this.type=Wt(a,["static","dynamic","kinematic"],"static",e)}}}customElements.define("pc-rigidbody",Ls);const qs=new Map([["none",St],["blend",Ct]]);class Ws extends us{_screenSpace=!1;_resolution=new o(640,320);_referenceResolution=new o(640,320);_priority=0;_scaleMode="none";_scaleBlend=.5;constructor(){super("screen")}getInitialComponentData(){return{priority:this._priority,referenceResolution:this._referenceResolution,resolution:this._resolution,scaleBlend:this._scaleBlend,scaleMode:qs.get(this._scaleMode)??St,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 scaleMode(e){this._scaleMode=e,this.component&&(this.component.scaleMode=qs.get(e)??St)}get scaleMode(){return this._scaleMode}set screenSpace(e){this._screenSpace=e,this.component&&(this.component.screenSpace=this._screenSpace)}get screenSpace(){return this._screenSpace}static get observedAttributes(){return[...super.observedAttributes,"screen-space","resolution","reference-resolution","priority","scale-blend","scale-mode"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"priority":this.priority=Kt(s,0,e);break;case"reference-resolution":this.referenceResolution=$t(s,new o(640,320),e);break;case"resolution":this.resolution=$t(s,new o(640,320),e);break;case"scale-blend":this.scaleBlend=Kt(s,.5,e);break;case"scale-mode":this.scaleMode=Wt(s,qs,"none",e);break;case"screen-space":this.screenSpace=Lt(s,!1)}}}customElements.define("pc-screen",Ws);const Ks=new Map([["horizontal",We],["vertical",Je]]);class Qs extends us{_orientation="horizontal";_value=0;_handleSize=.5;_handle="";constructor(){super("scrollbar")}getInitialComponentData(){const e={orientation:Ks.get(this._orientation),value:this._value,handleSize:this._handleSize},t=Vt(this._handle);return t&&(e.handleEntity=t),e}get component(){return super.component}set orientation(e){this._orientation=e,this.component&&(this.component.orientation=Ks.get(e)??We)}get orientation(){return this._orientation}set value(e){this._value=e,this.component&&(this.component.value=e)}get value(){return this._value}set handleSize(e){this._handleSize=e,this.component&&(this.component.handleSize=e)}get handleSize(){return this._handleSize}set handle(e){this._handle=e;const t=Vt(e);this.component&&t&&(this.component.handleEntity=t)}get handle(){return this._handle}static get observedAttributes(){return[...super.observedAttributes,"orientation","value","handle-size","handle"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"orientation":this.orientation=Wt(s,Ks,"horizontal",e);break;case"value":this.value=Kt(s,0,e);break;case"handle-size":this.handleSize=Kt(s,.5,e);break;case"handle":this.handle=s??""}}}customElements.define("pc-scrollbar",Qs);const Is=new Map([["clamp",jt],["bounce",At],["infinite",Rt]]),$s=new Map([["always",Et],["when-required",Ft]]);class Js extends us{_horizontal=!0;_vertical=!0;_scrollMode="bounce";_bounceAmount=.1;_friction=.05;_useMouseWheel=!0;_mouseWheelSensitivity=new o(1,1);_horizontalScrollbarVisibility="when-required";_verticalScrollbarVisibility="when-required";_viewport="";_content="";_horizontalScrollbar="";_verticalScrollbar="";constructor(){super("scrollview")}getInitialComponentData(){const e={horizontal:this._horizontal,vertical:this._vertical,scrollMode:Is.get(this._scrollMode),bounceAmount:this._bounceAmount,friction:this._friction,useMouseWheel:this._useMouseWheel,mouseWheelSensitivity:this._mouseWheelSensitivity,horizontalScrollbarVisibility:$s.get(this._horizontalScrollbarVisibility),verticalScrollbarVisibility:$s.get(this._verticalScrollbarVisibility)},t=Vt(this._viewport);t&&(e.viewportEntity=t);const s=Vt(this._content);s&&(e.contentEntity=s);const a=Vt(this._horizontalScrollbar);a&&(e.horizontalScrollbarEntity=a);const i=Vt(this._verticalScrollbar);return i&&(e.verticalScrollbarEntity=i),e}get component(){return super.component}set horizontal(e){this._horizontal=e,this.component&&(this.component.horizontal=e)}get horizontal(){return this._horizontal}set vertical(e){this._vertical=e,this.component&&(this.component.vertical=e)}get vertical(){return this._vertical}set scrollMode(e){this._scrollMode=e,this.component&&(this.component.scrollMode=Is.get(e)??At)}get scrollMode(){return this._scrollMode}set bounceAmount(e){this._bounceAmount=e,this.component&&(this.component.bounceAmount=e)}get bounceAmount(){return this._bounceAmount}set friction(e){this._friction=e,this.component&&(this.component.friction=e)}get friction(){return this._friction}set useMouseWheel(e){this._useMouseWheel=e,this.component&&(this.component.useMouseWheel=e)}get useMouseWheel(){return this._useMouseWheel}set mouseWheelSensitivity(e){this._mouseWheelSensitivity=e,this.component&&(this.component.mouseWheelSensitivity=e)}get mouseWheelSensitivity(){return this._mouseWheelSensitivity}set horizontalScrollbarVisibility(e){this._horizontalScrollbarVisibility=e,this.component&&(this.component.horizontalScrollbarVisibility=$s.get(e)??Ft)}get horizontalScrollbarVisibility(){return this._horizontalScrollbarVisibility}set verticalScrollbarVisibility(e){this._verticalScrollbarVisibility=e,this.component&&(this.component.verticalScrollbarVisibility=$s.get(e)??Ft)}get verticalScrollbarVisibility(){return this._verticalScrollbarVisibility}set viewport(e){this._viewport=e;const t=Vt(e);this.component&&t&&(this.component.viewportEntity=t)}get viewport(){return this._viewport}set content(e){this._content=e;const t=Vt(e);this.component&&t&&(this.component.contentEntity=t)}get content(){return this._content}set horizontalScrollbar(e){this._horizontalScrollbar=e;const t=Vt(e);this.component&&t&&(this.component.horizontalScrollbarEntity=t)}get horizontalScrollbar(){return this._horizontalScrollbar}set verticalScrollbar(e){this._verticalScrollbar=e;const t=Vt(e);this.component&&t&&(this.component.verticalScrollbarEntity=t)}get verticalScrollbar(){return this._verticalScrollbar}static get observedAttributes(){return[...super.observedAttributes,"horizontal","vertical","scroll-mode","bounce-amount","friction","use-mouse-wheel","mouse-wheel-sensitivity","horizontal-scrollbar-visibility","vertical-scrollbar-visibility","viewport","content","horizontal-scrollbar","vertical-scrollbar"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"horizontal":this.horizontal=Lt(s,!0);break;case"vertical":this.vertical=Lt(s,!0);break;case"scroll-mode":this.scrollMode=Wt(s,Is,"bounce",e);break;case"bounce-amount":this.bounceAmount=Kt(s,.1,e);break;case"friction":this.friction=Kt(s,.05,e);break;case"use-mouse-wheel":this.useMouseWheel=Lt(s,!0);break;case"mouse-wheel-sensitivity":this.mouseWheelSensitivity=$t(s,o.ONE,e);break;case"horizontal-scrollbar-visibility":this.horizontalScrollbarVisibility=Wt(s,$s,"when-required",e);break;case"vertical-scrollbar-visibility":this.verticalScrollbarVisibility=Wt(s,$s,"when-required",e);break;case"viewport":this.viewport=s??"";break;case"content":this.content=s??"";break;case"horizontal-scrollbar":this.horizontalScrollbar=s??"";break;case"vertical-scrollbar":this.verticalScrollbar=s??""}}}customElements.define("pc-scrollview",Js);class Ys extends Tt{_attributes={};_enabled=!0;_script=null;set scriptAttributes(e){this._attributes=e??{},this.dispatchEvent(new CustomEvent("scriptattributeschange",{detail:{attributes:this._attributes},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.setAttribute("name",e)}get name(){return this.getAttribute("name")??""}get script(){return this._script}connectedCallback(){"PC-SCRIPTS"!==this.parentElement?.tagName&&console.warn(`pc-script '${this.getAttribute("name")}' must be a direct child of pc-scripts - script not created`)}disconnectedCallback(){this._resetReady()}_onScriptCreated(){this._onReady()}static get observedAttributes(){return["attributes","enabled","name"]}attributeChangedCallback(e,t,s){switch(e){case"attributes":if(null===s){this.scriptAttributes={};break}try{this.scriptAttributes=JSON.parse(s)}catch(e){console.warn(`Invalid 'attributes' JSON on pc-script '${this.getAttribute("name")}': ${e.message}`)}break;case"enabled":this.enabled=Lt(s,!0);break;case"name":null!==t&&t!==s&&this.dispatchEvent(new CustomEvent("scriptnamechange",{detail:{oldName:t,newName:s},bubbles:!0}))}}}customElements.define("pc-script",Ys);const Vs=new Set([...Ys.observedAttributes,"accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","exportparts","hidden","id","inert","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","role","slot","spellcheck","style","tabindex","title","translate"]),Ns=e=>Vs.has(e)||e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("on")&&e in HTMLElement.prototype,Xs=new Set(["app","entity","destroy","initialize","postInitialize","postUpdate","swap","update"]),Zs=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),ea=(e,t)=>(s,a)=>{const i=Dt(s,e);return i?new t(i):(console.warn(`Invalid script attribute value '${a}'. Expected ${e} space-separated numbers after 'vec${e}:'.`),a)},ta=new Map([["asset",(e,t)=>{const s=ds(e);return s||(console.warn(`Unable to resolve '${t}' in script attributes - no pc-asset found with id '${e}'.`),t)}],["entity",(e,t)=>{const s=Vt(e);return s||(console.warn(`Unable to resolve '${t}' in script attributes - no pc-entity found matching '${e}'.`),t)}],["vec2",ea(2,o)],["vec3",ea(3,s)],["vec4",ea(4,i)],["color",(e,t)=>{const s=Dt(e,4)??Dt(e,3);return s?new a(s):(console.warn(`Invalid script attribute value '${t}'. Expected 3 or 4 space-separated numbers after 'color:'.`),t)}]]),sa=e=>{const t=e.indexOf(":");if(t<=0)return null;const s=ta.get(e.slice(0,t));return s?{convert:s,rest:e.slice(t+1)}:null};class aa extends us{observer;constructor(){super("script"),this.observer=new MutationObserver(this.handleMutations.bind(this)),this.addEventListener("scriptattributeschange",this.handleScriptAttributesChange.bind(this)),this.addEventListener("scriptenablechange",this.handleScriptEnableChange.bind(this)),this.addEventListener("scriptnamechange",this.handleScriptNameChange.bind(this))}connectedCallback(){return this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0}),super.connectedCallback()}initComponent(){this.querySelectorAll(":scope > pc-script").forEach(e=>{this.createScript(e)})}convertAttributes(e){if("string"==typeof e){const t=sa(e);return t?t.convert(t.rest,e):e}if(Array.isArray(e))return e.map(e=>this.convertAttributes(e));if(e&&"object"==typeof e){const t={};for(const s in e)t[s]=this.convertAttributes(e[s]);return t}return e}mergeDeep(e,t){for(const s in t){const a=t[s],i=e[s];if(this.isMathType(i)&&Array.isArray(a)){const t=this.arrayToMathType(i,a,s);t&&(e[s]=t);continue}a&&"object"==typeof a&&!Array.isArray(a)&&Object.getPrototypeOf(a)===Object.prototype?(i&&"object"==typeof i||(e[s]={}),this.mergeDeep(e[s],a)):e[s]=a}return e}isMathType(e){return e instanceof o||e instanceof s||e instanceof i||e instanceof a||e instanceof n}arrayToMathType(e,t,r){if(t.every(e=>"number"==typeof e&&Number.isFinite(e))){if(e instanceof o&&2===t.length)return new o(t);if(e instanceof s&&3===t.length)return new s(t);if(e instanceof i&&4===t.length)return new i(t);if(e instanceof a&&(3===t.length||4===t.length))return new a(t);if(e instanceof n&&3===t.length)return(new n).setFromEulerAngles(t[0],t[1],t[2])}return console.warn(`Cannot convert script attribute '${r}' array [${t}] to ${e.constructor.name}. Keeping the current value.`),null}applyAttributes(e,t,s){const a=this.convertAttributes(t);if(a&&"object"==typeof a&&(delete a.enabled,s))for(const e of s)delete a[e];this.mergeDeep(e,a)}inlineKeys(e){const t=new Set;for(const s of Array.from(e.attributes))Ns(s.name)||t.add(Zs(s.name));return t}scriptFor(e){const t=e.getAttribute("name");if(!t||!this.component)return null;const s=this.component.get(t);return s&&s===e._script?s:null}handleScriptAttributesChange(e){const t=e.target,s=this.scriptFor(t);s&&this.applyAttributes(s,e.detail.attributes,this.inlineKeys(t))}handleScriptEnableChange(e){const t=e.target;this.handleMutations(this.observer.takeRecords());const s=this.scriptFor(t);s&&(s.enabled=e.detail.enabled)}handleScriptNameChange(e){const t=e.target;if(t.parentElement!==this)return;if(!this.component)return;const{oldName:s}=e.detail;s&&t._script&&this.component.get(s)===t._script&&this.destroyScript(s),t._script=null,this.createScript(t)}createScript(e){const t=e.getAttribute("name");if(!t||!this.component)return null;const s=this.component.create(t,{enabled:!1});return s?(e._script=s,this.applyAttributes(s,e.scriptAttributes,this.inlineKeys(e)),this.applyInlineAttributes(s,e),s.enabled=e.enabled,e._onScriptCreated(),s):null}applyInlineAttributes(e,t){const s=t.getAttribute("name")??"";for(const a of Array.from(t.attributes))Ns(a.name)||this.setScriptProperty(e,s,a.name,a.value)}applyScriptProperty(e,t){const s=this.scriptFor(e);if(!s)return;const a=e.getAttribute(t);if(null===a){const a=Zs(t),i=e.scriptAttributes[a];return void(void 0!==i&&this.applyAttributes(s,{[a]:i}))}this.setScriptProperty(s,e.getAttribute("name")??"",t,a)}setScriptProperty(e,t,r,c){const h=Zs(r);try{const p=e[h];if("function"==typeof p||Xs.has(h))return void console.warn(`Ignoring attribute '${r}' on pc-script '${t}' - '${h}' is part of the Script API.`);if("string"==typeof p)e[h]=c;else if(sa(c)){const t=this.convertAttributes(c);t===c&&null!=p||(e[h]=t)}else if("number"==typeof p)e[h]=Kt(c,p,r);else if("boolean"==typeof p)e[h]=Lt(c,p);else if(p instanceof o)e[h]=$t(c,p,r);else if(p instanceof s)e[h]=Jt(c,p,r);else if(p instanceof i)e[h]=Yt(c,p,r);else if(p instanceof a)e[h]=qt(c,p,r);else if(p instanceof n)e[h]=Qt(c,p,r);else{const s=((e,t)=>{const s=new Set(Object.keys(e));for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(e)))s.add(t);for(const e of s)if(e!==t&&e.toLowerCase()===t.toLowerCase())return e;return null})(e,h);if(s)return void console.warn(`Script '${t}' has no attribute '${h}' - did you mean '${l=s,l.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}'? Attribute names are kebab-case.`);console.warn(`Script '${t}' has no typed attribute '${h}' - assigning the raw string from '${r}'.`),e[h]=c}}catch(e){console.warn(`Error applying attribute '${r}' to script '${t}': ${e.message}`)}var l}destroyScript(e){this.component&&this.component.destroy(e)}handleMutations(e){for(const t of e){if("attributes"===t.type){const e=t.target;e instanceof Ys&&e.parentElement===this&&t.attributeName&&!Ns(t.attributeName)&&this.applyScriptProperty(e,t.attributeName);continue}t.target===this&&(t.removedNodes.forEach(e=>{if(e instanceof Ys){const t=e.getAttribute("name");t&&e._script&&this.component&&this.component.get(t)===e._script&&this.destroyScript(t),e._script=null}}),t.addedNodes.forEach(e=>{e instanceof Ys&&this.createScript(e)}))}}disconnectedCallback(){this.observer.disconnect(),super.disconnectedCallback?.()}get component(){return super.component}}customElements.define("pc-scripts",aa);class ia extends us{_distanceModel="linear";_maxDistance=1e4;_pitch=1;_positional=!1;_refDistance=1;_rollOffFactor=1;_volume=1;constructor(){super("sound")}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,s){switch(super.attributeChangedCallback(e,t,s),e){case"distance-model":this.distanceModel=Wt(s,["exponential","inverse","linear"],"linear",e);break;case"max-distance":this.maxDistance=Kt(s,1e4,e);break;case"pitch":this.pitch=Kt(s,1,e);break;case"positional":this.positional=Lt(s,!1);break;case"ref-distance":this.refDistance=Kt(s,1,e);break;case"roll-off-factor":this.rollOffFactor=Kt(s,1,e);break;case"volume":this.volume=Kt(s,1,e)}}}customElements.define("pc-sounds",ia);class na extends Tt{_asset="";_autoPlay=!1;_duration=null;_loop=!1;_name="";_overlap=!1;_pitch=1;_startTime=0;_volume=1;_soundElement=null;_connectionGeneration=0;soundSlot=null;async connectedCallback(){const e=++this._connectionGeneration,t=this.soundElement;await(t?.ready());const s=t?.component;if(e!==this._connectionGeneration||!s)return;const a={autoPlay:this._autoPlay,loop:this._loop,overlap:this._overlap,pitch:this._pitch,startTime:this._startTime,volume:this._volume};this._duration&&(a.duration=this._duration),this._soundElement=t,this.soundSlot=s.addSlot(this._name,a),this.asset=this._asset,this._autoPlay&&this.soundSlot.play(),this._onReady()}disconnectedCallback(){this._connectionGeneration++,this._soundElement?.component?.removeSlot(this._name),this._soundElement=null,this.soundSlot=null,this._resetReady()}get soundElement(){const e=this.parentElement;return e instanceof ia?e:(console.warn("pc-sound must be a direct child of a pc-sounds element"),null)}set asset(e){if(this._asset=e,this.soundSlot){const t=ds(e)?.id;t&&(this.soundSlot.asset=t)}}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&&null!==e&&(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,s){switch(e){case"asset":this.asset=s??"";break;case"auto-play":this.autoPlay=Lt(s,!1);break;case"duration":this.duration=Kt(s,null,e);break;case"loop":this.loop=Lt(s,!1);break;case"name":this.name=s??"";break;case"overlap":this.overlap=Lt(s,!1);break;case"pitch":this.pitch=Kt(s,1,e);break;case"start-time":this.startTime=Kt(s,0,e);break;case"volume":this.volume=Kt(s,1,e)}}}customElements.define("pc-sound",na);class oa extends us{_asset="";_castShadows=!1;_lodBaseDistance=5;_lodMultiplier=3;_lodRangeMin=0;_lodRangeMax=99;constructor(){super("gsplat")}getInitialComponentData(){return{asset:ds(this._asset),castShadows:this._castShadows,lodBaseDistance:this._lodBaseDistance,lodMultiplier:this._lodMultiplier,lodRangeMin:this._lodRangeMin,lodRangeMax:this._lodRangeMax}}get component(){return super.component}set asset(e){this._asset=e;const t=ds(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 lodBaseDistance(e){this._lodBaseDistance=e,this.component&&(this.component.lodBaseDistance=e)}get lodBaseDistance(){return this._lodBaseDistance}set lodMultiplier(e){this._lodMultiplier=e,this.component&&(this.component.lodMultiplier=e)}get lodMultiplier(){return this._lodMultiplier}set lodRangeMin(e){this._lodRangeMin=e,this.component&&(this.component.lodRangeMin=e)}get lodRangeMin(){return this._lodRangeMin}set lodRangeMax(e){this._lodRangeMax=e,this.component&&(this.component.lodRangeMax=e)}get lodRangeMax(){return this._lodRangeMax}static get observedAttributes(){return[...super.observedAttributes,"asset","cast-shadows","lod-base-distance","lod-multiplier","lod-range-min","lod-range-max"]}attributeChangedCallback(e,t,s){switch(super.attributeChangedCallback(e,t,s),e){case"asset":this.asset=s??"";break;case"cast-shadows":this.castShadows=Lt(s,!1);break;case"lod-base-distance":this.lodBaseDistance=Kt(s,5,e);break;case"lod-multiplier":this.lodMultiplier=Kt(s,3,e);break;case"lod-range-min":this.lodRangeMin=Kt(s,0,e);break;case"lod-range-max":this.lodRangeMax=Kt(s,99,e)}}}customElements.define("pc-gsplat",oa);class ra extends Tt{_asset="";_entity=null;_loadGeneration=0;_loadHandle=null;_errorHandle=null;get entity(){return this._entity}connectedCallback(){if(!this.closestApp){const e=this._asset?` '${this._asset}'`:"";return void console.warn(`pc-model${e} must be a descendant of pc-app - model not created`)}this._loadModel()}disconnectedCallback(){this._loadGeneration++,this._detachLoadHandlers(),this._unloadModel(),this._resetReady()}_detachLoadHandlers(){this._loadHandle?.off(),this._loadHandle=null,this._errorHandle?.off(),this._errorHandle=null}_announceLoad(){this._onReady(),this.dispatchEvent(new Event("load"))}_instantiate(e){const t=this._loadGeneration,s=e.instantiateRenderEntity();this._entity=s,e.animations.length>0&&(s.addComponent("anim"),s.anim.assignAnimation("animation",e.animations[0].resource));const a=this.closestEntity;if(a)a.ready().then(()=>{t===this._loadGeneration&&(a.entity.addChild(s),this._announceLoad())});else{const e=this.closestApp;e&&e.ready().then(()=>{t===this._loadGeneration&&(e.app.root.addChild(s),this._announceLoad())})}}async _loadModel(){this._unloadModel();const e=++this._loadGeneration;this._detachLoadHandlers(),this._resetReady();const t=this.closestApp;if(!t)return;if(await t.ready(),e!==this._loadGeneration)return;const s=ds(this._asset);s?s.loaded?this._instantiate(s.resource):(this._loadHandle=s.once("load",()=>{this._detachLoadHandlers(),e===this._loadGeneration&&this._instantiate(s.resource)}),this._errorHandle=s.once("error",t=>{this._detachLoadHandlers(),e===this._loadGeneration&&(this.dispatchEvent(new ErrorEvent("error",{message:t instanceof Error?t.message:String(t)})),this._onReady())})):this._asset&&console.warn(`pc-model could not find asset '${this._asset}' - model not created`)}_unloadModel(){this._entity?.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,s){if("asset"===e)this.asset=s??""}}customElements.define("pc-model",ra);class ca extends es{_name="";_index=null;_state="pending";_path=null;_host=null;_hostListener=null;_destroyHandle=null;_authored={};_enabled=null;_position=null;_rotation=null;_scale=null;_tags=null;get state(){return this._state}get path(){return this._path}connectedCallback(){const e=this.parentElement?.closest("pc-model, pc-node")??null;if(!e){const e=this._name?` '${this._name}'`:"";return void console.warn(`pc-node${e} must be a descendant of pc-model - node not bound`)}this._host=e,this._hostListener=e=>{e.target===this._host&&this._rebind()},e.addEventListener("ready",this._hostListener),this._rebind()}disconnectedCallback(){this._host&&this._hostListener&&this._host.removeEventListener("ready",this._hostListener),this._host=null,this._hostListener=null,this._unbind(),this._state="pending"}_rebind(){const e=this._host?.entity??null;if(!e||!this._name)return this._unbind(),void(this._state="pending");const t=this._resolve(e);t&&t===this._entity?this._path=this._pathOf(t,e):(this._unbind(),t&&this._bind(t,e))}_resolve(e){const t=e.find(e=>e.name===this._name);if(0===t.length){const t=this._closestName(e),s=t?` - closest match: '${t}'`:"";return console.warn(`pc-node '${this._name}' not found in ${this._describeHost()}${s}`),this._state="missing",null}let s;if(null!==this._index){if(this._index>=t.length)return console.warn(`pc-node '${this._name}' index ${this._index} is out of range - ${t.length} match(es) in ${this._describeHost()}`),this._state="missing",null;s=t[this._index]}else{if(t.length>1){const s=t.map((t,s)=>`[${s}] ${this._pathOf(t,e)}`).join(", ");return console.warn(`pc-node '${this._name}' is ambiguous in ${this._describeHost()} - specify index: ${s}`),this._state="ambiguous",null}s=t[0]}const a=this.closestApp?.elementFromEntity(s);return a&&a!==this?(console.warn(`pc-node '${this._name}' resolves to a node already bound by another element - element ignored`),this._state="duplicate",null):s}_bind(e,t){this._entity=e,this._registerEntity(e),this._destroyHandle=e.once("destroy",this._onEntityDestroy,this),this._state="bound",this._path=this._pathOf(e,t),this._applyOverrides(),this._onReady(),this._buildChildren()}_unbind(){const e=this._entity;e&&(this._revertOverrides(),this.querySelectorAll("pc-entity").forEach(e=>{e.closestEntity===this&&e.entity?.destroy()}),this._destroyHandle?.off(),this._destroyHandle=null,this._unregisterEntity(e),this._entity=null,this._path=null,this._authored={},this.querySelectorAll("*").forEach(e=>{e instanceof us&&e.closestEntity===this&&e._hostCycled()}),this._resetReady())}_onEntityDestroy(e){this._destroyHandle=null,this._unregisterEntity(e),this._entity=null,this._path=null,this._authored={},this._state="pending",this._resetReady()}_buildChildren(){const e=this.closestApp?.app;if(!e)return;const t=this.querySelectorAll("pc-entity");t.forEach(t=>{t._createEntity(e)}),t.forEach(t=>{t._buildHierarchy(e)})}_applyOverrides(){null!==this._enabled&&(this.enabled=this._enabled),null!==this._position&&(this.position=this._position),null!==this._rotation&&(this.rotation=this._rotation),null!==this._scale&&(this.scale=this._scale),null!==this._tags&&(this.tags=this._tags)}_revertOverrides(){const e=this._entity,t=this._authored;void 0!==t.enabled&&(e.enabled=t.enabled),t.position&&e.setLocalPosition(t.position),t.rotation&&e.setLocalRotation(t.rotation),t.scale&&e.setLocalScale(t.scale),t.tags&&(e.tags.clear(),e.tags.add(t.tags)),this._authored={}}_pathOf(e,t){const s=[];for(let a=e;a&&a!==t;a=a.parent)s.unshift(a.name);return s.join("/")||e.name}_describeHost(){return this._host instanceof ra?`model '${this._host.asset}'`:`pc-node '${this._host?.name??""}' subtree`}_closestName(e){let t=null,s=3;return e.find(e=>{const a=((e,t)=>{const s=Array.from({length:t.length+1},(e,t)=>t);for(let a=1;a<=e.length;a++){let i=s[0];s[0]=a;for(let n=1;n<=t.length;n++){const o=s[n];s[n]=Math.min(s[n]+1,s[n-1]+1,i+(e[a-1]===t[n-1]?0:1)),i=o}}return s[t.length]})(this._name,e.name);return a<s&&(s=a,t=e.name),!1}),t}set name(e){this._name=e,this.isConnected&&this._host&&this._rebind()}get name(){return this._name}set index(e){this._index=e,this.isConnected&&this._host&&this._rebind()}get index(){return this._index}set enabled(e){this._enabled=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.enabled??=t.enabled,t.enabled=e):void 0!==this._authored.enabled&&(t.enabled=this._authored.enabled,delete this._authored.enabled))}get enabled(){return this._enabled}set position(e){this._position=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.position??=t.getLocalPosition().clone(),t.setLocalPosition(e)):this._authored.position&&(t.setLocalPosition(this._authored.position),delete this._authored.position))}get position(){return this._position}set rotation(e){this._rotation=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.rotation??=t.getLocalRotation().clone(),t.setLocalEulerAngles(e)):this._authored.rotation&&(t.setLocalRotation(this._authored.rotation),delete this._authored.rotation))}get rotation(){return this._rotation}set scale(e){this._scale=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.scale??=t.getLocalScale().clone(),t.setLocalScale(e)):this._authored.scale&&(t.setLocalScale(this._authored.scale),delete this._authored.scale))}get scale(){return this._scale}set tags(e){this._tags=e;const t="bound"===this._state?this._entity:null;t&&(null!==e?(this._authored.tags??=t.tags.list().slice(),t.tags.clear(),t.tags.add(e)):this._authored.tags&&(t.tags.clear(),t.tags.add(this._authored.tags),delete this._authored.tags))}get tags(){return this._tags}static get observedAttributes(){return["enabled","index","name","position","rotation","scale","tags",...Zt]}attributeChangedCallback(e,t,a){switch(e){case"enabled":this.enabled=null===a?null:Lt(a,!0);break;case"index":if(null===a)this.index=null;else{const e=""===a.trim()?NaN:Number(a);!Number.isInteger(e)||e<0?(console.warn(`pc-node index '${a}' is not a non-negative integer - treated as absent`),this.index=null):this.index=e}break;case"name":this.name=a??"";break;case"position":this.position=null===a?null:Jt(a,s.ZERO,e);break;case"rotation":this.rotation=null===a?null:Jt(a,s.ZERO,e);break;case"scale":this.scale=null===a?null:Jt(a,s.ONE,e);break;case"tags":this.tags=null===a?null:It(a);break;case"onpointerenter":case"onpointerleave":case"onpointerdown":case"onpointerup":case"onpointermove":this._updateInlineHandler(e,a)}}}customElements.define("pc-node",ca);class ha extends Tt{_fog="none";_fogColor=new a(1,1,1);_fogDensity=0;_fogStart=0;_fogEnd=1e3;_gravity=new s(0,-9.81,0);_scene=null;get scene(){return this._scene}async connectedCallback(){const e=this.closestApp;if(!e)return void console.warn("pc-scene must be a descendant of pc-app - scene settings not applied");if(await e.ready(),!this.isConnected||this.closestApp!==e)return;const t=e.app;t&&(this._scene=t.scene,this._updateSceneSettings(),this._onReady())}disconnectedCallback(){this._scene=null,this._resetReady()}_updateSceneSettings(){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._applyGravity(this._gravity))}_applyGravity(e){this.closestApp?.app?.systems.rigidbody?.gravity.copy(e)}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){this._gravity=e,this._scene&&this._applyGravity(e)}get gravity(){return this._gravity}static get observedAttributes(){return["fog","fog-color","fog-density","fog-start","fog-end","gravity"]}attributeChangedCallback(e,t,i){switch(e){case"fog":this.fog=Wt(i,["none","linear","exp","exp2"],"none",e);break;case"fog-color":this.fogColor=qt(i,a.WHITE,e);break;case"fog-density":this.fogDensity=Kt(i,0,e);break;case"fog-start":this.fogStart=Kt(i,0,e);break;case"fog-end":this.fogEnd=Kt(i,1e3,e);break;case"gravity":this.gravity=Jt(i,new s(0,-9.81,0),e)}}}customElements.define("pc-scene",ha);class la extends Tt{_asset="";_center=new s(0,.01,0);_intensity=1;_rotation=new s;_mipLevel=0;_lighting=!1;_scale=new s(100,100,100);_type="infinite";_scene=null;_appElement=null;_loadGeneration=0;_loadHandle=null;connectedCallback(){this._loadSkybox(),this._onReady()}disconnectedCallback(){this._loadGeneration++,this._detachLoadHandler(),this._unloadSkybox(),this._appElement=null,this._resetReady()}_detachLoadHandler(){this._loadHandle?.off(),this._loadHandle=null}_generateSkybox(e){if(!this._scene)return;const t=e.resource,s=Ot.generateSkyboxCubemap(t);if(this._scene.skybox?.destroy(),this._scene.skybox=s,this._lighting){const e=Ot.generateLightingSource(t),s=Ot.generateAtlas(e);e.destroy(),this._scene.envAtlas?.destroy(),this._scene.envAtlas=s}const a=this._scene.layers.getLayerById(zt);a&&(a.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._mipLevel}async _loadSkybox(){const e=++this._loadGeneration;this._detachLoadHandler();const t=await(this.closestApp?.ready());if(e!==this._loadGeneration)return;const s=t?.app;if(!t||!s)return;this._appElement=t;const a=ds(this._asset);a&&(this._scene=s.scene,a.loaded?this._generateSkybox(a):this._loadHandle=a.once("load",()=>{this._loadHandle=null,e===this._loadGeneration&&this._generateSkybox(a)}))}_unloadSkybox(){const e=this._scene;e&&(this._scene=null,this._appElement?.app&&(e.skybox?.destroy(),e.skybox=null,e.envAtlas?.destroy(),e.envAtlas=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 lighting(e){this._lighting=e}get lighting(){return this._lighting}set mipLevel(e){this._mipLevel=e,this._scene&&(this._scene.skyboxMip=this._mipLevel)}get mipLevel(){return this._mipLevel}set rotation(e){this._rotation=e,this._scene&&(this._scene.skyboxRotation=(new n).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(zt);e&&(e.enabled="none"!==this._type)}}get type(){return this._type}static get observedAttributes(){return["asset","center","intensity","lighting","mip-level","rotation","scale","type"]}attributeChangedCallback(e,t,a){switch(e){case"asset":this.asset=a??"";break;case"center":this.center=Jt(a,new s(0,.01,0),e);break;case"intensity":this.intensity=Kt(a,1,e);break;case"lighting":this.lighting=Lt(a,!1);break;case"mip-level":this.mipLevel=Kt(a,0,e);break;case"rotation":this.rotation=Jt(a,s.ZERO,e);break;case"scale":this.scale=Jt(a,new s(100,100,100),e);break;case"type":this.type=Wt(a,["box","dome","infinite","none"],"infinite",e)}}}customElements.define("pc-sky",la);export{Xt as AppElement,bs as AssetElement,Tt as AsyncElement,fs as ButtonComponentElement,ys as CameraComponentElement,ks as CollisionComponentElement,us as ComponentElement,ws as ElementComponentElement,es as EntityBaseElement,ts as EntityElement,oa as GSplatComponentElement,Ms as LayoutChildComponentElement,Cs as LayoutGroupComponentElement,Fs as LightComponentElement,ms as ListenerComponentElement,Ds as MaterialElement,ra as ModelElement,Pt as ModuleElement,ca as NodeElement,Es as ParticleSystemComponentElement,Bs as RenderComponentElement,Ls as RigidBodyComponentElement,ha as SceneElement,Ws as ScreenComponentElement,aa as ScriptComponentElement,Ys as ScriptElement,Js as ScrollViewComponentElement,Qs as ScrollbarComponentElement,la as SkyElement,ia as SoundComponentElement,na as SoundSlotElement,Ht as whenReady};
2
2
  //# sourceMappingURL=pwc.min.mjs.map