@epigraph/solutions 1.0.17-alpha.1 → 1.0.17-alpha.2

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.
@@ -12924,7 +12924,7 @@ void main() {
12924
12924
  }
12925
12925
  `);new In(new Q(-1,-1,-1),new Q(1,1,1)),new Q(-1,-3,1).normalize(),new Te(1,1,1),new Te(.5,.5,1),new Q(1,1,1);new In(new Q(-2,-1,-2),new Q(2,5,2)),new Q(0,-1,0),new Te(1,1,1),new Te(.25,.25,.5),new Q(.1,1,.1);const J1=class J0{static createButton(e,t={}){const n=navigator.xr;if(!n)return null;const i=n,r=document.createElement("button");e.xr.enabled=!0,e.xr.setReferenceSpaceType("local");function a(){let u=null;async function d(g){console.log("onSessionStarted"),g.addEventListener("end",A),await e.xr.setSession(g),r.textContent="EXIT VR",u=g}function A(){console.log("onSessionEnded"),u?.removeEventListener("end",A),r.textContent="ENTER VR",u=null}r.style.display="",r.style.cursor="pointer",r.style.left="calc(50% - 100px)",r.style.width="200px",r.style.height="100px",r.textContent="ENTER VR";const p={...t,optionalFeatures:[...t.optionalFeatures||[]]};r.onmouseenter=()=>{r.style.opacity="1.0"},r.onmouseleave=()=>{r.style.opacity="0.5"},r.onclick=()=>{u===null?(console.log("requesting session"),i.requestSession("immersive-vr",p).then(d)):(console.log("ending session"),u.end())}}function o(){r.style.display="none",r.style.cursor="auto",r.style.left="calc(50% - 75px)",r.style.width="150px",r.onmouseenter=null,r.onmouseleave=null,r.onclick=null}function l(){o(),r.textContent="VR NOT SUPPORTED"}function c(u){o(),console.warn("Exception when trying to call xr.isSessionSupported",u),r.textContent="VR NOT ALLOWED"}function h(u){u.style.position="absolute",u.style.bottom="20px",u.style.padding="12px 6px",u.style.border="1px solid #fff",u.style.borderRadius="4px",u.style.background="rgba(0,0,0,0.1)",u.style.color="#fff",u.style.font="normal 13px sans-serif",u.style.textAlign="center",u.style.opacity="0.5",u.style.outline="none",u.style.zIndex="999"}return r.id="VRButton",r.style.display="none",h(r),i.isSessionSupported("immersive-vr").then(u=>{u?a():l(),u&&J0.xrSessionIsGranted&&r.click()}).catch(c),r}static registerSessionGrantedListener(){const e=navigator.xr;if(!e)return null;const t=e;/WebXRViewer\//i.test(navigator.userAgent)||t.addEventListener("sessiongranted",()=>{J0.xrSessionIsGranted=!0})}};J1.xrSessionIsGranted=!1;let CV=J1;CV.registerSessionGrantedListener();var K1=(s=>(s.w="wrist",s.t0="thumb-metacarpal",s.t1="thumb-phalanx-proximal",s.t2="thumb-phalanx-distal",s.t3="thumb-tip",s.i0="index-finger-metacarpal",s.i1="index-finger-phalanx-proximal",s.i2="index-finger-phalanx-intermediate",s.i3="index-finger-phalanx-distal",s.i4="index-finger-tip",s.m0="middle-finger-metacarpal",s.m1="middle-finger-phalanx-proximal",s.m2="middle-finger-phalanx-intermediate",s.m3="middle-finger-phalanx-distal",s.m4="middle-finger-tip",s.r0="ring-finger-metacarpal",s.r1="ring-finger-phalanx-proximal",s.r2="ring-finger-phalanx-intermediate",s.r3="ring-finger-phalanx-distal",s.r4="ring-finger-tip",s.p0="pinky-finger-metacarpal",s.p1="pinky-finger-phalanx-proximal",s.p2="pinky-finger-phalanx-intermediate",s.p3="pinky-finger-phalanx-distal",s.p4="pinky-finger-tip",s))(K1||{});const xV=Object.keys(K1);xV.length;new Q(0,0,-1),new Q(0,0,1),new Q(-1,0,0),new Q(1,0,0),new Q(0,1,0),new Q(0,-1,0);new Q(0,0,-1),new Q(0,0,1),new Q(-1,0,0),new Q(1,0,0),new Q(0,1,0),new Q(0,-1,0);new Q(0,0,1),new Q(0,0,-1);new Q(0,-1,0),new Q(0,1,0),new Q(-1,0,0),new Q(1,0,0);class vt{static isTouchDevice(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}static async wait(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}static generateStylesDomElem(e,t=""){const n=document.createElement("style");return n.setAttribute("id",e),n.innerHTML=t,n}static generateHtmlDivElem(e,t=""){const n=document.createElement("div");return n.setAttribute("id",e),n.innerHTML=t,n}static getRandomIntegerInRange(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}static getUrlParameterByName(e,t=window.location.search){const n=new URLSearchParams(t);return Object.fromEntries(n.entries())[e]}static getBaseUrl(){const e=vt.getUrlParameterByName("parentUrl");return e||window.location.href}static normalizeRadian(e){return Math.atan2(Math.sin(e),Math.cos(e))}static isBetweenOnCircle(e,t,n){return e=vt.normalizeRadian(e),t=vt.normalizeRadian(t),n=vt.normalizeRadian(n),t<=n?e>=t&&e<=n:e>=t||e<=n}static getPointInBetweenByPercentage(e,t,n){let i=t.clone().sub(e);const r=i.length();return i=i.normalize().multiplyScalar(r*n),e.clone().add(i)}static clampAzimuth(e,t,n){if(Math.abs(t)==1/0||n==1/0)return e;const i=vt.normalizeRadian(e),r=vt.normalizeRadian(t),a=vt.normalizeRadian(n);if(vt.isBetweenOnCircle(i,r,a))return i;const o=Math.abs(vt.normalizeRadian(i-r)),l=Math.abs(vt.normalizeRadian(i-a));return o<l?r:a}static resolveNexusEndpoint(e){let t=Pp.PRODUCTION;return e=="local"?t=Pp.LOCAL:e==="staging"&&(t=Pp.STAGING),t}static parseUrlForEpigraphParams(e){const t=new Map,n=new Py(e);t.set(qn.epigraphSessionId,n.getParameterInUrl(qn.epigraphSessionId)),t.set(qn.identifier,n.getParameterInUrl(qn.identifier)),t.set(qn.identifierType,n.getParameterInUrl(qn.identifierType)),t.set(qn.type,n.getParameterInUrl(qn.type));const i=n.getParameterInUrl(qn.action);return i&&t.set(Zu.AR,JSON.parse(i)[Zu.AR]),t}static generateShareableUrl({baseUrl:e,identifier:t,identifierType:n,sharedConfig:i,arCompatible:r=!1}){const a=new Map;return a.set(qn.epigraphSessionId,window.epigraph.epigraphSessionId),a.set(qn.identifier,t),a.set(qn.identifierType,n),i&&a.set(qn.sharedConfig,i),r&&a.set(qn.action,`{"${Zu.AR}":true}`),new Py(e).generateQrCodeUrl(Object.fromEntries(a.entries()),!1)}static _dispose3(e){e instanceof Je&&e.geometry.dispose(),e instanceof Je&&(Array.isArray(e.material)?e.material.forEach(t=>t.dispose()):e.material.dispose(),e.material?.map?.dispose())}static dispose3(e){e.traverse(t=>{(t instanceof Je||t instanceof ph)&&vt._dispose3(t)}),(e instanceof Je||e instanceof ph||e instanceof rs)&&vt._dispose3(e)}static animateValue(e,t,n,i){const r=performance.now();function a(o){const l=o-r,c=Math.min(l/n,1),h=e+(t-e)*c;i(h),c<1&&requestAnimationFrame(a)}requestAnimationFrame(a)}static getCustomStylesTemplate(){const t=document.querySelector("#epigraphCustomStyles")?.content?.cloneNode(!0);return t||Ee}}class gd{constructor(e){this._success=e}get success(){return this._success}set success(e){this._success=e}get failed(){return!this._success}}class wV extends gd{constructor(e=!1,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}var Z1=(s=>(s.Empty="entity-empty",s.Gltf="entity-mesh",s.Render="entity-render",s.Proxy="entity-proxy",s.Collider="entity-collider",s.Asset="entity-asset",s))(Z1||{});class SV extends yn{constructor(){super(),this._entityType=Z1.Empty}get entityType(){return this._entityType}destroy(){let e;const t=new wV(!1,e);return e=void 0,t.success=!0,t.payload=e,t}}var fa=(s=>(s.GEO="geo",s.SPLAT="splat",s))(fa||{});class ZA{constructor(e){this.__name=e}getName(){return this.__name}}var Os=(s=>(s.declared="declared",s.Loading="loading",s.Loaded="loaded",s.Unloaded="unloaded",s.Failed="failed",s))(Os||{}),oo=(s=>(s.None="epg-resource-none",s.Gltf="epg-resource-gltf",s.Proxy="epg-resource-gltf-proxy",s.Render="epg-resource-gltf-render",s.Splat="epg-resource-splat",s))(oo||{});class eR{constructor({id:e,uri:t,appWcRef:n}){this._loggerContext="EPG RESOURCE",this._type="epg-resource-none",this._id=crypto.randomUUID(),this._loadingProgress=0,this._state="declared",this._resource=null,e&&(this._id=e),this._appWcRef=n,this._uri=t}get id(){return this._id}get uri(){return this._uri}get loadingProgress(){return this._loadingProgress}get state(){return this._state}get isLoaded(){return this._state==="loaded"}get type(){return this._type}get resource(){return this._resource}highlight(){}updateLoadingProgress(e){this._loadingProgress=e,this._appWcRef.eventsManager.assetLoadProgress.fire({progress:e})}async load(){return window.epigraph.logger.info({title:"Loading EPG Resource. Override to define how a resource should be loaded."}),Promise.resolve(!0)}unload(){return this._resource={},Promise.resolve(!0)}}class Ao extends St{constructor(e){super(),this.epgType="PLUG",this.__connectionId="",this.__isPrimary=!1,this.__receiver=null,this.__debugGeo=null,this.__config=e,this.name=e.name,this.__connectionId=e.connectionId,this.__isPrimary=e.isPrimary;const t=e.position;this.position.set(t.x,t.y,t.z);const n=e.rotation;this.rotation.set(n.x,n.y,n.z)}get config(){return this.__config}get connectionId(){return this.__connectionId}get isPrimary(){return this.__isPrimary}get isOpen(){return this.__receiver===null}get receiver(){return this.__receiver}connect(e){this.__receiver=e.receiver}disconnect(){this.__receiver=null}clone(e){return new Ao(this.__config).copy(this,e)}showDebug(){const e=new Q().setFromEuler(this.rotation).normalize(),t=this.position,n=.2,i=16711680;this.__debugGeo=new ST(e,t,n,i,.06,.06);const r=document.createElement("div");r.textContent=this.name;const a=new bb(r);r.style.pointerEvents="none";const o=new Q;this.getWorldDirection(o),o.normalize();const l=this.position.clone().addScaledVector(o,Math.random());a.position.set(l.x,l.y,l.z),this.__debugGeo.add(a),this.add(this.__debugGeo)}hideDebug(){this.__debugGeo&&(this.__debugGeo.clear(),this.__debugGeo?.removeFromParent(),vt.dispose3(this.__debugGeo))}}class ya extends St{constructor(e){super(),this.epgType="RECEIVER",this.__connectionId="",this.__plug=null,this.__debugGeo=null,this.__config=e,this.name=e.name,this.__connectionId=e.connectionId;const t=e.position;this.position.set(t.x,t.y,t.z);const n=e.rotation;this.rotation.set(n.x,n.y,n.z)}get config(){return this.__config}get connectionId(){return this.__connectionId}get isOpen(){return this.__plug===null}get plug(){return this.__plug}connect(e){this.__plug=e.plug}disconnect(){this.__plug=null}clone(e){return new ya(this.__config).copy(this,e)}showDebug(){const e=new Q().setFromEuler(this.rotation.clone()).normalize(),t=this.position,n=.1,i=65280;this.__debugGeo=new ST(e,t,n,i,.01,.08);const r=document.createElement("div");r.textContent=this.name,r.style.color="green";const a=new bb(r);r.style.pointerEvents="none",this.__debugGeo.add(a),this.add(this.__debugGeo)}hideDebug(){this.__debugGeo&&(this.__debugGeo.clear(),this.__debugGeo?.removeFromParent(),vt.dispose3(this.__debugGeo))}}var K0=(s=>(s.Plug="plug",s.Receiver="receiver",s))(K0||{});class tR extends eR{constructor({id:e,uri:t,appWcRef:n}){super({id:e,uri:t,appWcRef:n}),this._loggerContext="EPG RESOURCE GLTF",this._type=oo.Gltf,this._resource=null}get resource(){return this._resource}highlight(){}updateLoadingProgress(e){this._loadingProgress=e,this._appWcRef.eventsManager.assetLoadProgress.fire({progress:e})}async load(){if(this._state===Os.Loaded||this._state===Os.Loading)return Promise.resolve(!0);this._state=Os.Loading;const e=await this._appWcRef.loaders.gltfLoader.loadAsync(this._uri,t=>{this.updateLoadingProgress(t.loaded/t.total*100)}).catch(t=>(window.epigraph.logger.groupCollapsed({title:""}),window.epigraph.logger.error({title:"An error occurred while trying to load an asset!",details:t}),this._state=Os.Failed,Promise.reject()));return e===void 0?Promise.reject(!1):(this._resource=e,await this._parseLoadedGltf(),this._state=Os.Loaded,Promise.resolve(!0))}async _parseLoadedGltf(){window.epigraph.logger.info({title:"Parsing GLTF data",details:this._resource})}unload(){return this._resource={},Promise.resolve(!0)}}class BV extends tR{constructor({id:e,uri:t,appWcRef:n}){super({id:e,uri:t,appWcRef:n}),this._loggerContext="EPG RESOURCE PROXY",this._type=oo.Proxy,this.__plugs=[],this.__receivers=[]}get plugs(){return this.__plugs}get receivers(){return this.__receivers}async _parseLoadedGltf(){if(!this._resource?.scene)return;const e=[];this._resource.scene.traverse(t=>{if(t.userData.epgType===K0.Receiver){const n=new ya({name:t.name,connectionId:t.userData.connectionId,position:t.position.clone(),rotation:t.rotation.clone()});this.__receivers.push(n),e.push(t)}else if(t.userData.epgType===K0.Plug){const n=new Ao({name:t.name,isPrimary:t.userData.isPrimary,connectionId:t.userData.connectionId,position:t.position.clone(),rotation:t.rotation.clone()});this.__plugs.push(n),e.push(t)}});for(const t of this.__receivers)this._resource.scene.add(t);for(const t of this.__plugs)this._resource.scene.add(t);for(const t of e)t.removeFromParent(),vt.dispose3(t)}unload(){return this._resource={},this.__plugs=[],this.__receivers=[],Promise.resolve(!0)}}class nR extends tR{constructor({id:e,uri:t,appWcRef:n}){super({id:e,uri:t,appWcRef:n}),this._loggerContext="EPG RESOURCE RENDER",this._type=oo.Render,this.__variantsExtensionName="KHR_materials_variants",this.__finishNamesFromAsset=[]}get khrVariantsExtensionName(){return this.__variantsExtensionName}get khrVariantsExtension(){return this.__variantsExtension}get finishNamesFromAsset(){return this.__finishNamesFromAsset}async _parseLoadedGltf(){this._resource?.scene.traverse(t=>{t instanceof Je&&(t.castShadow=!0)});const e=this._resource?.userData?.gltfExtensions;if(!e){this.__variantsExtension=null,this.__finishNamesFromAsset=["default"];return}if(this.__variantsExtension=e[this.__variantsExtensionName],this.__variantsExtension?.variants)for(const t of this.__variantsExtension.variants)this.__finishNamesFromAsset.push(t.name)}unload(){return this._resource={},this.__variantsExtension={},this.__finishNamesFromAsset=[],Promise.resolve(!0)}}class TV extends eR{constructor({id:e,uri:t,appWcRef:n}){super({id:e,uri:t,appWcRef:n}),this._loggerContext="EPG RESOURCE SPLAT",this._type=oo.Splat,this._resource=null,this.__splatMesh=null,this._appWcRef.renderEngine.setupSparkRendererIfNotExists()}get resource(){return this._resource}get splatMesh(){return this.__splatMesh}__parseLoadedSplat(){this._resource&&(this.__splatMesh=new ph({packedSplats:this._resource}),this.__splatMesh.quaternion.set(1,0,0,0))}async load(){if(this._state===Os.Loaded||this._state===Os.Loading)return Promise.resolve(!0);this._state=Os.Loading;const e=await this._appWcRef.loaders.splatLoader.loadAsync(this._uri,t=>{this.updateLoadingProgress(t.loaded/t.total*100)}).catch(t=>(window.epigraph.logger.groupCollapsed({title:""}),window.epigraph.logger.error({title:"An error occurred while trying to load a render splat resource!",details:t}),this._state=Os.Failed,Promise.reject()));return e===void 0?Promise.reject(!1):(this._resource=e,this.__parseLoadedSplat(),this._state=Os.Loaded,Promise.resolve(!0))}}class iR{constructor(e,t){this._loggerContext="ASSET",this.__autoGenerateProxyEntity=!1,this.__finishes=new Map,this.__brandMaterialLibraries=new Map,this.__hotspots=[],this.__assetOverrides=null,this.__id=e.id,this.__name=e.name,this.__config=e,this.__appWcRef=t,this.__proxyGltf=new BV({id:`${String(e.id)}-${oo.Proxy}`,uri:e.proxyGeo,appWcRef:this.__appWcRef}),this.__autoGenerateProxyEntity=e.autoGenerateProxyEntity,this.__appWcRef.productSettings.render.mode===fa.SPLAT?this.__renderSplat=new TV({id:`${String(e.id)}-${oo.Splat}`,uri:e.renderSplat,appWcRef:this.__appWcRef}):this.__renderGltf=new nR({id:`${String(e.id)}-${oo.Render}`,uri:e.renderGeo,appWcRef:this.__appWcRef});for(const n in e.finishes)this.__finishes.set(n,new ZA(n));e.brandMaterialLibraries||(e.brandMaterialLibraries=[]),e.hotspots&&(this.__hotspots=e.hotspots)}get id(){return this.__id}get name(){return this.__name}get assetRootDir(){const e=this.__appWcRef.productSettings.render.mode===fa.SPLAT?this.__renderSplat?.uri:this.__renderGltf?.uri;return new URL(e+"/../../").href}get assetOverrides(){return this.__assetOverrides}get proxyGltf(){return this.__proxyGltf}get autoGenerateProxyEntity(){return this.__autoGenerateProxyEntity}get renderSplat(){return this.__renderSplat}get renderGltf(){return this.__renderGltf}get finishes(){return this.__finishes}get hotspots(){return this.__hotspots}get brandMaterialLibraries(){return this.__brandMaterialLibraries}get allFinishIds(){const e=[];for(const t of this.__finishes.keys())e.push(t);return e}async loadRenderSplat(){await this.__renderSplat?.load(),this.__finishes.set("default",new ZA("default"))}async loadProxyGltf(){return!this.__proxyGltf||this.__proxyGltf.isLoaded?Promise.resolve(!0):await this.__proxyGltf.load()}pullFinishesFromRenderGltf(){this.__finishes.clear(),this.__renderGltf&&this.__renderGltf.finishNamesFromAsset.forEach(e=>{this.__finishes.has(e)||this.__finishes.set(e,new ZA(e))})}async parseAssetOverrideJson(){if(!this.__renderGltf)return null;let e=this.__renderGltf.resource?.asset.extras?.epgOverrides;if(!e)return null;e=e.replace("./","");const t=new URL(e,this.assetRootDir),n=await fetch(t).catch(i=>{window.epigraph.logger.error({title:`Failed to load asset override file: ${t}`,details:i})});n&&(this.__assetOverrides=await n.json())}async loadRenderGltf(e=!1){if(this.__renderGltf===void 0||this.__renderGltf.uri==="")return Promise.resolve(!0);await this.__renderGltf.load().catch(t=>(window.epigraph.logger.error({title:`Failed to load asset: ${this.__id}`,details:t,contextOverride:this._loggerContext}),Promise.reject(!1)));for(const t of this.__config.brandMaterialLibraries){const n=this.__appWcRef.experienceData.materialLibraryCollection.materialLibraries.get(t);if(await n?.load(),!n){window.epigraph.logger.warn({title:`Material library ${t} not found in brand material libraries.`,contextOverride:this._loggerContext});continue}this.__brandMaterialLibraries.set(n.id,n);for(const i of n.finishNamesFromAsset)this.finishes.has(i)||this.__finishes.set(i,new ZA(i))}return e&&this.pullFinishesFromRenderGltf(),await this.parseAssetOverrideJson(),Promise.resolve(!0)}async load(e=!1){return Promise.all([this.loadRenderSplat(),this.loadRenderGltf(e),this.loadProxyGltf()])}}var MV=Object.defineProperty,sR=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&MV(e,t,i),i};class rR{constructor({appWcRef:e}){this._loggerContext="SOLUTION MANAGER",this._appWcRef=e}initialize(){window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext})}}const Tb=class qp extends Gc{constructor(){super(),this._loggerContext="SOLUTION MANAGER",this.enabled=!1}static{this.webComponentName="solution-manager"}connectedCallback(){super.connectedCallback(),window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext})}firstUpdated(e){super.firstUpdated(e)}static setupWebComponent(){window.customElements.get(qp.webComponentName)||window.customElements.define(qp.webComponentName,qp)}render(){return ae`
12926
12926
  ${vt.getCustomStylesTemplate()}
12927
- `}};sR([Y({type:Boolean,attribute:"enabled"})],Tb.prototype,"enabled");sR([Y({attribute:!1})],Tb.prototype,"appWcRef");let wl=Tb;class RV{constructor({id:e,name:t,receiver:n,plug:i}){this.__name=t,this.__plug=i,this.__receiver=n,e?this.__id=e:this.__id=`${this.__receiver.uuid}-${this.__plug.uuid}`}get id(){return this.__id}get name(){return this.__name}get plug(){return this.__plug}isPrimary(){return this.__plug?.isPrimary}get receiver(){return this.__receiver}connect(){this.__receiver.connect(this),this.__plug.connect(this)}disconnect(){this.__plug&&this.__plug.disconnect(),this.__receiver&&this.__receiver.disconnect()}}class DV{constructor({id:e,receiver:t,plug:n}){this.__id=e,this.__plug=n,this.__receiver=t}get id(){return this.__id}get plug(){return this.__plug}set plug(e){this.__plug=e}get receiver(){return this.__receiver}set receiver(e){this.__receiver=e}disconnect(){this.__receiver.disconnect(),this.__plug.disconnect()}}class QV extends yn{constructor(e){super(),this.name="ENTITIES",this._loggerContext="SCENE STRUCTURE",this.__appWcRef=e,this.__eventsManager=this.__appWcRef.eventsManager}async setupRootEntity(e,t){const n=await new iR({id:0,name:"Root",proxyGeo:e??"http://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/root-proxy.glb",autoGenerateProxyEntity:!1,renderGeo:t??"http://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/renderGeo/root-render.glb",renderSplat:"",finishes:{},hotspots:[],brandMaterialLibraries:[]},this.__appWcRef);await n.load().catch(()=>Promise.reject(!1));const i=new hl(n,this.__appWcRef);await i.initialize(),this.add(i),this.__rootEntity=i}get rootEntity(){return this.__rootEntity}isEmpty(){return this.__rootEntity===void 0||this.__rootEntity.children.length===0}isNotEmpty(){return!this.isEmpty()}addEntity(e){this.__rootEntity.add(e),this.__eventsManager.structureNodeAddedEvent.fire({node:e})}getFirstEntity(){return this.isEmpty()?null:this.getSceneEntities()[0]}getEntityForAssetName(e){const t=this.getSceneEntities();let n;for(const i of t)if(i.asset.name===e){n=i;break}return n}getEntityForAssetId(e){const t=this.getSceneEntities();let n;for(const i of t)if(i.asset.id===e){n=i;break}return n}getSceneEntities(e=!1){const t=[];return this.__rootEntity.traverse(n=>{!e&&n.uuid===this.__rootEntity.uuid||n instanceof hl&&t.push(n)}),t}getPossibleConnectionsForAssetInScene(e){const t=[];window.epigraph.logger.info({title:"Getting connections for asset in scene:",details:e,contextOverride:this._loggerContext});for(const n of this.getSceneEntities(!0)){const i=n.findPossibleConnectionsForAsset(e);i.length>0&&t.push(...i)}return window.epigraph.logger.table({title:"Possible Connections",details:t}),t}getAllConnectionsInScene(){const e=new Map;return this.traverse(t=>{if(t instanceof ya||t instanceof Ao){if(t.connectionId===""||e.has(t.connectionId))return;let i=null,r=null;if(t instanceof ya?(i=t,r=t.plug):t instanceof Ao&&(i=t.receiver,r=t),i!==null&&r!==null){const a=new DV({id:t.connectionId,receiver:i,plug:r});e.set(t.connectionId,a)}}}),e}}class LV extends rR{constructor(e){super({appWcRef:e}),this._loggerContext="SCENE MANAGER",this.__currentSceneBounds=new In,this.__sceneStructure=new QV(this._appWcRef)}get sceneStructure(){return this.__sceneStructure}get currentSceneBounds(){return this.__currentSceneBounds}recalculateSceneBounds(){this.currentSceneBounds.setFromPoints([new Q]),this.__sceneStructure.isNotEmpty()&&this.__sceneStructure.rootEntity.traverse(e=>{e instanceof Je&&e.userData.isProxyMesh&&this.currentSceneBounds.expandByObject(e)}),this._appWcRef.eventsManager.sceneBoundsChanged.fire()}}class NV extends yn{constructor(e,t){super(),this.__autoGeneratedBoundsBox=new In,this.__autoGeneratedBoundsSize=new Q,this.__activeFinish="",this.name="RENDER",this.__assetEntity=e,this.__textureLoader=t}get asset(){return this.__assetEntity.asset}get activeFinish(){return this.__activeFinish}get allAssetFinishes(){return this.asset.finishes}get allFinishIds(){return this.asset.allFinishIds}get autoGeneratedBoundsBox(){return this.__autoGeneratedBoundsBox}get autoGeneratedBoundsSize(){return this.__autoGeneratedBoundsSize}async initializeRenderGeoEntity(){const e=this.asset?.renderGltf?.resource?.scene?.clone(!0);if(!e)return Promise.reject();this.add(e),this.__autoGeneratedBoundsBox.setFromObject(e,!0),this.__autoGeneratedBoundsBox.getSize(this.__autoGeneratedBoundsSize);const t=new Q;if(this.__autoGeneratedBoundsBox.getCenter(t),this.asset.autoGenerateProxyEntity){window.epigraph.logger.group({title:""}),window.epigraph.logger.info({title:"Attempting to place render geo at the grid for AssetEntity...",details:this.asset,contextOverride:"ASSET ENTITY"});const n=new yn;n.name="rendergeopivot";const i=new ws(.01,.01,.01),r=new Un({color:65280,depthTest:!1}),a=new Je(i,r);n.add(a),this.add(n),n.position.set(t.x,this.__autoGeneratedBoundsBox.min.y,t.z),n.attach(e),n.position.set(0,0,0),this.attach(e),n.removeFromParent(),vt.dispose3(n),window.epigraph.logger.info({title:"Done!!"}),window.epigraph.logger.groupEnd()}}async initializeSplatEntity(){const e=this.asset.renderSplat?.splatMesh;if(!e)return;this.add(e),this.__autoGeneratedBoundsBox.copy(e.getBoundingBox(!1)),this.__autoGeneratedBoundsBox.getSize(this.__autoGeneratedBoundsSize);const t=new Q;if(this.__autoGeneratedBoundsBox.getCenter(t),this.asset.autoGenerateProxyEntity){window.epigraph.logger.group({title:""}),window.epigraph.logger.info({title:"Attempting to place render geo at the grid for AssetEntity...",details:this.asset,contextOverride:"ASSET ENTITY"});const n=new yn;n.name="splatmeshpivot",this.attach(n),n.position.set(t.x,this.__autoGeneratedBoundsBox.max.y,t.z),e.position.set(-t.x,this.__autoGeneratedBoundsBox.max.y,-t.z),n.add(e),n.position.set(0,0,0),this.add(e),n.removeFromParent(),vt.dispose3(n),window.epigraph.logger.info({title:"Done!!"}),window.epigraph.logger.groupEnd()}}async selectAssetFinish(e){window.epigraph.logger.info({title:`Switching to asset finish: ${e}`});const t=new gd(!1);if(this.__assetEntity.isRenderingSplats())return t.success=!0,Promise.resolve(t);const n=this.asset.renderGltf;if(!n)return Promise.reject(t);const i=n.khrVariantsExtension,r=n.khrVariantsExtensionName;if(!i?.variants)return window.epigraph.logger.warn({title:"No KHR_Materials_Variants found in asset. Using default material."}),this.allFinishIds.length===1&&this.allFinishIds.includes(e)&&(this.__activeFinish=e),t.success=!0,Promise.resolve(t);const a=await this.__selectFinishByKHRMaterialsVariantsExtension(i,r,e,n);if(t.success=a.success,t.failed===!0){const o=await this.__selectFinishByMaterialLibrary(i,r,e);t.success=o.success}return this.__activeFinish=e,Promise.resolve(t)}__selectFinishByKHRMaterialsVariantsExtension(e,t,n,i){const r=new gd(!1);window.epigraph.logger.info({title:"Attempting to load finish by KHR Materials Variants",details:n});const a=e.variants.findIndex(o=>o.name===n);return this.traverse(async o=>{if(!(o instanceof Je)||!o.isMesh||!o.userData.gltfExtensions)return;const l=o.userData.gltfExtensions[t];if(!l)return window.epigraph.logger.error({title:"No variants extension found in mesh.",details:l}),Promise.reject(r);o.userData.originalMaterial||(o.userData.originalMaterial=o.material);const c=l.mappings.find(h=>h.variants.includes(a));if(c&&i.resource){const h=i.resource.parser;o.material=await h.getDependency("material",c.material),h.assignFinalMaterial(o),r.success=!0}else window.epigraph.logger.info({title:"Variant has no effect on this Object.",details:{object:o,finishId:n}}),o.material=o.userData.originalMaterial,r.success=!1}),r}async __selectFinishByMaterialLibrary(e,t,n){const i=new gd(!1);window.epigraph.logger.info({title:"Attempting to load finish by material library",details:n});for(const r of this.asset.brandMaterialLibraries.values()){const a=await r.getMaterialForFinishId(n);a!==null&&this.traverse(async o=>{o instanceof Je&&(o.material=a,await this.__processAnyOverridesForAsset(n,o),o.material.needsUpdate=!0)})}return i.success=!1,i}async __processAnyOverridesForAsset(e,t){const n=this.asset.assetOverrides;if(!n)return;const i=n.brandMaterialLibrary;if(i){const r=i[e];if(r){r.sort((a,o)=>{const l=a.name.includes("."),c=o.name.includes(".");return l&&!c?1:!l&&c?-1:0});for(const a of r){const o=a.name,l=a.value,c=a.type,h=t.material;switch(window.epigraph.logger.info({title:`Override Property on asset: ${this.asset.id} MLIB: ${o} -> overrides[override]`}),c){case"image":await this.__processImageOverride(o,l,h);break;case"color":await this.__processColorOverride(o,l,h);break;case"number":await this.__processNumberOverride(o,l,h);break}}}}}__applyFinalPropertyValue(e,t,n){let i=n;const r=e.split(".");r.length===2&&(i=i[r[0]],e=r[1]),!(!i||!(e in i))&&(i[e]=t)}async __processImageOverride(e,t,n){const i=new URL(t,`${this.asset.assetRootDir}overrides/`).href,r=await this.__textureLoader.loadAsync(i).catch(a=>{window.epigraph.logger.error({title:`Couldn't load texture: ${i}`,details:a,contextOverride:"ASSET ENTITY"})});r&&(r.flipY=!1,this.__applyFinalPropertyValue(e,r,n))}__processColorOverride(e,t,n){const i=JSON.parse(t),r=new Te(i[0],i[1],i[2]);this.__applyFinalPropertyValue(e,r,n)}__processNumberOverride(e,t,n){this.__applyFinalPropertyValue(e,parseFloat(t),n)}highlight(){this.traverseVisible(e=>{const t=e;if(t.isMesh){const n=t.material;if(!n.emissive)return;(n.emissive.r>0||n.emissive.g>0||n.emissive.b>0)&&(n.userData.epgData={orignalEmissive:n.emissive.clone(),originalEmissiveIntensity:n.emissiveIntensity}),n.emissive.r=1,n.emissive.g=1,n.emissive.b=1,n.emissiveIntensity=1}})}unhighlight(){this.traverseVisible(e=>{const t=e;if(t.isMesh){const n=t.material;if(!n.emissive)return;const i=n?.userData?.epgData?.orignalEmissive;i?(n.emissive.r=i.r,n.emissive.g=i.g,n.emissive.b=i.b):(n.emissive.r=0,n.emissive.g=0,n.emissive.b=0);const r=n?.userData?.epgData?.orignalEmissiveIntensity;n.emissiveIntensity=r!==void 0?r:0}})}}class PV extends yn{constructor(e){super(),this.name="PROXY",this.__assetEntity=e}get asset(){return this.__assetEntity.asset}}class FV extends yn{constructor(e){super(),this.name="HOTSPOTS",this.__assetEntity=e}get asset(){return this.__assetEntity.asset}}class hl extends SV{constructor(e,t){super(),this.epgType="ENTITY_ASSET",this.__autoGeneratedProxy=new yn,this.__animationMixer=null,this.__animations=new Map,this.name=e.name,this.__appWcRef=t,this.__proxyEntity=new PV(this),this.add(this.__proxyEntity),this.__renderEntity=new NV(this,this.__appWcRef.loaders.textureLoader),this.add(this.__renderEntity),this.__hotspotsEntity=new FV(this),this.add(this.__hotspotsEntity),this.__asset=e}get asset(){return this.__asset}get isRoot(){return this.name.toLowerCase()==="root"}get proxyEntity(){return this.__proxyEntity}get renderEntity(){return this.__renderEntity}get activeFinish(){return this.__renderEntity.activeFinish}get allAssetFinishes(){return this.__renderEntity.allAssetFinishes}get allFinishIds(){return this.__renderEntity.allFinishIds}highlight(){this.__renderEntity.highlight()}unhighlight(){this.__renderEntity.unhighlight()}addHotspot(e){e.entity.name=`HOTSPOT-${this.asset.name}-${crypto.randomUUID()}`,e.entity.userData.epgId=e.hotspotId,e.entity.position.set(e.config.position.x,e.config.position.y,e.config.position.z),this.__hotspotsEntity.add(e.entity)}removeHotspot(e){let t;this.__hotspotsEntity.traverse(n=>{n.userData.epgId===e&&(t=n)}),t&&(t.removeFromParent(),vt.dispose3(t))}isRenderingMesh(){return this.__appWcRef.productSettings.render.mode===fa.GEO}isRenderingSplats(){return this.__appWcRef.productSettings.render.mode===fa.SPLAT}async selectAssetFinish(e){return this.__renderEntity.selectAssetFinish(e)}findPossibleConnectionsForAsset(e){const t=[];return window.epigraph.logger.info({title:"Getting connections for asset in scene:",details:e}),this.__proxyEntity.traverse(n=>{if(!(n instanceof ya))return;const i=n,r=e.proxyGltf?.plugs??[];for(const a of r)a.connectionId===i.connectionId&&t.push(new RV({name:a.connectionId,receiver:i,plug:a}))}),t}getAnimationMixer(){return this.__animationMixer}getAllAnimations(){return this.__animations}async initialize(){this.__asset.autoGenerateProxyEntity?(await this.__initializeRenderEntity(),await this.__initializeProxyEntity()):(await this.__initializeProxyEntity(),await this.__initializeRenderEntity())}async __initializeRenderEntity(){this.__appWcRef.productSettings.render.mode===fa.GEO?(await this.__renderEntity.initializeRenderGeoEntity(),this.__updateAnimations()):await this.__renderEntity.initializeSplatEntity()}async __initializeProxyEntity(){let e=this.__asset.proxyGltf.resource?.scene.clone();if((!e||this.__asset.autoGenerateProxyEntity)&&(this.__autoGenerateProxyScene(),e=this.__autoGeneratedProxy),!e)return window.epigraph.logger.error({title:"Failed to load OR auto generate proxy asset",details:this.__asset,contextOverride:"ASSET ENTITY"}),Promise.reject();this.__proxyEntity.add(e),this.__proxyEntity.traverse(t=>{t instanceof Je&&(t.userData.isProxyMesh=!0,t.visible=!1)})}__autoGenerateProxyScene(){window.epigraph.logger.info({title:"Attempting to auto generate proxy for asset...",details:this.__asset,contextOverride:"ASSET ENTITY"});const e=new ws,t=new Un({color:65280,opacity:.5,transparent:!0}),n=new Je(e,t);n.name="AutoGeneratedProxyMesh",n.scale.set(this.__renderEntity.autoGeneratedBoundsSize.x,this.__renderEntity.autoGeneratedBoundsSize.y,this.__renderEntity.autoGeneratedBoundsSize.z);const i=new Q;this.__renderEntity.autoGeneratedBoundsBox.getCenter(i);const r=new yn;r.name="proxygeopivot";const a=new og(.01,10,10),o=new Un({color:255,depthTest:!1}),l=new Je(a,o);r.add(l),this.__proxyEntity.add(r),r.translateY(-this.__renderEntity.autoGeneratedBoundsSize.y*.5),r.attach(n),r.position.set(0,0,0),this.__proxyEntity.add(n),r.removeFromParent(),vt.dispose3(r),this.__autoGeneratedProxy.add(n)}__updateAnimations(){if(this.__asset.renderGltf&&(this.__animationMixer=null,this.__animations.clear(),this.__renderEntity.animations&&this.__asset.renderGltf.resource&&this.__asset.renderGltf.resource.animations.length>0)){this.__animationMixer=new xT(this.__renderEntity.children[0]);for(const e of this.__asset.renderGltf.resource.animations)this.__animations.set(e.name,this.__animationMixer.clipAction(e))}}}function aR(s,e,t,n){const i=Object.entries(s);class r extends Tn{static key=hr.generateUUID();constructor(o){super({uniforms:i.reduce((l,[c,h])=>{const u=q_.clone({[c]:{value:h}});return{...l,...u}},{}),vertexShader:e,fragmentShader:t});for(const[l]of i)Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:c=>this.uniforms[l].value=c});Object.assign(this,o)}}return r}const kV=aR({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");function UV(s){return s.isLight}function OV(s){return!!s.geometry}const GV=aR({color:new Te(0),blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv;
12927
+ `}};sR([Y({type:Boolean,attribute:"enabled"})],Tb.prototype,"enabled");sR([Y({attribute:!1})],Tb.prototype,"appWcRef");let wl=Tb;class RV{constructor({id:e,name:t,receiver:n,plug:i}){this.__name=t,this.__plug=i,this.__receiver=n,e?this.__id=e:this.__id=`${this.__receiver.uuid}-${this.__plug.uuid}`}get id(){return this.__id}get name(){return this.__name}get plug(){return this.__plug}isPrimary(){return this.__plug?.isPrimary}get receiver(){return this.__receiver}connect(){this.__receiver.connect(this),this.__plug.connect(this)}disconnect(){this.__plug&&this.__plug.disconnect(),this.__receiver&&this.__receiver.disconnect()}}class DV{constructor({id:e,receiver:t,plug:n}){this.__id=e,this.__plug=n,this.__receiver=t}get id(){return this.__id}get plug(){return this.__plug}set plug(e){this.__plug=e}get receiver(){return this.__receiver}set receiver(e){this.__receiver=e}disconnect(){this.__receiver.disconnect(),this.__plug.disconnect()}}class QV extends yn{constructor(e){super(),this.name="ENTITIES",this._loggerContext="SCENE STRUCTURE",this.__appWcRef=e,this.__eventsManager=this.__appWcRef.eventsManager}async setupRootEntity(e,t){const n=await new iR({id:0,name:"Root",proxyGeo:e??"https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/root-proxy.glb",autoGenerateProxyEntity:!1,renderGeo:t??"https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/renderGeo/root-render.glb",renderSplat:"",finishes:{},hotspots:[],brandMaterialLibraries:[]},this.__appWcRef);await n.load().catch(()=>Promise.reject(!1));const i=new hl(n,this.__appWcRef);await i.initialize(),this.add(i),this.__rootEntity=i}get rootEntity(){return this.__rootEntity}isEmpty(){return this.__rootEntity===void 0||this.__rootEntity.children.length===0}isNotEmpty(){return!this.isEmpty()}addEntity(e){this.__rootEntity.add(e),this.__eventsManager.structureNodeAddedEvent.fire({node:e})}getFirstEntity(){return this.isEmpty()?null:this.getSceneEntities()[0]}getEntityForAssetName(e){const t=this.getSceneEntities();let n;for(const i of t)if(i.asset.name===e){n=i;break}return n}getEntityForAssetId(e){const t=this.getSceneEntities();let n;for(const i of t)if(i.asset.id===e){n=i;break}return n}getSceneEntities(e=!1){const t=[];return this.__rootEntity.traverse(n=>{!e&&n.uuid===this.__rootEntity.uuid||n instanceof hl&&t.push(n)}),t}getPossibleConnectionsForAssetInScene(e){const t=[];window.epigraph.logger.info({title:"Getting connections for asset in scene:",details:e,contextOverride:this._loggerContext});for(const n of this.getSceneEntities(!0)){const i=n.findPossibleConnectionsForAsset(e);i.length>0&&t.push(...i)}return window.epigraph.logger.table({title:"Possible Connections",details:t}),t}getAllConnectionsInScene(){const e=new Map;return this.traverse(t=>{if(t instanceof ya||t instanceof Ao){if(t.connectionId===""||e.has(t.connectionId))return;let i=null,r=null;if(t instanceof ya?(i=t,r=t.plug):t instanceof Ao&&(i=t.receiver,r=t),i!==null&&r!==null){const a=new DV({id:t.connectionId,receiver:i,plug:r});e.set(t.connectionId,a)}}}),e}}class LV extends rR{constructor(e){super({appWcRef:e}),this._loggerContext="SCENE MANAGER",this.__currentSceneBounds=new In,this.__sceneStructure=new QV(this._appWcRef)}get sceneStructure(){return this.__sceneStructure}get currentSceneBounds(){return this.__currentSceneBounds}recalculateSceneBounds(){this.currentSceneBounds.setFromPoints([new Q]),this.__sceneStructure.isNotEmpty()&&this.__sceneStructure.rootEntity.traverse(e=>{e instanceof Je&&e.userData.isProxyMesh&&this.currentSceneBounds.expandByObject(e)}),this._appWcRef.eventsManager.sceneBoundsChanged.fire()}}class NV extends yn{constructor(e,t){super(),this.__autoGeneratedBoundsBox=new In,this.__autoGeneratedBoundsSize=new Q,this.__activeFinish="",this.name="RENDER",this.__assetEntity=e,this.__textureLoader=t}get asset(){return this.__assetEntity.asset}get activeFinish(){return this.__activeFinish}get allAssetFinishes(){return this.asset.finishes}get allFinishIds(){return this.asset.allFinishIds}get autoGeneratedBoundsBox(){return this.__autoGeneratedBoundsBox}get autoGeneratedBoundsSize(){return this.__autoGeneratedBoundsSize}async initializeRenderGeoEntity(){const e=this.asset?.renderGltf?.resource?.scene?.clone(!0);if(!e)return Promise.reject();this.add(e),this.__autoGeneratedBoundsBox.setFromObject(e,!0),this.__autoGeneratedBoundsBox.getSize(this.__autoGeneratedBoundsSize);const t=new Q;if(this.__autoGeneratedBoundsBox.getCenter(t),this.asset.autoGenerateProxyEntity){window.epigraph.logger.group({title:""}),window.epigraph.logger.info({title:"Attempting to place render geo at the grid for AssetEntity...",details:this.asset,contextOverride:"ASSET ENTITY"});const n=new yn;n.name="rendergeopivot";const i=new ws(.01,.01,.01),r=new Un({color:65280,depthTest:!1}),a=new Je(i,r);n.add(a),this.add(n),n.position.set(t.x,this.__autoGeneratedBoundsBox.min.y,t.z),n.attach(e),n.position.set(0,0,0),this.attach(e),n.removeFromParent(),vt.dispose3(n),window.epigraph.logger.info({title:"Done!!"}),window.epigraph.logger.groupEnd()}}async initializeSplatEntity(){const e=this.asset.renderSplat?.splatMesh;if(!e)return;this.add(e),this.__autoGeneratedBoundsBox.copy(e.getBoundingBox(!1)),this.__autoGeneratedBoundsBox.getSize(this.__autoGeneratedBoundsSize);const t=new Q;if(this.__autoGeneratedBoundsBox.getCenter(t),this.asset.autoGenerateProxyEntity){window.epigraph.logger.group({title:""}),window.epigraph.logger.info({title:"Attempting to place render geo at the grid for AssetEntity...",details:this.asset,contextOverride:"ASSET ENTITY"});const n=new yn;n.name="splatmeshpivot",this.attach(n),n.position.set(t.x,this.__autoGeneratedBoundsBox.max.y,t.z),e.position.set(-t.x,this.__autoGeneratedBoundsBox.max.y,-t.z),n.add(e),n.position.set(0,0,0),this.add(e),n.removeFromParent(),vt.dispose3(n),window.epigraph.logger.info({title:"Done!!"}),window.epigraph.logger.groupEnd()}}async selectAssetFinish(e){window.epigraph.logger.info({title:`Switching to asset finish: ${e}`});const t=new gd(!1);if(this.__assetEntity.isRenderingSplats())return t.success=!0,Promise.resolve(t);const n=this.asset.renderGltf;if(!n)return Promise.reject(t);const i=n.khrVariantsExtension,r=n.khrVariantsExtensionName;if(!i?.variants)return window.epigraph.logger.warn({title:"No KHR_Materials_Variants found in asset. Using default material."}),this.allFinishIds.length===1&&this.allFinishIds.includes(e)&&(this.__activeFinish=e),t.success=!0,Promise.resolve(t);const a=await this.__selectFinishByKHRMaterialsVariantsExtension(i,r,e,n);if(t.success=a.success,t.failed===!0){const o=await this.__selectFinishByMaterialLibrary(i,r,e);t.success=o.success}return this.__activeFinish=e,Promise.resolve(t)}__selectFinishByKHRMaterialsVariantsExtension(e,t,n,i){const r=new gd(!1);window.epigraph.logger.info({title:"Attempting to load finish by KHR Materials Variants",details:n});const a=e.variants.findIndex(o=>o.name===n);return this.traverse(async o=>{if(!(o instanceof Je)||!o.isMesh||!o.userData.gltfExtensions)return;const l=o.userData.gltfExtensions[t];if(!l)return window.epigraph.logger.error({title:"No variants extension found in mesh.",details:l}),Promise.reject(r);o.userData.originalMaterial||(o.userData.originalMaterial=o.material);const c=l.mappings.find(h=>h.variants.includes(a));if(c&&i.resource){const h=i.resource.parser;o.material=await h.getDependency("material",c.material),h.assignFinalMaterial(o),r.success=!0}else window.epigraph.logger.info({title:"Variant has no effect on this Object.",details:{object:o,finishId:n}}),o.material=o.userData.originalMaterial,r.success=!1}),r}async __selectFinishByMaterialLibrary(e,t,n){const i=new gd(!1);window.epigraph.logger.info({title:"Attempting to load finish by material library",details:n});for(const r of this.asset.brandMaterialLibraries.values()){const a=await r.getMaterialForFinishId(n);a!==null&&this.traverse(async o=>{o instanceof Je&&(o.material=a,await this.__processAnyOverridesForAsset(n,o),o.material.needsUpdate=!0)})}return i.success=!1,i}async __processAnyOverridesForAsset(e,t){const n=this.asset.assetOverrides;if(!n)return;const i=n.brandMaterialLibrary;if(i){const r=i[e];if(r){r.sort((a,o)=>{const l=a.name.includes("."),c=o.name.includes(".");return l&&!c?1:!l&&c?-1:0});for(const a of r){const o=a.name,l=a.value,c=a.type,h=t.material;switch(window.epigraph.logger.info({title:`Override Property on asset: ${this.asset.id} MLIB: ${o} -> overrides[override]`}),c){case"image":await this.__processImageOverride(o,l,h);break;case"color":await this.__processColorOverride(o,l,h);break;case"number":await this.__processNumberOverride(o,l,h);break}}}}}__applyFinalPropertyValue(e,t,n){let i=n;const r=e.split(".");r.length===2&&(i=i[r[0]],e=r[1]),!(!i||!(e in i))&&(i[e]=t)}async __processImageOverride(e,t,n){const i=new URL(t,`${this.asset.assetRootDir}overrides/`).href,r=await this.__textureLoader.loadAsync(i).catch(a=>{window.epigraph.logger.error({title:`Couldn't load texture: ${i}`,details:a,contextOverride:"ASSET ENTITY"})});r&&(r.flipY=!1,this.__applyFinalPropertyValue(e,r,n))}__processColorOverride(e,t,n){const i=JSON.parse(t),r=new Te(i[0],i[1],i[2]);this.__applyFinalPropertyValue(e,r,n)}__processNumberOverride(e,t,n){this.__applyFinalPropertyValue(e,parseFloat(t),n)}highlight(){this.traverseVisible(e=>{const t=e;if(t.isMesh){const n=t.material;if(!n.emissive)return;(n.emissive.r>0||n.emissive.g>0||n.emissive.b>0)&&(n.userData.epgData={orignalEmissive:n.emissive.clone(),originalEmissiveIntensity:n.emissiveIntensity}),n.emissive.r=1,n.emissive.g=1,n.emissive.b=1,n.emissiveIntensity=1}})}unhighlight(){this.traverseVisible(e=>{const t=e;if(t.isMesh){const n=t.material;if(!n.emissive)return;const i=n?.userData?.epgData?.orignalEmissive;i?(n.emissive.r=i.r,n.emissive.g=i.g,n.emissive.b=i.b):(n.emissive.r=0,n.emissive.g=0,n.emissive.b=0);const r=n?.userData?.epgData?.orignalEmissiveIntensity;n.emissiveIntensity=r!==void 0?r:0}})}}class PV extends yn{constructor(e){super(),this.name="PROXY",this.__assetEntity=e}get asset(){return this.__assetEntity.asset}}class FV extends yn{constructor(e){super(),this.name="HOTSPOTS",this.__assetEntity=e}get asset(){return this.__assetEntity.asset}}class hl extends SV{constructor(e,t){super(),this.epgType="ENTITY_ASSET",this.__autoGeneratedProxy=new yn,this.__animationMixer=null,this.__animations=new Map,this.name=e.name,this.__appWcRef=t,this.__proxyEntity=new PV(this),this.add(this.__proxyEntity),this.__renderEntity=new NV(this,this.__appWcRef.loaders.textureLoader),this.add(this.__renderEntity),this.__hotspotsEntity=new FV(this),this.add(this.__hotspotsEntity),this.__asset=e}get asset(){return this.__asset}get isRoot(){return this.name.toLowerCase()==="root"}get proxyEntity(){return this.__proxyEntity}get renderEntity(){return this.__renderEntity}get activeFinish(){return this.__renderEntity.activeFinish}get allAssetFinishes(){return this.__renderEntity.allAssetFinishes}get allFinishIds(){return this.__renderEntity.allFinishIds}highlight(){this.__renderEntity.highlight()}unhighlight(){this.__renderEntity.unhighlight()}addHotspot(e){e.entity.name=`HOTSPOT-${this.asset.name}-${crypto.randomUUID()}`,e.entity.userData.epgId=e.hotspotId,e.entity.position.set(e.config.position.x,e.config.position.y,e.config.position.z),this.__hotspotsEntity.add(e.entity)}removeHotspot(e){let t;this.__hotspotsEntity.traverse(n=>{n.userData.epgId===e&&(t=n)}),t&&(t.removeFromParent(),vt.dispose3(t))}isRenderingMesh(){return this.__appWcRef.productSettings.render.mode===fa.GEO}isRenderingSplats(){return this.__appWcRef.productSettings.render.mode===fa.SPLAT}async selectAssetFinish(e){return this.__renderEntity.selectAssetFinish(e)}findPossibleConnectionsForAsset(e){const t=[];return window.epigraph.logger.info({title:"Getting connections for asset in scene:",details:e}),this.__proxyEntity.traverse(n=>{if(!(n instanceof ya))return;const i=n,r=e.proxyGltf?.plugs??[];for(const a of r)a.connectionId===i.connectionId&&t.push(new RV({name:a.connectionId,receiver:i,plug:a}))}),t}getAnimationMixer(){return this.__animationMixer}getAllAnimations(){return this.__animations}async initialize(){this.__asset.autoGenerateProxyEntity?(await this.__initializeRenderEntity(),await this.__initializeProxyEntity()):(await this.__initializeProxyEntity(),await this.__initializeRenderEntity())}async __initializeRenderEntity(){this.__appWcRef.productSettings.render.mode===fa.GEO?(await this.__renderEntity.initializeRenderGeoEntity(),this.__updateAnimations()):await this.__renderEntity.initializeSplatEntity()}async __initializeProxyEntity(){let e=this.__asset.proxyGltf.resource?.scene.clone();if((!e||this.__asset.autoGenerateProxyEntity)&&(this.__autoGenerateProxyScene(),e=this.__autoGeneratedProxy),!e)return window.epigraph.logger.error({title:"Failed to load OR auto generate proxy asset",details:this.__asset,contextOverride:"ASSET ENTITY"}),Promise.reject();this.__proxyEntity.add(e),this.__proxyEntity.traverse(t=>{t instanceof Je&&(t.userData.isProxyMesh=!0,t.visible=!1)})}__autoGenerateProxyScene(){window.epigraph.logger.info({title:"Attempting to auto generate proxy for asset...",details:this.__asset,contextOverride:"ASSET ENTITY"});const e=new ws,t=new Un({color:65280,opacity:.5,transparent:!0}),n=new Je(e,t);n.name="AutoGeneratedProxyMesh",n.scale.set(this.__renderEntity.autoGeneratedBoundsSize.x,this.__renderEntity.autoGeneratedBoundsSize.y,this.__renderEntity.autoGeneratedBoundsSize.z);const i=new Q;this.__renderEntity.autoGeneratedBoundsBox.getCenter(i);const r=new yn;r.name="proxygeopivot";const a=new og(.01,10,10),o=new Un({color:255,depthTest:!1}),l=new Je(a,o);r.add(l),this.__proxyEntity.add(r),r.translateY(-this.__renderEntity.autoGeneratedBoundsSize.y*.5),r.attach(n),r.position.set(0,0,0),this.__proxyEntity.add(n),r.removeFromParent(),vt.dispose3(r),this.__autoGeneratedProxy.add(n)}__updateAnimations(){if(this.__asset.renderGltf&&(this.__animationMixer=null,this.__animations.clear(),this.__renderEntity.animations&&this.__asset.renderGltf.resource&&this.__asset.renderGltf.resource.animations.length>0)){this.__animationMixer=new xT(this.__renderEntity.children[0]);for(const e of this.__asset.renderGltf.resource.animations)this.__animations.set(e.name,this.__animationMixer.clipAction(e))}}}function aR(s,e,t,n){const i=Object.entries(s);class r extends Tn{static key=hr.generateUUID();constructor(o){super({uniforms:i.reduce((l,[c,h])=>{const u=q_.clone({[c]:{value:h}});return{...l,...u}},{}),vertexShader:e,fragmentShader:t});for(const[l]of i)Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:c=>this.uniforms[l].value=c});Object.assign(this,o)}}return r}const kV=aR({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");function UV(s){return s.isLight}function OV(s){return!!s.geometry}const GV=aR({color:new Te(0),blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv;
12928
12928
  void main() {
12929
12929
  gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);
12930
12930
  vUv = uv;
@@ -17272,7 +17272,7 @@ void main() {
17272
17272
  .model-viewer.hide {
17273
17273
  visibility: hidden;
17274
17274
  }
17275
- `]}__registerModelViewerWebComponent(){this.canLaunchAr()&&(window.customElements.get("model-viewer")||window.customElements.define("model-viewer",BW))}static setupWebComponent(){window.customElements.get(hf.webComponentName)||window.customElements.define(hf.webComponentName,hf)}get arLink(){return this.__arLink}showArModal(){this.arModalElem.showModal();const e=new Hr(!0,Hr.PANEL_TYPE.AR,Hr.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}showQr(){this.qrModalElem.showModal();const e=new Hr(!0,Hr.PANEL_TYPE.QR,Hr.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}async resolveSrcUrl(){if(this.glbSrc="",this.usdzSrc="",Yf){const e=await this.appWcRef.getGlbUrlForAr();if(e===null){window.epigraph.logger.error({title:"Error getting the GLB for AR session"});return}this.glbSrc=e}else qf&&(this.usdzSrc=await this.appWcRef.getUsdzUrlForAr(),this.glbSrc="http://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb")}async launchAR(){if(this.canLaunchAr()){const e=new hD([]);this.appWcRef.epigraphAnalytics.sendEvent(e),this.showArModal(),await this.resolveSrcUrl()}else{const e=vt.generateShareableUrl({baseUrl:this.appWcRef.baseUrlOverride,identifier:this.appWcRef.identifier,identifierType:this.appWcRef.identifierType,arCompatible:!0}),t=await this.appWcRef.qrCodeGenerator.generateQrCode({text:e.href});this.qrModalElem.qrCodeImage=t,this.showQr()}return Promise.resolve(!0)}async onArModalPermissionsClicked(){await this.modelViewerElem.activateAR()}canLaunchAr(){return dw&&(Yf||h_||qf)}isARSessionActive(){return this.modelViewerElem.getAttribute("ar-status")==="presenting"}getMinimumRequirementsString(){let e="";return dw&&(HR?e="iOS 16 and above":h_&&(e="Android 12 and above")),e}onArModalClose(){const e=new $r(!0,$r.PANEL_TYPE.AR,$r.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}__renderArModal(){return ae`<epg-modal-ar
17275
+ `]}__registerModelViewerWebComponent(){this.canLaunchAr()&&(window.customElements.get("model-viewer")||window.customElements.define("model-viewer",BW))}static setupWebComponent(){window.customElements.get(hf.webComponentName)||window.customElements.define(hf.webComponentName,hf)}get arLink(){return this.__arLink}showArModal(){this.arModalElem.showModal();const e=new Hr(!0,Hr.PANEL_TYPE.AR,Hr.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}showQr(){this.qrModalElem.showModal();const e=new Hr(!0,Hr.PANEL_TYPE.QR,Hr.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}async resolveSrcUrl(){if(this.glbSrc="",this.usdzSrc="",Yf){const e=await this.appWcRef.getGlbUrlForAr();if(e===null){window.epigraph.logger.error({title:"Error getting the GLB for AR session"});return}this.glbSrc=e}else qf&&(this.usdzSrc=await this.appWcRef.getUsdzUrlForAr(),this.glbSrc="https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb")}async launchAR(){if(this.canLaunchAr()){const e=new hD([]);this.appWcRef.epigraphAnalytics.sendEvent(e),this.showArModal(),await this.resolveSrcUrl()}else{const e=vt.generateShareableUrl({baseUrl:this.appWcRef.baseUrlOverride,identifier:this.appWcRef.identifier,identifierType:this.appWcRef.identifierType,arCompatible:!0}),t=await this.appWcRef.qrCodeGenerator.generateQrCode({text:e.href});this.qrModalElem.qrCodeImage=t,this.showQr()}return Promise.resolve(!0)}async onArModalPermissionsClicked(){await this.modelViewerElem.activateAR()}canLaunchAr(){return dw&&(Yf||h_||qf)}isARSessionActive(){return this.modelViewerElem.getAttribute("ar-status")==="presenting"}getMinimumRequirementsString(){let e="";return dw&&(HR?e="iOS 16 and above":h_&&(e="Android 12 and above")),e}onArModalClose(){const e=new $r(!0,$r.PANEL_TYPE.AR,$r.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}__renderArModal(){return ae`<epg-modal-ar
17276
17276
  id="arModal"
17277
17277
  powered-by-epigraph
17278
17278
  @epgOnLaunchArClicked=${this.onArModalPermissionsClicked.bind(this)}
@@ -17300,7 +17300,7 @@ void main() {
17300
17300
  `:ae`
17301
17301
  ${super.render()}
17302
17302
  ${this.__renderQrModal()}
17303
- `}};Nl([Pt("#modelViewer")],Eo.prototype,"modelViewerElem");Nl([Pt("#arModal")],Eo.prototype,"arModalElem");Nl([Pt("#qrModal")],Eo.prototype,"qrModalElem");Nl([Y({attribute:!1})],Eo.prototype,"appWcRef");Nl([Y({type:String,attribute:"glb-src"})],Eo.prototype,"glbSrc");Nl([Y({type:String,attribute:"usdz-src"})],Eo.prototype,"usdzSrc");Nl([Y({type:Boolean,attribute:"debug"})],Eo.prototype,"debug");let TW=Eo;class At{constructor(e,t,n=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=n}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class MW extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new At(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new At(this,"experienceUpdated",""),this.productSettingUpdatedEvent=new At(this,"productSettingUpdatedEvent",""),this.productSettingsShadowTypeUpdatedEvent=new At(this,"productSettingsShadowTypeUpdatedEvent",""),this.productSettingsSavedEvent=new At(this,"productsettingssavedevent",""),this.appReadyEvent=new At(this,"appReady",""),this.appFailedEvent=new At(this,"appFailed",""),this.productClassChangedEvent=new At(this,"productClassChanged",""),this.productChangedEvent=new At(this,"productChanged",""),this.variantChangedEvent=new At(this,"variantChanged",""),this.structureNodeAddedEvent=new At(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new At(this,"structureNodeRemoved",""),this.structureChangedEvent=new At(this,"structureChanged",""),this.showNodeLoadingIcon=new At(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new At(this,"nodeLoadingHide",""),this.cameraFitEvent=new At(this,"cameraFit",""),this.hotspotsUpdatedEvent=new At(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new At(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new At(this,"hotspotClicked",""),this.hotspotOpenEvent=new At(this,"hotspotOpen",""),this.hotspotClosedEvent=new At(this,"hotspotClosed",""),this.hotspotNextEvent=new At(this,"hotspotNext",""),this.hotspotPreviousEvent=new At(this,"hotspotPrevious",""),this.sceneBoundsChanged=new At(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new At(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new At(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new At(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new At(this,"arGlbReady",""),this.cartChangedEvent=new At(this,"cartChanged",""),this.sceneRestartedEvent=new At(this,"sceneRestarted",""),this.pickerFoundPosition=new At(this,"pickerFoundPosition",""),this.frameUpdated=new At(this,"frameUpdated",""),this.cameraControlsStart=new At(this,"cameraControlsStart",""),this.inputStart=new At(this,"inputStart",""),this.inputMove=new At(this,"inputMove",""),this.inputEnd=new At(this,"inputEnd",""),this.cameraMoveToTransform=new At(this,"cameraMoveToTransform",""),this.debugChanged=new At(this,"debugChanged",""),this.showSettingsChanged=new At(this,"showSettingsChanged",""),this.webComponentResized=new At(this,"webcomponentresized")}}class RW{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new iR(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}hasAnyAssetWithSplat(){for(const e of Object.values(this.__config))if(e.renderSplat)return!0;return!1}}class DW{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class QW{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const n=new DW(t);this.__productParts.push(n)}}}class LW{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const n of e){const i=new QW(n,this.__productId);i&&this.addProductVariant(i)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case $o.SKU:return this.getProductVariantBySku(e);case $o.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case $o.ASIN:return this.getProductVariantByAsin(e);case $o.UPC:return this.getProductVariantByUpc(e);case $o.EXPERIENCE_ID:return;case $o.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class NW extends nR{constructor(e){super(e),this._materialVariantMappings={}}async _parseLoadedGltf(){await super._parseLoadedGltf();const e=this.resource?.scene;if(e===void 0||e.children.length<=0)return;const t=e.children[0],n=this.finishNamesFromAsset;for(const i of t.userData.gltfExtensions.KHR_materials_variants.mappings){const r=n[i.variants[0]];this._materialVariantMappings[r]=i.material}}async getMaterialForFinishId(e){return this._materialVariantMappings[e]===void 0?null:await this.resource?.parser.getDependency("material",this._materialVariantMappings[e])}}class PW{constructor(e){this.__appWcRef=e,this.__materialLibraries=new Map}get materialLibraries(){return this.__materialLibraries}makeEmpty(e={}){const t=Object.keys(e);for(const n of this.__materialLibraries.keys())t.includes(n)||this.__materialLibraries.delete(n)}async addMaterialLibrary(e,t){const n=new NW({id:e,uri:t,preload:!1,appWcRef:this.__appWcRef});return this.__materialLibraries.set(n.id,n),n}}class FW{constructor(){this.__defaultValues={postEffect:{ao:!1},render:{envMap:"https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr",mode:fa.GEO,splatMode:{blurAmount:1,preBlurAmount:1}},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,infinitePolarAngle:!1,minPolarAngle:0,maxPolarAngle:6.25,infiniteAzimuthAngle:!0,minAzimuthAngle:0,maxAzimuthAngle:6.25},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:md.ACCUMULATIVE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}},this.deepCopyProductSettings(this.__defaultValues)}asJson(){return this.__values}deepCopyProductSettings(e){this.__values=JSON.parse(JSON.stringify(this.__defaultValues)),e.render&&(e.render.envMap&&(this.__values.render.envMap=e.render.envMap),e.render.mode&&(this.__values.render.mode=e.render.mode),e.render.splatMode&&(e.render.splatMode.blurAmount&&(this.__values.render.splatMode.blurAmount=e.render.splatMode.blurAmount),e.render.splatMode.preBlurAmount&&(this.__values.render.splatMode.preBlurAmount=e.render.splatMode.preBlurAmount))),e.camera&&(e.camera.initial&&(this.__values.camera.initial=e.camera.initial),e.camera.backgroundColor&&(this.__values.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(this.__values.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(this.__values.camera.focalLength=e.camera.focalLength),e.camera.canPan!==void 0&&(this.__values.camera.canPan=e.camera.canPan),e.camera.canZoom!==void 0&&(this.__values.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(this.__values.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(this.__values.camera.maxDistance=e.camera.maxDistance),e.camera.infinitePolarAngle&&(this.__values.camera.infinitePolarAngle=e.camera.infinitePolarAngle),e.camera.minPolarAngle&&(this.__values.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(this.__values.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.infiniteAzimuthAngle&&(this.__values.camera.infiniteAzimuthAngle=e.camera.infiniteAzimuthAngle),e.camera.minAzimuthAngle&&(this.__values.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(this.__values.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(this.__values.postEffect=e.postEffect),e.renderQuality&&(this.__values.renderQuality=e.renderQuality),e.screenshots&&(this.__values.screenshots=e.screenshots),e.shadows?.shadowType&&(this.__values.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(this.__values.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(this.__values.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(this.__values.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(this.__values.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(this.__values.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(this.__values.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons!==void 0&&(this.__values.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}get postEffect(){return this.__values.postEffect}get render(){return this.__values.render}get camera(){return this.__values.camera}get renderQuality(){return this.__values.renderQuality}get screenshots(){return this.__values.screenshots}get shadows(){return this.__values.shadows}get hotspots(){return this.__values.hotspots}}class kW{constructor({nexusApiResultPayload:e,appWcRef:t}){this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.__materialLibraryCollection=new PW(this._appWcRef),this._data.product_data.settings&&(this._appWcRef.productSettings.deepCopyProductSettings(this._data.product_data.settings),this._appWcRef.eventsManager.productSettingUpdatedEvent.fire());const n=this._data.product_data.assets;if(Object.values(n).length===1){const i=Object.values(n)[0];i?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:i,contextOverride:"ASSET COLLECTION"}):(i.proxyGeo="http://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb",this.__needsRootPlug=!0,i.autoGenerateProxyEntity=!0)}}get materialLibraryCollection(){return this.__materialLibraryCollection}get settings(){return this._data.settings}get productSettings(){return this._data.product_data.settings}get channelName(){return this._data.settings.channel.name}get channelSettings(){return this._data.settings.channel.channel_settings}async __parseMaterialLibraries(){const e=this._data?.brand?.material_libraries;if(!e){this.__materialLibraryCollection.makeEmpty();return}this.__materialLibraryCollection.makeEmpty(e);for(const[t,n]of Object.entries(e))await this.__materialLibraryCollection.addMaterialLibrary(t,n.url)}async __parseAssets(){return this.__assetCollection=new RW(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Ao({name:"root@plug",isPrimary:!0,connectionId:"root",position:new Q,rotation:new $i})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new LW(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseMaterialLibraries(),await this.__parseAssets(),await this.__parseProductVariants()}}var bd=function(){var s=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),n(++s%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function n(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";s=h}var i=(performance||Date).now(),r=i,a=0,o=t(new bd.Panel("FPS","#0ff","#002")),l=t(new bd.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new bd.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:e,addPanel:t,showPanel:n,begin:function(){i=(performance||Date).now()},end:function(){a++;var h=(performance||Date).now();if(l.update(h-i,200),h>=r+1e3&&(o.update(a*1e3/(h-r),100),r=h,a=0,c)){var u=performance.memory;c.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){i=this.end()},domElement:e,setMode:n}};bd.Panel=function(s,e,t){var n=1/0,i=0,r=Math.round,a=r(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,h=2*a,u=3*a,d=15*a,A=74*a,p=30*a,g=document.createElement("canvas");g.width=o,g.height=l,g.style.cssText="width:80px;height:48px";var m=g.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,o,l),m.fillStyle=e,m.fillText(s,c,h),m.fillRect(u,d,A,p),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(u,d,A,p),{dom:g,update:function(f,y){n=Math.min(n,f),i=Math.max(i,f),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,o,d),m.fillStyle=e,m.fillText(r(f)+" "+s+" ("+r(n)+"-"+r(i)+")",c,h),m.drawImage(g,u+a,d,A-a,p,u,d,A-a,p),m.fillRect(u+A-a,d,a,p),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(u+A-a,d,a,r((1-f/y)*p))}}};class Fs extends wl{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new bd}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(Fs.webComponentName)||window.customElements.define(Fs.webComponentName,Fs)}static{this.styles=at`
17303
+ `}};Nl([Pt("#modelViewer")],Eo.prototype,"modelViewerElem");Nl([Pt("#arModal")],Eo.prototype,"arModalElem");Nl([Pt("#qrModal")],Eo.prototype,"qrModalElem");Nl([Y({attribute:!1})],Eo.prototype,"appWcRef");Nl([Y({type:String,attribute:"glb-src"})],Eo.prototype,"glbSrc");Nl([Y({type:String,attribute:"usdz-src"})],Eo.prototype,"usdzSrc");Nl([Y({type:Boolean,attribute:"debug"})],Eo.prototype,"debug");let TW=Eo;class At{constructor(e,t,n=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=n}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class MW extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new At(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new At(this,"experienceUpdated",""),this.productSettingUpdatedEvent=new At(this,"productSettingUpdatedEvent",""),this.productSettingsShadowTypeUpdatedEvent=new At(this,"productSettingsShadowTypeUpdatedEvent",""),this.productSettingsSavedEvent=new At(this,"productsettingssavedevent",""),this.appReadyEvent=new At(this,"appReady",""),this.appFailedEvent=new At(this,"appFailed",""),this.productClassChangedEvent=new At(this,"productClassChanged",""),this.productChangedEvent=new At(this,"productChanged",""),this.variantChangedEvent=new At(this,"variantChanged",""),this.structureNodeAddedEvent=new At(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new At(this,"structureNodeRemoved",""),this.structureChangedEvent=new At(this,"structureChanged",""),this.showNodeLoadingIcon=new At(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new At(this,"nodeLoadingHide",""),this.cameraFitEvent=new At(this,"cameraFit",""),this.hotspotsUpdatedEvent=new At(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new At(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new At(this,"hotspotClicked",""),this.hotspotOpenEvent=new At(this,"hotspotOpen",""),this.hotspotClosedEvent=new At(this,"hotspotClosed",""),this.hotspotNextEvent=new At(this,"hotspotNext",""),this.hotspotPreviousEvent=new At(this,"hotspotPrevious",""),this.sceneBoundsChanged=new At(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new At(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new At(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new At(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new At(this,"arGlbReady",""),this.cartChangedEvent=new At(this,"cartChanged",""),this.sceneRestartedEvent=new At(this,"sceneRestarted",""),this.pickerFoundPosition=new At(this,"pickerFoundPosition",""),this.frameUpdated=new At(this,"frameUpdated",""),this.cameraControlsStart=new At(this,"cameraControlsStart",""),this.inputStart=new At(this,"inputStart",""),this.inputMove=new At(this,"inputMove",""),this.inputEnd=new At(this,"inputEnd",""),this.cameraMoveToTransform=new At(this,"cameraMoveToTransform",""),this.debugChanged=new At(this,"debugChanged",""),this.showSettingsChanged=new At(this,"showSettingsChanged",""),this.webComponentResized=new At(this,"webcomponentresized")}}class RW{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new iR(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}hasAnyAssetWithSplat(){for(const e of Object.values(this.__config))if(e.renderSplat)return!0;return!1}}class DW{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class QW{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const n=new DW(t);this.__productParts.push(n)}}}class LW{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const n of e){const i=new QW(n,this.__productId);i&&this.addProductVariant(i)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case $o.SKU:return this.getProductVariantBySku(e);case $o.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case $o.ASIN:return this.getProductVariantByAsin(e);case $o.UPC:return this.getProductVariantByUpc(e);case $o.EXPERIENCE_ID:return;case $o.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class NW extends nR{constructor(e){super(e),this._materialVariantMappings={}}async _parseLoadedGltf(){await super._parseLoadedGltf();const e=this.resource?.scene;if(e===void 0||e.children.length<=0)return;const t=e.children[0],n=this.finishNamesFromAsset;for(const i of t.userData.gltfExtensions.KHR_materials_variants.mappings){const r=n[i.variants[0]];this._materialVariantMappings[r]=i.material}}async getMaterialForFinishId(e){return this._materialVariantMappings[e]===void 0?null:await this.resource?.parser.getDependency("material",this._materialVariantMappings[e])}}class PW{constructor(e){this.__appWcRef=e,this.__materialLibraries=new Map}get materialLibraries(){return this.__materialLibraries}makeEmpty(e={}){const t=Object.keys(e);for(const n of this.__materialLibraries.keys())t.includes(n)||this.__materialLibraries.delete(n)}async addMaterialLibrary(e,t){const n=new NW({id:e,uri:t,preload:!1,appWcRef:this.__appWcRef});return this.__materialLibraries.set(n.id,n),n}}class FW{constructor(){this.__defaultValues={postEffect:{ao:!1},render:{envMap:"https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr",mode:fa.GEO,splatMode:{blurAmount:1,preBlurAmount:1}},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,infinitePolarAngle:!1,minPolarAngle:0,maxPolarAngle:6.25,infiniteAzimuthAngle:!0,minAzimuthAngle:0,maxAzimuthAngle:6.25},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:md.ACCUMULATIVE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}},this.deepCopyProductSettings(this.__defaultValues)}asJson(){return this.__values}deepCopyProductSettings(e){this.__values=JSON.parse(JSON.stringify(this.__defaultValues)),e.render&&(e.render.envMap&&(this.__values.render.envMap=e.render.envMap),e.render.mode&&(this.__values.render.mode=e.render.mode),e.render.splatMode&&(e.render.splatMode.blurAmount&&(this.__values.render.splatMode.blurAmount=e.render.splatMode.blurAmount),e.render.splatMode.preBlurAmount&&(this.__values.render.splatMode.preBlurAmount=e.render.splatMode.preBlurAmount))),e.camera&&(e.camera.initial&&(this.__values.camera.initial=e.camera.initial),e.camera.backgroundColor&&(this.__values.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(this.__values.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(this.__values.camera.focalLength=e.camera.focalLength),e.camera.canPan!==void 0&&(this.__values.camera.canPan=e.camera.canPan),e.camera.canZoom!==void 0&&(this.__values.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(this.__values.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(this.__values.camera.maxDistance=e.camera.maxDistance),e.camera.infinitePolarAngle&&(this.__values.camera.infinitePolarAngle=e.camera.infinitePolarAngle),e.camera.minPolarAngle&&(this.__values.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(this.__values.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.infiniteAzimuthAngle&&(this.__values.camera.infiniteAzimuthAngle=e.camera.infiniteAzimuthAngle),e.camera.minAzimuthAngle&&(this.__values.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(this.__values.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(this.__values.postEffect=e.postEffect),e.renderQuality&&(this.__values.renderQuality=e.renderQuality),e.screenshots&&(this.__values.screenshots=e.screenshots),e.shadows?.shadowType&&(this.__values.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(this.__values.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(this.__values.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(this.__values.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(this.__values.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(this.__values.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(this.__values.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons!==void 0&&(this.__values.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}get postEffect(){return this.__values.postEffect}get render(){return this.__values.render}get camera(){return this.__values.camera}get renderQuality(){return this.__values.renderQuality}get screenshots(){return this.__values.screenshots}get shadows(){return this.__values.shadows}get hotspots(){return this.__values.hotspots}}class kW{constructor({nexusApiResultPayload:e,appWcRef:t}){this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.__materialLibraryCollection=new PW(this._appWcRef),this._data.product_data.settings&&(this._appWcRef.productSettings.deepCopyProductSettings(this._data.product_data.settings),this._appWcRef.eventsManager.productSettingUpdatedEvent.fire());const n=this._data.product_data.assets;if(Object.values(n).length===1){const i=Object.values(n)[0];i?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:i,contextOverride:"ASSET COLLECTION"}):(i.proxyGeo="https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb",this.__needsRootPlug=!0,i.autoGenerateProxyEntity=!0)}}get materialLibraryCollection(){return this.__materialLibraryCollection}get settings(){return this._data.settings}get productSettings(){return this._data.product_data.settings}get channelName(){return this._data.settings.channel.name}get channelSettings(){return this._data.settings.channel.channel_settings}async __parseMaterialLibraries(){const e=this._data?.brand?.material_libraries;if(!e){this.__materialLibraryCollection.makeEmpty();return}this.__materialLibraryCollection.makeEmpty(e);for(const[t,n]of Object.entries(e))await this.__materialLibraryCollection.addMaterialLibrary(t,n.url)}async __parseAssets(){return this.__assetCollection=new RW(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Ao({name:"root@plug",isPrimary:!0,connectionId:"root",position:new Q,rotation:new $i})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new LW(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseMaterialLibraries(),await this.__parseAssets(),await this.__parseProductVariants()}}var bd=function(){var s=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),n(++s%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function n(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";s=h}var i=(performance||Date).now(),r=i,a=0,o=t(new bd.Panel("FPS","#0ff","#002")),l=t(new bd.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new bd.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:e,addPanel:t,showPanel:n,begin:function(){i=(performance||Date).now()},end:function(){a++;var h=(performance||Date).now();if(l.update(h-i,200),h>=r+1e3&&(o.update(a*1e3/(h-r),100),r=h,a=0,c)){var u=performance.memory;c.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){i=this.end()},domElement:e,setMode:n}};bd.Panel=function(s,e,t){var n=1/0,i=0,r=Math.round,a=r(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,h=2*a,u=3*a,d=15*a,A=74*a,p=30*a,g=document.createElement("canvas");g.width=o,g.height=l,g.style.cssText="width:80px;height:48px";var m=g.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,o,l),m.fillStyle=e,m.fillText(s,c,h),m.fillRect(u,d,A,p),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(u,d,A,p),{dom:g,update:function(f,y){n=Math.min(n,f),i=Math.max(i,f),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,o,d),m.fillStyle=e,m.fillText(r(f)+" "+s+" ("+r(n)+"-"+r(i)+")",c,h),m.drawImage(g,u+a,d,A-a,p,u,d,A-a,p),m.fillRect(u+A-a,d,a,p),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(u+A-a,d,a,r((1-f/y)*p))}}};class Fs extends wl{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new bd}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(Fs.webComponentName)||window.customElements.define(Fs.webComponentName,Fs)}static{this.styles=at`
17304
17304
  .debug-label {
17305
17305
  position: absolute;
17306
17306
  top: 0%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "1.0.17-alpha.1",
3
+ "version": "1.0.17-alpha.2",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [