@epigraph/solutions 1.1.8 → 1.1.9

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.
@@ -17398,7 +17398,7 @@ void main() {
17398
17398
  .model-viewer.hide {
17399
17399
  visibility: hidden;
17400
17400
  }
17401
- `]}__registerModelViewerWebComponent(){window.customElements.get("model-viewer")||window.customElements.define("model-viewer",lJ)}static setupWebComponent(){window.customElements.get(Kf.webComponentName)||window.customElements.define(Kf.webComponentName,Kf)}get arLink(){return this.__arLink}showArModal(){this.arModalElem.showModal();const e=new sa(!0,sa.PANEL_TYPE.AR,sa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}showQr(){this.qrModalElem.showModal();const e=new sa(!0,sa.PANEL_TYPE.QR,sa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}async resolveSrcUrl(){if(this.glbSrc="",this.usdzSrc="",Wv){const e=await this.appWcRef.getGlbUrlForAr();if(e===null){window.epigraph.logger.error({title:"Error getting the GLB for AR session",contextOverride:this._loggerContext});return}this.glbSrc=e}else pb&&(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 WQ([]);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)}canLaunchAr(){return this.modelViewerElem.canActivateAR}async presentAr(){return this.modelViewerElem.activateAR()}isARSessionActive(){return this.modelViewerElem.getAttribute("ar-status")==="presenting"}getMinimumRequirementsString(){let e="";return vW&&(SD?e="iOS 16 and above":wD&&(e="Android 12 and above")),e}onArModalClose(){const e=new ra(!0,ra.PANEL_TYPE.AR,ra.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}__renderArModal(){return oe`<epg-modal-ar
17401
+ `]}__registerModelViewerWebComponent(){window.customElements.get("model-viewer")||window.customElements.define("model-viewer",lJ)}static setupWebComponent(){window.customElements.get(Kf.webComponentName)||window.customElements.define(Kf.webComponentName,Kf)}get arLink(){return this.__arLink}showArModal(){this.arModalElem.showModal();const e=new sa(!0,sa.PANEL_TYPE.AR,sa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}showQr(){this.qrModalElem.showModal();const e=new sa(!0,sa.PANEL_TYPE.QR,sa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}async resolveSrcUrl(){if(this.glbSrc="",this.usdzSrc="",Wv){const e=await this.appWcRef.getGlbUrlForAr();if(e===null){window.epigraph.logger.error({title:"Error getting the GLB for AR session",contextOverride:this._loggerContext});return}this.glbSrc=e}else pb&&(this.usdzSrc=await this.appWcRef.getUsdzUrlForAr(),this.glbSrc="https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb")}getViewInYourSpaceUrl(){return vt.generateShareableUrl({baseUrl:this.appWcRef.baseUrlOverride,identifier:this.appWcRef.identifier,identifierType:this.appWcRef.identifierType,arCompatible:!0})}async getViewInYourSpaceQR(){const e=this.getViewInYourSpaceUrl();return this.appWcRef.qrCodeGenerator.generateQrCode({text:e.href})}async launchAR(){if(this.canLaunchAr()){const e=new WQ([]);this.appWcRef.epigraphAnalytics.sendEvent(e),this.showArModal(),await this.resolveSrcUrl()}else{const e=await this.getViewInYourSpaceQR();this.qrModalElem.qrCodeImage=e,this.showQr()}return Promise.resolve(!0)}canLaunchAr(){return this.modelViewerElem.canActivateAR}async presentAr(){return this.modelViewerElem.activateAR()}isARSessionActive(){return this.modelViewerElem.getAttribute("ar-status")==="presenting"}getMinimumRequirementsString(){let e="";return vW&&(SD?e="iOS 16 and above":wD&&(e="Android 12 and above")),e}onArModalClose(){const e=new ra(!0,ra.PANEL_TYPE.AR,ra.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}__renderArModal(){return oe`<epg-modal-ar
17402
17402
  id="arModal"
17403
17403
  powered-by-epigraph
17404
17404
  @epgOnLaunchArClicked=${this.presentAr.bind(this)}
@@ -18179,7 +18179,7 @@ void main() {
18179
18179
  pointer-events: auto;
18180
18180
  }
18181
18181
  }
18182
- `]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get experienceData(){return this._experienceData}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}__showViewStateGrid(){this.renderEngine.scene.add(this.__viewStateGrid)}__hideViewStateGrid(){this.renderEngine.scene.remove(this.__viewStateGrid)}enterPickerState(){this.sessionState="picker",this.style.cursor="crosshair",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.__hideViewStateGrid(),this.cameraManager.enableRotationControls(),this.cameraManager.enableZoomControls(),this.cameraManager.enablePanControls(),this.cameraManager.disableCameraZoomLimits(),this.cameraManager.disableCameraRotationLimits(),this.requestUpdate()}enterViewState(){this.sessionState="view",this.style.cursor="grab",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hotspotsManager.style.opacity="0.25",this.__showViewStateGrid(),this.cameraManager.enableRotationControls(),this.cameraManager.enableZoomControls(),this.cameraManager.enablePanControls(),this.cameraManager.disableCameraZoomLimits(),this.cameraManager.disableCameraRotationLimits(),this.hotspotsManager.activeHotspot&&this.hotspotsManager.activeHotspot&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.hotspotsManager.activeHotspot.camera}),this.requestUpdate()}enterDefaultState(){const e=this.sessionState;this.sessionState="default",this.style.cursor="grab",this.hotspotsManager.style.opacity="1",this.__hideViewStateGrid(),e==="picker"&&this.cameraManager.updateCameraSettings(this.productSettings.camera),this.requestUpdate()}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().screenshot)}onLoadFailed(e,t){this._eventsManager.appFailedEvent.fire(t);const n=this.timeElapsedSinceLoadBegin,s=new ux(!0,n,e);this._epigraphAnalytics.sendEvent(s),this.splashScreenElem.loadingLabel="Experience Failed to load!!",this.splashScreenElem.loadingLogoSrc="https://asset.myepigraph.com/design-assets/icons/warning-triangle.svg",this.showSplashScreen(),window.epigraph.logger.error({title:"Experience Load Failed. Expand for details...",details:{error:e,failedEventDetails:t},contextOverride:this._loggerContext})}getFirstNonProxyFromIntersections(e){let t=null;for(const n of e)if(!(!n?.object||n.object.userData.isProxyMesh===!0)){t=n;break}return t}__getIntersectionsWithScene(e,t){return this.__pointer.x=e/this.canvasSize.width*2-1,this.__pointer.y=-(t/this.canvasSize.height)*2+1,this.__raycaster.setFromCamera(this.__pointer,this.cameraManager.getCameras().main),this.__raycaster.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.rootEntity.children,!0)}getPositionOnMeshFromPoint(e,t){const n=this.__getIntersectionsWithScene(e,t);if(n.length>0){const s=this.getFirstNonProxyFromIntersections(n);return s===null?null:s.point}else return null}getIntersectionOnProductFromPoint(e,t){const n=this.__getIntersectionsWithScene(e,t);let s=null;if(n.length>0){const r=this.getFirstNonProxyFromIntersections(n);if(!r?.object)return null;r.object.traverseAncestors(a=>{if(a instanceof Nl&&a.isRoot===!1){if(s!==null)return;s={asset:{id:a.asset.id,name:a.asset.name},intersection:{point:r.point,normals:r.normal??null}};return}})}return s}get aspectRatio(){return this.canvasSize.width/this.canvasSize.height}getSceneBounds(){return this.sceneManager.sceneBounds}getSceneBoundsCenter(){return this.sceneManager.sceneBoundsCenter}getSceneSphericalBounds(){return this.sceneManager?.currentSceneSphericalBounds}async getUsdzUrlForAr(){return this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl(),this.eventsManager.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl(),this.eventsManager.arModelReadyEvent.fire(this.__glbBlobUrl),this.__glbBlobUrl}async presentAr(){return this.viewInYourSpaceManager.presentAr()}async launchAR(){if(this.isLoading){this.addEventListener(this.eventsManager.appReadyEvent.name,()=>void this.viewInYourSpaceManager.launchAR());return}return await this.viewInYourSpaceManager.launchAR()}highlightEntityByAssetId(e){const t=this.sceneManager.sceneStructure.getEntityForAssetId(e);if(!t){window.epigraph.logger.error({title:`No asset found for ID: ${e}`,contextOverride:this._loggerContext});return}t.highlight()}unhighlightAllEntities(){for(const e of this.sceneManager.sceneStructure.getSceneEntities())e.unhighlight()}async spawnAssetInScene(e){const t=this.sceneManager.sceneStructure.getPossibleConnectionsForAssetInScene(e);if(t.length<=0)return Promise.resolve(void 0);const n=t[0];n.connect();const s=new Nl(e,this);await s.initialize();const r=n.receiver,a=n.plug.clone();this.sceneManager.sceneStructure.add(a);const o=new Q;r.getWorldPosition(o),a.position.set(o.x,o.y,o.z),a.attach(s);const l=new Yt;return r.getWorldQuaternion(l),a.setRotationFromQuaternion(l),r.attach(s),a.removeFromParent(),vt.dispose3(a),this.eventsManager.structureChangedEvent.fire(),Promise.resolve(s)}async selectFinishForAssetName(e,t){const n=this._sceneManager.sceneStructure.getEntityForAssetName(t);return!n||!n.allFinishIds.includes(e)?!1:(await n.selectAssetFinish(e).catch(r=>(window.epigraph.logger.error({title:`Failed to select Finish: ${e} in Asset: ${t}`,details:r,contextOverride:this._loggerContext}),new jd(!1)))).success}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),this.cameraManager.fitCameraToSceneBounds()}hideDimensions(e=!1){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),e||this.cameraManager.fitCameraToSceneBounds()}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsInDisplayUnit(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length,width:e.width,height:e.height,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots",contextOverride:this._loggerContext}),this.areHotspotsActive=!0,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots",contextOverride:this._loggerContext}),this.areHotspotsActive=!1,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n=!1}){this.hotspotsManager.openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}getInteractionPromptRepeat(){const e=this.productSettings.camera.interactionPromptRepeat.split(":");return[parseInt(e[0]),parseInt(e[1])]}shouldContinuePlayingInteractionPrompt(){return(this.getInteractionPromptRepeat()[1]===0||this.__interactionPlayCount<this.getInteractionPromptRepeat()[1])&&!this._isSceneInteractedWith}async __onPlayInteractionPrompt(e=2){if(!(e<=0)){this.__interactionPlayCount++,this.showCameraInteractionPromptIndicator(),await vt.wait(800),this.cameraInteractionPromptIndicatorElemRef.style.animationIterationCount=String(e);for(let t=0;t<e;t++)this.cameraInteractionPromptIndicatorElemRef.classList.add("play-wiggle-animation"),await this.cameraManager.wiggleCamera();this.cameraInteractionPromptIndicatorElemRef.classList.remove("play-wiggle-animation"),this.hideCameraInteractionPromptIndicator(),this.shouldContinuePlayingInteractionPrompt()&&setTimeout(()=>{this.__onPlayInteractionPrompt(this.getInteractionPromptRepeat()[0])},3e3)}}getSceneAnimations(){const e={},t=this.sceneManager.sceneStructure.getSceneEntities();for(const n of t)e[n.asset.id]=n.getAllAnimations();return e}playAnimationByNameAndAssetId({animationName:e,assetId:t,clampWhenFinished:n=!1,loop:s=!1,repetitions:r=1/0,reverse:a=!1}){if(!e)return;const l=this.getSceneAnimations()[t],c=l.get(e);if(!c){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:l.keys(),contextOverride:this._loggerContext});return}return a?(c.timeScale=-1,c.fadeOut(this._animationFadeDurationInMiliseconds*.001)):(c.timeScale=1,c.fadeIn(this._animationFadeDurationInMiliseconds*.001)),c.setLoop(s?Ql:Bh,r),c.clampWhenFinished=n,c.enabled=!0,c.play(),this._activeAnimations.set(e,c),{animationName:e,targetAnimationAction:c}}stopAnimationByNameAndAssetId(e,t){if(!e)return;const s=this.getSceneAnimations()[t],r=s.get(e);if(!r){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:s.keys(),contextOverride:this._loggerContext});return}r.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{r.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e);const t=this.sceneManager.sceneStructure.getSceneEntities();for(const n of t)n.getAnimationMixer()?.update(e);this.debugManager&&this.debugManager.stats.update(),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main),this.renderEngine.textRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new Ae,n=this.cameraManager.getCameras().main,s=this.canvasSize.width*.5,r=this.canvasSize.height*.5,o=e.clone().project(n);return t.x=(o.x+1)*s,t.y=-(o.y-1)*r,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?oe`
18182
+ `]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get experienceData(){return this._experienceData}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}__showViewStateGrid(){this.renderEngine.scene.add(this.__viewStateGrid)}__hideViewStateGrid(){this.renderEngine.scene.remove(this.__viewStateGrid)}enterPickerState(){this.sessionState="picker",this.style.cursor="crosshair",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.__hideViewStateGrid(),this.cameraManager.enableRotationControls(),this.cameraManager.enableZoomControls(),this.cameraManager.enablePanControls(),this.cameraManager.disableCameraZoomLimits(),this.cameraManager.disableCameraRotationLimits(),this.requestUpdate()}enterViewState(){this.sessionState="view",this.style.cursor="grab",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hotspotsManager.style.opacity="0.25",this.__showViewStateGrid(),this.cameraManager.enableRotationControls(),this.cameraManager.enableZoomControls(),this.cameraManager.enablePanControls(),this.cameraManager.disableCameraZoomLimits(),this.cameraManager.disableCameraRotationLimits(),this.hotspotsManager.activeHotspot&&this.hotspotsManager.activeHotspot&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.hotspotsManager.activeHotspot.camera}),this.requestUpdate()}enterDefaultState(){const e=this.sessionState;this.sessionState="default",this.style.cursor="grab",this.hotspotsManager.style.opacity="1",this.__hideViewStateGrid(),e==="picker"&&this.cameraManager.updateCameraSettings(this.productSettings.camera),this.requestUpdate()}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().screenshot)}onLoadFailed(e,t){this._eventsManager.appFailedEvent.fire(t);const n=this.timeElapsedSinceLoadBegin,s=new ux(!0,n,e);this._epigraphAnalytics.sendEvent(s),this.splashScreenElem.loadingLabel="Experience Failed to load!!",this.splashScreenElem.loadingLogoSrc="https://asset.myepigraph.com/design-assets/icons/warning-triangle.svg",this.showSplashScreen(),window.epigraph.logger.error({title:"Experience Load Failed. Expand for details...",details:{error:e,failedEventDetails:t},contextOverride:this._loggerContext})}getFirstNonProxyFromIntersections(e){let t=null;for(const n of e)if(!(!n?.object||n.object.userData.isProxyMesh===!0)){t=n;break}return t}__getIntersectionsWithScene(e,t){return this.__pointer.x=e/this.canvasSize.width*2-1,this.__pointer.y=-(t/this.canvasSize.height)*2+1,this.__raycaster.setFromCamera(this.__pointer,this.cameraManager.getCameras().main),this.__raycaster.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.rootEntity.children,!0)}getPositionOnMeshFromPoint(e,t){const n=this.__getIntersectionsWithScene(e,t);if(n.length>0){const s=this.getFirstNonProxyFromIntersections(n);return s===null?null:s.point}else return null}getIntersectionOnProductFromPoint(e,t){const n=this.__getIntersectionsWithScene(e,t);let s=null;if(n.length>0){const r=this.getFirstNonProxyFromIntersections(n);if(!r?.object)return null;r.object.traverseAncestors(a=>{if(a instanceof Nl&&a.isRoot===!1){if(s!==null)return;s={asset:{id:a.asset.id,name:a.asset.name},intersection:{point:r.point,normals:r.normal??null}};return}})}return s}get aspectRatio(){return this.canvasSize.width/this.canvasSize.height}getSceneBounds(){return this.sceneManager.sceneBounds}getSceneBoundsCenter(){return this.sceneManager.sceneBoundsCenter}getSceneSphericalBounds(){return this.sceneManager?.currentSceneSphericalBounds}async getUsdzUrlForAr(){return this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl(),this.eventsManager.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl(),this.eventsManager.arModelReadyEvent.fire(this.__glbBlobUrl),this.__glbBlobUrl}async presentAr(){return this.viewInYourSpaceManager.presentAr()}getViewInYourSpaceUrl(){return this.viewInYourSpaceManager.getViewInYourSpaceUrl()}async getViewInYourSpaceQR(){return this.viewInYourSpaceManager.getViewInYourSpaceQR()}async launchAR(){if(this.isLoading){this.addEventListener(this.eventsManager.appReadyEvent.name,()=>void this.viewInYourSpaceManager.launchAR());return}return await this.viewInYourSpaceManager.launchAR()}highlightEntityByAssetId(e){const t=this.sceneManager.sceneStructure.getEntityForAssetId(e);if(!t){window.epigraph.logger.error({title:`No asset found for ID: ${e}`,contextOverride:this._loggerContext});return}t.highlight()}unhighlightAllEntities(){for(const e of this.sceneManager.sceneStructure.getSceneEntities())e.unhighlight()}async spawnAssetInScene(e){const t=this.sceneManager.sceneStructure.getPossibleConnectionsForAssetInScene(e);if(t.length<=0)return Promise.resolve(void 0);const n=t[0];n.connect();const s=new Nl(e,this);await s.initialize();const r=n.receiver,a=n.plug.clone();this.sceneManager.sceneStructure.add(a);const o=new Q;r.getWorldPosition(o),a.position.set(o.x,o.y,o.z),a.attach(s);const l=new Yt;return r.getWorldQuaternion(l),a.setRotationFromQuaternion(l),r.attach(s),a.removeFromParent(),vt.dispose3(a),this.eventsManager.structureChangedEvent.fire(),Promise.resolve(s)}async selectFinishForAssetName(e,t){const n=this._sceneManager.sceneStructure.getEntityForAssetName(t);return!n||!n.allFinishIds.includes(e)?!1:(await n.selectAssetFinish(e).catch(r=>(window.epigraph.logger.error({title:`Failed to select Finish: ${e} in Asset: ${t}`,details:r,contextOverride:this._loggerContext}),new jd(!1)))).success}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),this.cameraManager.fitCameraToSceneBounds()}hideDimensions(e=!1){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),e||this.cameraManager.fitCameraToSceneBounds()}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsInDisplayUnit(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length,width:e.width,height:e.height,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots",contextOverride:this._loggerContext}),this.areHotspotsActive=!0,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots",contextOverride:this._loggerContext}),this.areHotspotsActive=!1,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n=!1}){this.hotspotsManager.openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}getInteractionPromptRepeat(){const e=this.productSettings.camera.interactionPromptRepeat.split(":");return[parseInt(e[0]),parseInt(e[1])]}shouldContinuePlayingInteractionPrompt(){return(this.getInteractionPromptRepeat()[1]===0||this.__interactionPlayCount<this.getInteractionPromptRepeat()[1])&&!this._isSceneInteractedWith}async __onPlayInteractionPrompt(e=2){if(!(e<=0)){this.__interactionPlayCount++,this.showCameraInteractionPromptIndicator(),await vt.wait(800),this.cameraInteractionPromptIndicatorElemRef.style.animationIterationCount=String(e);for(let t=0;t<e;t++)this.cameraInteractionPromptIndicatorElemRef.classList.add("play-wiggle-animation"),await this.cameraManager.wiggleCamera();this.cameraInteractionPromptIndicatorElemRef.classList.remove("play-wiggle-animation"),this.hideCameraInteractionPromptIndicator(),this.shouldContinuePlayingInteractionPrompt()&&setTimeout(()=>{this.__onPlayInteractionPrompt(this.getInteractionPromptRepeat()[0])},3e3)}}getSceneAnimations(){const e={},t=this.sceneManager.sceneStructure.getSceneEntities();for(const n of t)e[n.asset.id]=n.getAllAnimations();return e}playAnimationByNameAndAssetId({animationName:e,assetId:t,clampWhenFinished:n=!1,loop:s=!1,repetitions:r=1/0,reverse:a=!1}){if(!e)return;const l=this.getSceneAnimations()[t],c=l.get(e);if(!c){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:l.keys(),contextOverride:this._loggerContext});return}return a?(c.timeScale=-1,c.fadeOut(this._animationFadeDurationInMiliseconds*.001)):(c.timeScale=1,c.fadeIn(this._animationFadeDurationInMiliseconds*.001)),c.setLoop(s?Ql:Bh,r),c.clampWhenFinished=n,c.enabled=!0,c.play(),this._activeAnimations.set(e,c),{animationName:e,targetAnimationAction:c}}stopAnimationByNameAndAssetId(e,t){if(!e)return;const s=this.getSceneAnimations()[t],r=s.get(e);if(!r){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:s.keys(),contextOverride:this._loggerContext});return}r.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{r.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e);const t=this.sceneManager.sceneStructure.getSceneEntities();for(const n of t)n.getAnimationMixer()?.update(e);this.debugManager&&this.debugManager.stats.update(),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main),this.renderEngine.textRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new Ae,n=this.cameraManager.getCameras().main,s=this.canvasSize.width*.5,r=this.canvasSize.height*.5,o=e.clone().project(n);return t.x=(o.x+1)*s,t.y=-(o.y-1)*r,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?oe`
18183
18183
  <div id="appCanvasContainer" class="app-canvas-container">
18184
18184
  <span id="cameraAimIndicator" class="camera-aim-indicator hide"></span>
18185
18185
  </div>
@@ -18392,7 +18392,7 @@ void main() {
18392
18392
  </slot>
18393
18393
 
18394
18394
  ${this._renderTransitionScreen()}
18395
- `}};At([Y({type:String,attribute:Ht.sku.name})],ut.prototype,"sku");At([Y({type:String,attribute:Ht.shopifyVariantId.name})],ut.prototype,"shopify_variant_id");At([Y({type:String,attribute:Ht.upc.name})],ut.prototype,"upc");At([Y({type:String,attribute:Ht.asin.name})],ut.prototype,"asin");At([Y({type:String,attribute:Ht.productVariantUuid.name})],ut.prototype,"product_variant_uuid");At([Y({type:String,attribute:Ht.customVersionId.name})],ut.prototype,"customVersionId");At([Y({type:String,attribute:Ht.gaMeasurementId.name})],ut.prototype,"gaMeasurementId");At([Y({type:Boolean,attribute:Ht.modalView.name,reflect:!0})],ut.prototype,"modalView");At([Y({type:Boolean,attribute:Ht.hide.name,reflect:!0})],ut.prototype,"hide");At([Y({type:Boolean,attribute:!1})],ut.prototype,"isLoading");At([Y({type:String,attribute:Ht.apiMode.name})],ut.prototype,"apiMode");At([Y({type:Boolean,attribute:Ht.debug.name,reflect:!0})],ut.prototype,"debug");At([Y({type:Boolean,attribute:Ht.showSettings.name,reflect:!0})],ut.prototype,"showSettings");At([Y({type:String,attribute:Ht.dimensionsUnit.name})],ut.prototype,"dimensionsUnit");At([Y({type:String,attribute:Ht.dimensionsUnitSymbol.name})],ut.prototype,"dimensionsUnitSymbol");At([Y({type:Boolean,attribute:!1})],ut.prototype,"areDimensionsActive");At([Y({type:Boolean,attribute:!1})],ut.prototype,"areHotspotsActive");At([Y({type:String,attribute:Ht.variantSwitchMode.name})],ut.prototype,"variantSwitchMode");At([Y({type:Boolean,attribute:!1})],ut.prototype,"isHelpVisible");At([Y({type:String,attribute:Ht.baseUrlOverride.name})],ut.prototype,"baseUrlOverride");At([Y({attribute:Ht.cameraBoundsMultiplier.name,type:Number})],ut.prototype,"cameraBoundsMultiplier");At([Y({attribute:!1})],ut.prototype,"isPortraitOrientation");At([Y({attribute:!1})],ut.prototype,"didARAutoLaunch");At([Y({type:Boolean,attribute:Ht.transparentBackground.name})],ut.prototype,"transparentBackground");At([Y({type:String,attribute:Ht.splashScreenLogo.name})],ut.prototype,"splashScreenLogo");At([Y({type:String,attribute:Ht.splashScreenText.name})],ut.prototype,"splashScreenText");At([Y({type:Boolean,attribute:"hide-ui",reflect:!0})],ut.prototype,"hideUi");At([Y({attribute:!1})],ut.prototype,"playInteractionPrompt");At([Y({attribute:!1})],ut.prototype,"featuresToEnable");At([Ot("#appUiContainer")],ut.prototype,"appUiContainerElemRef");At([Ot("#appCanvasContainer")],ut.prototype,"appCanvasContainerElemRef");At([Ot("#cameraInteractionPromptIndicator")],ut.prototype,"cameraInteractionPromptIndicatorElemRef");At([Ot("#cameraAimIndicator")],ut.prototype,"cameraAimElemRef");At([Ot("#qrCodeGenerator")],ut.prototype,"qrCodeGenerator");At([Ot("#splashScreen")],ut.prototype,"splashScreenElem");At([Ot("#transitionScreen")],ut.prototype,"transitionScreenElem");At([Ot("#toolset")],ut.prototype,"toolsetElem");At([Ot("#customViewInYourSpaceButtonSlotElem")],ut.prototype,"customViewInYourSpaceButtonSlotElem");At([Ot("#viewInYourSpaceManager")],ut.prototype,"viewInYourSpaceManager");At([Ot("#dimensionsManager")],ut.prototype,"dimensionsManager");At([Ot("#helpOverlay")],ut.prototype,"helpOverlayElem");At([Ot("#hotspotsManager")],ut.prototype,"hotspotsManager");At([Ot("#debugManager")],ut.prototype,"debugManager");At([zn()],ut.prototype,"_hasActiveHotspot");At([zn()],ut.prototype,"_isToolsetLargerThanTheLeftBottomQuadrant");At([zn()],ut.prototype,"_loadingProgress");let Jv=ut;const lQ={label:{name:"label",defaultValue:"View In Your Space"}},TJ={...Vf};class cQ{constructor(e){this._appWcRef=e}async launchAR(){return await this._appWcRef.launchAR()}async viewInYourSpace(){return await this.launchAR()}async presentAr(){return this._appWcRef.presentAr()}async getViewInYourSpaceUrl(){return""}async getViewInYourSpaceQR(){return""}canLaunchAR(){return this._appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this._appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this._appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}async selectFinishForAsset(e,t){return this._appWcRef.selectFinishForAssetName(e,t)}}var MJ=Object.defineProperty,RJ=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=a(e,t,s)||s);return s&&MJ(e,t,s),s};const hQ=class Kc extends Jv{constructor(){super(),this.featuresToEnable={viewer:!0,hotspots:!1,dimensions:!1,viewInYourSpace:!0,help:!1,sceneManager:!1,debugManager:!1},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=button",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=button"},this.label=lQ.label.defaultValue.toString(),this._loggerContext="EPIGRAPH BUTTON",window.epigraph.logger.info({title:`Initializing ${Kc.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new cQ(this)}static{this.webComponentName="epigraph-button"}static setupWebComponent(){window.customElements.get(Kc.webComponentName)||window.customElements.define(Kc.webComponentName,Kc)}static{this.styles=[super.styles,pt`
18395
+ `}};At([Y({type:String,attribute:Ht.sku.name})],ut.prototype,"sku");At([Y({type:String,attribute:Ht.shopifyVariantId.name})],ut.prototype,"shopify_variant_id");At([Y({type:String,attribute:Ht.upc.name})],ut.prototype,"upc");At([Y({type:String,attribute:Ht.asin.name})],ut.prototype,"asin");At([Y({type:String,attribute:Ht.productVariantUuid.name})],ut.prototype,"product_variant_uuid");At([Y({type:String,attribute:Ht.customVersionId.name})],ut.prototype,"customVersionId");At([Y({type:String,attribute:Ht.gaMeasurementId.name})],ut.prototype,"gaMeasurementId");At([Y({type:Boolean,attribute:Ht.modalView.name,reflect:!0})],ut.prototype,"modalView");At([Y({type:Boolean,attribute:Ht.hide.name,reflect:!0})],ut.prototype,"hide");At([Y({type:Boolean,attribute:!1})],ut.prototype,"isLoading");At([Y({type:String,attribute:Ht.apiMode.name})],ut.prototype,"apiMode");At([Y({type:Boolean,attribute:Ht.debug.name,reflect:!0})],ut.prototype,"debug");At([Y({type:Boolean,attribute:Ht.showSettings.name,reflect:!0})],ut.prototype,"showSettings");At([Y({type:String,attribute:Ht.dimensionsUnit.name})],ut.prototype,"dimensionsUnit");At([Y({type:String,attribute:Ht.dimensionsUnitSymbol.name})],ut.prototype,"dimensionsUnitSymbol");At([Y({type:Boolean,attribute:!1})],ut.prototype,"areDimensionsActive");At([Y({type:Boolean,attribute:!1})],ut.prototype,"areHotspotsActive");At([Y({type:String,attribute:Ht.variantSwitchMode.name})],ut.prototype,"variantSwitchMode");At([Y({type:Boolean,attribute:!1})],ut.prototype,"isHelpVisible");At([Y({type:String,attribute:Ht.baseUrlOverride.name})],ut.prototype,"baseUrlOverride");At([Y({attribute:Ht.cameraBoundsMultiplier.name,type:Number})],ut.prototype,"cameraBoundsMultiplier");At([Y({attribute:!1})],ut.prototype,"isPortraitOrientation");At([Y({attribute:!1})],ut.prototype,"didARAutoLaunch");At([Y({type:Boolean,attribute:Ht.transparentBackground.name})],ut.prototype,"transparentBackground");At([Y({type:String,attribute:Ht.splashScreenLogo.name})],ut.prototype,"splashScreenLogo");At([Y({type:String,attribute:Ht.splashScreenText.name})],ut.prototype,"splashScreenText");At([Y({type:Boolean,attribute:"hide-ui",reflect:!0})],ut.prototype,"hideUi");At([Y({attribute:!1})],ut.prototype,"playInteractionPrompt");At([Y({attribute:!1})],ut.prototype,"featuresToEnable");At([Ot("#appUiContainer")],ut.prototype,"appUiContainerElemRef");At([Ot("#appCanvasContainer")],ut.prototype,"appCanvasContainerElemRef");At([Ot("#cameraInteractionPromptIndicator")],ut.prototype,"cameraInteractionPromptIndicatorElemRef");At([Ot("#cameraAimIndicator")],ut.prototype,"cameraAimElemRef");At([Ot("#qrCodeGenerator")],ut.prototype,"qrCodeGenerator");At([Ot("#splashScreen")],ut.prototype,"splashScreenElem");At([Ot("#transitionScreen")],ut.prototype,"transitionScreenElem");At([Ot("#toolset")],ut.prototype,"toolsetElem");At([Ot("#customViewInYourSpaceButtonSlotElem")],ut.prototype,"customViewInYourSpaceButtonSlotElem");At([Ot("#viewInYourSpaceManager")],ut.prototype,"viewInYourSpaceManager");At([Ot("#dimensionsManager")],ut.prototype,"dimensionsManager");At([Ot("#helpOverlay")],ut.prototype,"helpOverlayElem");At([Ot("#hotspotsManager")],ut.prototype,"hotspotsManager");At([Ot("#debugManager")],ut.prototype,"debugManager");At([zn()],ut.prototype,"_hasActiveHotspot");At([zn()],ut.prototype,"_isToolsetLargerThanTheLeftBottomQuadrant");At([zn()],ut.prototype,"_loadingProgress");let Jv=ut;const lQ={label:{name:"label",defaultValue:"View In Your Space"}},TJ={...Vf};class cQ{constructor(e){this._appWcRef=e}async launchAR(){return await this._appWcRef.launchAR()}async viewInYourSpace(){return await this.launchAR()}async presentAr(){return this._appWcRef.presentAr()}async getViewInYourSpaceUrl(){return this._appWcRef.getViewInYourSpaceUrl()}async getViewInYourSpaceUrlString(){return this._appWcRef.getViewInYourSpaceUrl().href}async getViewInYourSpaceQR(){return this._appWcRef.getViewInYourSpaceQR()}canLaunchAR(){return this._appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this._appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this._appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}async selectFinishForAsset(e,t){return this._appWcRef.selectFinishForAssetName(e,t)}}var MJ=Object.defineProperty,RJ=(i,e,t,n)=>{for(var s=void 0,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=a(e,t,s)||s);return s&&MJ(e,t,s),s};const hQ=class Kc extends Jv{constructor(){super(),this.featuresToEnable={viewer:!0,hotspots:!1,dimensions:!1,viewInYourSpace:!0,help:!1,sceneManager:!1,debugManager:!1},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=button",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=button"},this.label=lQ.label.defaultValue.toString(),this._loggerContext="EPIGRAPH BUTTON",window.epigraph.logger.info({title:`Initializing ${Kc.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new cQ(this)}static{this.webComponentName="epigraph-button"}static setupWebComponent(){window.customElements.get(Kc.webComponentName)||window.customElements.define(Kc.webComponentName,Kc)}static{this.styles=[super.styles,pt`
18396
18396
  :host {
18397
18397
  --ar-button-display: none;
18398
18398
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [