import{r,j as L}from"./index.0b22cc41.js";import{u as b}from"./801a2dc8.js";import"./2dce7371.js";function C(u){var a,t,i,s,d,l,c,m;const[o,p]=r.exports.useState(void 0),v=r.exports.useCallback(E=>{p(E)},[]),{data:n,id:f=n.id,children:g,className:h,...e}=u,y=b("https://unpkg.com/@google/model-viewer@v1.8.0/dist/model-viewer.min.js",{module:!0});if(r.exports.useEffect(()=>{if(o!=null)return e.onError&&o.addEventListener("error",e.onError),e.onLoad&&o.addEventListener("load",e.onLoad),e.onPreload&&o.addEventListener("preload",e.onPreload),e.onModelVisibility&&o.addEventListener("model-visibility",e.onModelVisibility),e.onProgress&&o.addEventListener("progress",e.onProgress),e.onArStatus&&o.addEventListener("ar-status",e.onArStatus),e.onArTracking&&o.addEventListener("ar-tracking",e.onArTracking),e.onQuickLookButtonTapped&&o.addEventListener("quick-look-button-tapped",e.onQuickLookButtonTapped),e.onCameraChange&&o.addEventListener("camera-change",e.onCameraChange),e.onEnvironmentChange&&o.addEventListener("environment-change",e.onEnvironmentChange),e.onPlay&&o.addEventListener("play",e.onPlay),e.onPause&&o.addEventListener("ar-status",e.onPause),e.onSceneGraphReady&&o.addEventListener("scene-graph-ready",e.onSceneGraphReady),()=>{o!=null&&(e.onError&&o.removeEventListener("error",e.onError),e.onLoad&&o.removeEventListener("load",e.onLoad),e.onPreload&&o.removeEventListener("preload",e.onPreload),e.onModelVisibility&&o.removeEventListener("model-visibility",e.onModelVisibility),e.onProgress&&o.removeEventListener("progress",e.onProgress),e.onArStatus&&o.removeEventListener("ar-status",e.onArStatus),e.onArTracking&&o.removeEventListener("ar-tracking",e.onArTracking),e.onQuickLookButtonTapped&&o.removeEventListener("quick-look-button-tapped",e.onQuickLookButtonTapped),e.onCameraChange&&o.removeEventListener("camera-change",e.onCameraChange),e.onEnvironmentChange&&o.removeEventListener("environment-change",e.onEnvironmentChange),e.onPlay&&o.removeEventListener("play",e.onPlay),e.onPause&&o.removeEventListener("ar-status",e.onPause),e.onSceneGraphReady&&o.removeEventListener("scene-graph-ready",e.onSceneGraphReady))}},[o,e.onArStatus,e.onArTracking,e.onCameraChange,e.onEnvironmentChange,e.onError,e.onLoad,e.onModelVisibility,e.onPause,e.onPlay,e.onPreload,e.onProgress,e.onQuickLookButtonTapped,e.onSceneGraphReady]),y!=="done")return null;if(!((t=(a=n.sources)==null?void 0:a[0])!=null&&t.url))throw new Error("<ModelViewer/> requires 'data.sources' prop to be an array, with an object that has a property 'url' on it");return n.alt||console.warn("<ModelViewer/> requires the 'data.alt' prop for accessibility"),L("model-viewer",{ref:v,...e,class:h,id:f,src:n.sources[0].url,alt:n.alt,"camera-controls":(i=e.cameraControls)!=null?i:!0,poster:e.poster||((s=n.previewImage)==null?void 0:s.url),autoplay:(d=e.autoplay)!=null?d:!0,loading:e.loading,reveal:e.reveal,ar:e.ar,"ar-modes":e.arModes,"ar-scale":e.arScale,"ar-placement":e.arPlacement,"ios-src":e.iosSrc,"touch-action":e.touchAction,"disable-zoom":e.disableZoom,"orbit-sensitivity":e.orbitSensitivity,"auto-rotate":e.autoRotate,"auto-rotate-delay":e.autoRotateDelay,"rotation-per-second":e.rotationPerSecond,"interaction-policy":e.interactionPolicy,"interaction-prompt":e.interactionPrompt,"interaction-prompt-style":e.interactionPromptStyle,"interaction-prompt-threshold":e.interactionPromptThreshold,"camera-orbit":e.cameraOrbit,"camera-target":e.cameraTarget,"field-of-view":e.fieldOfView,"max-camera-orbit":e.maxCameraOrbit,"min-camera-orbit":e.minCameraOrbit,"max-field-of-view":e.maxFieldOfView,"min-field-of-view":e.minFieldOfView,bounds:e.bounds,"interpolation-decay":(l=e.interpolationDecay)!=null?l:100,"skybox-image":e.skyboxImage,"environment-image":e.environmentImage,exposure:e.exposure,"shadow-intensity":(c=e.shadowIntensity)!=null?c:0,"shadow-softness":(m=e.shadowSoftness)!=null?m:0,"animation-name":e.animationName,"animation-crossfade-duration":e.animationCrossfadeDuration,"variant-name":e.variantName,orientation:e.orientation,scale:e.scale,children:g})}export{C as ModelViewer}; //# sourceMappingURL=ddd0cfb5.js.map