@liveroom-tech/react-immersive 6.1.2 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{SequencesTab-JTIVIZJD.mjs → SequencesTab-ODR5IGDX.mjs} +1 -1
  2. package/dist/binding-builder.css +1 -1
  3. package/dist/binding-builder.d.mts +3 -3
  4. package/dist/binding-builder.d.ts +3 -3
  5. package/dist/binding-builder.js +75 -34
  6. package/dist/binding-builder.mjs +1 -1
  7. package/dist/chunk-2CUPPOBW.mjs +3 -0
  8. package/dist/chunk-3MIILDHB.mjs +83 -0
  9. package/dist/chunk-3XZKDTB2.mjs +1 -0
  10. package/dist/chunk-7MN2TMY6.mjs +47 -0
  11. package/dist/{chunk-W7M2YD65.mjs → chunk-EWNN4BBR.mjs} +1 -1
  12. package/dist/{chunk-5XII5XCD.mjs → chunk-GXY3VML4.mjs} +1 -1
  13. package/dist/chunk-IOLT2VXU.mjs +1 -0
  14. package/dist/chunk-X4WRTDO6.mjs +50 -0
  15. package/dist/hosted.css +1 -1
  16. package/dist/hosted.d.mts +4 -4
  17. package/dist/hosted.d.ts +4 -4
  18. package/dist/hosted.js +73 -32
  19. package/dist/hosted.mjs +1 -1
  20. package/dist/index.css +1 -1
  21. package/dist/index.d.mts +4 -4
  22. package/dist/index.d.ts +4 -4
  23. package/dist/index.js +72 -31
  24. package/dist/index.mjs +1 -1
  25. package/dist/{modelFileResolver-pPzMl63D.d.mts → modelFileResolver-ChKYsF21.d.mts} +33 -1
  26. package/dist/{modelFileResolver-pPzMl63D.d.ts → modelFileResolver-ChKYsF21.d.ts} +33 -1
  27. package/dist/{modelViewerProps-07WgBVqm.d.ts → modelViewerProps-Ch6pIZIE.d.ts} +30 -31
  28. package/dist/{modelViewerProps-CGgtm4Zb.d.mts → modelViewerProps-HazR2IE_.d.mts} +30 -31
  29. package/dist/{publicProps-BylAVwPu.d.mts → publicProps-Cmh9JtzJ.d.ts} +2 -1
  30. package/dist/{publicProps-CEt3hxQU.d.ts → publicProps-TMARX628.d.mts} +2 -1
  31. package/dist/simple-model-viewer.css +1 -1
  32. package/dist/simple-model-viewer.d.mts +15 -2
  33. package/dist/simple-model-viewer.d.ts +15 -2
  34. package/dist/simple-model-viewer.js +5 -5
  35. package/dist/simple-model-viewer.mjs +1 -1
  36. package/dist/utils.d.mts +4 -4
  37. package/dist/utils.d.ts +4 -4
  38. package/dist/utils.js +50 -9
  39. package/dist/utils.mjs +1 -1
  40. package/package.json +7 -4
  41. package/dist/chunk-35UERL2D.mjs +0 -83
  42. package/dist/chunk-DS5XNP7A.mjs +0 -47
  43. package/dist/chunk-M4LVNNVP.mjs +0 -1
  44. package/dist/chunk-Q4QPI5GG.mjs +0 -9
  45. package/dist/chunk-WJIICFV4.mjs +0 -3
  46. package/dist/chunk-XBVAZFXW.mjs +0 -1
@@ -1 +1 @@
1
- "use client";import{a as Rr}from"./chunk-MMO7KCYU.mjs";import{A as fr,C as gr,G as br,I as hr,M as xr,N as wr,Q as yr,R as _r,S as kr,T as Sr,h as nr,k as tr,l as ar,m as or,n as Re,o as ir,p as sr,t as lr,u as dr,v as cr,w as pr,x as ur,y as mr,z as vr}from"./chunk-DS5XNP7A.mjs";import{a as rr,b as me}from"./chunk-5XII5XCD.mjs";import{a as Mr}from"./chunk-37YITTIK.mjs";import"./chunk-6Q6YZ7O5.mjs";import{a as mn}from"./chunk-M4LVNNVP.mjs";import"./chunk-BNKTI3CY.mjs";import"./chunk-JR557W27.mjs";import{useRef as N,useState as g,useCallback as y,useEffect as _,useMemo as H,Component as vn,Suspense as Ce}from"react";import{CameraControls as fn,Environment as gn}from"@react-three/drei";import{useFrame as Tr,useThree as G}from"@react-three/fiber";import{Canvas as bn}from"@react-three/fiber";import{ACESFilmicToneMapping as hn,AgXToneMapping as xn,Box3 as ze,Color as wn,MeshStandardMaterial as yn,NeutralToneMapping as _n,NoToneMapping as kn,PerspectiveCamera as Dr,Vector3 as Y}from"three";import{SkeletonUtils as Mn}from"three-stdlib";import{X as Pe,Check as Vr,Settings as Sn,ChevronDown as Rn,Boxes as Cn,RotateCcw as Nn,Trash2 as Ln,Upload as Ne,AlertTriangle as En}from"lucide-react";import{Fragment as Pr,jsx as e,jsxs as d}from"react/jsx-runtime";var Cr={color:"#93c5fd",intensity:.05},Nr=["apartment","city","dawn","forest","lobby","night","park","studio","sunset","warehouse"],Or={aces:hn,agx:xn,neutral:_n,none:kn};function Te(r){return!!(r&&"isMesh"in r&&r.isMesh)}function Lr(r,i){Array.isArray(r)?r.forEach(i):i(r)}function zn(r,i){if(!i)return;let a=i.camera;if(!(a instanceof Dr))return;let l=new ze().setFromObject(r).getSize(new Y).length();!Number.isFinite(l)||l<=0||(a.near=l/100,a.far=l*100,a.updateProjectionMatrix(),i.maxDistance=l*10)}var Ee=class extends vn{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){this.props.onLoadError?.(a)}render(){return this.state.hasError?null:this.props.children}};function Pn({url:r,format:i,dracoDecoderPath:a,ktx2TranscoderPath:l,meshopt:s,hiddenKeys:c,selectedKey:o,panelHoveredKey:n,nodeRefsOut:u,onMeshesReady:x,onModelLoaded:U,onLoadProgress:k,onMeshClick:T,highlightOnHover:L}){let{scene:h}=xr(r,{dracoDecoderPath:a,ktx2TranscoderPath:l,meshopt:s},i,k),B=G(p=>p.invalidate),{setCanvasCursor:D,restoreCanvasCursor:V}=_r(),[z,j]=g(null),M=H(()=>Mn.clone(h),[h]),E=H(()=>{let p={};return M.traverse(m=>{if(!Te(m))return;let w=m.name||m.uuid;p[w]={key:w,label:m.name||m.type,ref:m}}),p},[M]),A=H(()=>{let p={};for(let[m,{ref:w}]of Object.entries(E)){let K=(Array.isArray(w.material)?w.material:[w.material]).map(b=>{let S=(wr(b)??new yn).clone();return S.userData.baseColor=S.color.clone(),S.userData.baseMap=S.map,S.userData.baseEmissive=S.emissive.clone(),S.userData.baseEmissiveMap=S.emissiveMap,S.userData.baseEmissiveIntensity=S.emissiveIntensity,S});p[m]=Array.isArray(w.material)?K:K[0]}return p},[E]);_(()=>()=>{Object.values(A).forEach(p=>Lr(p,m=>m.dispose()))},[A]);let J=N(null);_(()=>{J.current!==r&&(J.current=r,M.updateWorldMatrix(!0,!0),yr(M),x(E),U(M))},[r,M,E,x,U]),_(()=>{let p=new AbortController;return ir(M,p.signal),()=>{p.abort(),sr(M)}},[M]);let oe=H(()=>!or(M),[M]);_(()=>{for(let[p,{ref:m}]of Object.entries(E))u.current[p]=m},[E,u]),_(()=>{!L&&z!==null&&(j(null),V())},[L,z,V]),_(()=>{for(let[p,{ref:m}]of Object.entries(E)){m.visible=!c.has(p);let w=A[p];if(!w)continue;m.material=w;let Z=L&&z===p,K=L&&n===p;Lr(w,b=>{if(b.color.copy(b.userData.baseColor),b.map=b.userData.baseMap??null,b.emissive.copy(b.userData.baseEmissive),b.emissiveMap=b.userData.baseEmissiveMap??null,b.emissiveIntensity=b.userData.baseEmissiveIntensity,K||Z){let ee=!!b.userData.baseEmissiveMap;b.emissive.set(Cr.color),b.emissiveIntensity=ee?b.userData.baseEmissiveIntensity:Cr.intensity}b.needsUpdate=!0})}B()},[E,A,z,o,n,L,c,B]);let Q=p=>{let m=p;for(;m;){let w=m.name||m.uuid;if(E[w])return w;m=m.parent}return null},ie=oe?{onClick:p=>{let m=Q(p.object);m&&(p.stopPropagation(),T(m))},...L?{onPointerOver:p=>{let m=Q(p.object);m&&(p.stopPropagation(),D("pointer"),j(m))},onPointerOut:p=>{p.stopPropagation(),V(),j(null)}}:{}}:{};return e("primitive",{object:M,...ie})}function Tn({scene:r,controlsRef:i,refitOnResize:a,onInitialFitComplete:l,resumeViewRef:s}){let c=N(!1),o=G(x=>x.invalidate),n=G(x=>x.size),u=N(null);return _(()=>{c.current=!1,o()},[o,r]),Tr(()=>{if(c.current)return;if(!r||!i.current){o();return}c.current=!0,zn(r,i.current);let x=s.current;if(x){s.current=null,i.current.setLookAt(...x.position,...x.target,!1).catch(()=>{}).finally(l);return}i.current.fitToBox(r,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{}).finally(l)}),_(()=>{if(!(!a||!c.current||!r||!i.current))return u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{i.current?.fitToBox(r,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{}),o()},150),()=>{u.current&&clearTimeout(u.current)}},[n.width,n.height,a]),null}function Dn({scene:r,exposure:i,toneMapping:a,fov:l,wireframe:s}){let c=G(u=>u.gl),o=G(u=>u.camera),n=G(u=>u.invalidate);return _(()=>{c.toneMappingExposure=i,n()},[c,i,n]),_(()=>{o instanceof Dr&&(o.fov=l,o.updateProjectionMatrix(),n())},[o,l,n]),_(()=>{c.toneMapping=Or[a],r?.traverse(u=>{if(Te(u))for(let x of[u.material].flat())x.wireframe=s,x.needsUpdate=!0}),n()},[c,r,a,s,n]),null}function Vn({enabled:r,speed:i,controlsRef:a}){let l=G(s=>s.invalidate);return Tr((s,c)=>{!r||!a.current||(a.current.rotate(c*.2*i,0,!1),l())}),null}function ve(r){return Array.from(r.types).includes("Files")}function te({label:r,checked:i,onChange:a}){return d("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("button",{type:"button",className:"ri-env-checkbox-btn",role:"checkbox","aria-checked":i,"aria-label":r,onClick:()=>a(!i),children:e("span",{className:`ri-env-checkbox${i?" ri-env-checkbox--checked":""}`,children:i&&e(Vr,{size:10,strokeWidth:2.5,"aria-hidden":"true"})})})})]})}function Le({label:r,value:i,onChange:a}){return d("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:d("label",{className:"ri-env-color-swatch",children:[e("span",{className:"ri-env-color-swatch__chip",style:{background:i}}),e("span",{className:"ri-env-color-swatch__hex",children:i}),e("input",{type:"color",className:"ri-env-color-swatch__input","aria-label":r,value:i,onChange:l=>a(l.target.value)})]})})]})}function O({label:r,value:i,min:a,max:l,step:s,format:c=n=>n.toFixed(2),onChange:o}){return d("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),d("div",{className:"ri-env-row__value ri-env-row__value--slider",children:[e("input",{type:"range",className:"ri-env-slider","aria-label":r,min:a,max:l,step:s,value:i,onChange:n=>o(Number(n.target.value))}),e("span",{className:"ri-env-slider__value",children:c(i)})]})]})}function Er({label:r,optionLabels:i,value:a,options:l,onChange:s}){return d("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("select",{className:"ri-env-select","aria-label":r,value:a,onChange:c=>s(c.target.value),children:l.map(c=>e("option",{value:c,children:i?.[c]??c},c))})})]})}function fe({label:r,value:i}){return d("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("span",{className:"ri-env-row__info",children:i})]})}var zr=r=>`${Math.round(r)}\xB0`;function ae({title:r,children:i}){let[a,l]=g(!1);return d("div",{className:"ri-env-section",children:[d("button",{type:"button",className:"ri-env-section__header","aria-expanded":!a,onClick:()=>l(s=>!s),children:[e(Rn,{size:12,strokeWidth:2,className:`ri-env-section__chevron${a?" env-section__chevron--collapsed":""}`}),e("span",{children:r})]}),!a&&e("div",{className:"ri-env-section__body",children:i})]})}function On({isOpen:r,onToggle:i,settings:a,modelInfo:l,onChange:s,onReset:c}){let o=me();return d("div",{className:`ri-left-panel-wrapper ${r?"ri-left-panel-wrapper--open":"ri-left-panel-wrapper--closed"}`,children:[!r&&e("button",{className:"ri-side-panel__open-btn ri-side-panel__open-btn--left",onClick:()=>i(!0),children:e(Sn,{size:20,strokeWidth:1.8})}),d("div",{className:`ri-side-panel ri-side-panel--left ${r?"ri-side-panel--open-left":"ri-side-panel--closed-left"}`,"aria-hidden":!r,children:[e("div",{className:"ri-side-panel__header",children:d("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:o("sceneSettings")}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>i(!1),title:o("close"),children:e(Pe,{size:12,strokeWidth:1.6})})]})}),d("div",{className:"ri-env-controls",children:[d(ae,{title:o("environment"),children:[e(Er,{label:o("environmentPreset"),value:a.envPreset,options:Nr,optionLabels:Object.fromEntries(Nr.map(n=>[n,o(`environment${n[0].toUpperCase()}${n.slice(1)}`)])),onChange:n=>s("envPreset",n)}),e(O,{label:o("environmentIntensity"),value:a.envIntensity,min:0,max:3,step:.05,onChange:n=>s("envIntensity",n)}),e(O,{label:o("rotation"),value:a.envRotation,min:0,max:360,step:1,format:zr,onChange:n=>s("envRotation",n)}),e(te,{label:o("showEnvironmentAsBackground"),checked:a.backgroundEnabled,onChange:n=>s("backgroundEnabled",n)}),a.backgroundEnabled?e(O,{label:o("backgroundBlur"),value:a.backgroundBlur,min:0,max:1,step:.01,onChange:n=>s("backgroundBlur",n)}):e(Le,{label:o("backgroundColor"),value:a.backgroundColor,onChange:n=>s("backgroundColor",n)})]}),d(ae,{title:o("lighting"),children:[e(O,{label:o("exposure"),value:a.exposure,min:0,max:2,step:.05,onChange:n=>s("exposure",n)}),e(Er,{label:o("toneMapping"),value:a.toneMapping,options:Object.keys(Or),optionLabels:{aces:o("toneMappingAces"),agx:o("toneMappingAgx"),neutral:o("toneMappingNeutral"),none:o("toneMappingNone")},onChange:n=>s("toneMapping",n)}),e(O,{label:o("ambientLightIntensity"),value:a.ambientIntensity,min:0,max:3,step:.05,onChange:n=>s("ambientIntensity",n)}),e(Le,{label:o("ambientLightColor"),value:a.ambientColor,onChange:n=>s("ambientColor",n)}),e(O,{label:o("directLightIntensity"),value:a.directionalIntensity,min:0,max:5,step:.05,onChange:n=>s("directionalIntensity",n)}),e(Le,{label:o("directLightColor"),value:a.directionalColor,onChange:n=>s("directionalColor",n)})]}),d(ae,{title:o("ground"),children:[e(te,{label:o("groundShadow"),checked:a.groundShadow,onChange:n=>s("groundShadow",n)}),a.groundShadow&&e(O,{label:o("groundShadowOpacity"),value:a.groundShadowOpacity,min:0,max:1,step:.01,onChange:n=>s("groundShadowOpacity",n)}),e(te,{label:o("floorGrid"),checked:a.showFloorGrid,onChange:n=>s("showFloorGrid",n)})]}),d(ae,{title:o("display"),children:[e(te,{label:o("wireframe"),checked:a.wireframe,onChange:n=>s("wireframe",n)}),e(te,{label:o("autoRotate"),checked:a.autoRotate,onChange:n=>s("autoRotate",n)}),a.autoRotate&&e(O,{label:o("autoRotateSpeed"),value:a.autoRotateSpeed,min:.1,max:5,step:.1,onChange:n=>s("autoRotateSpeed",n)}),e(O,{label:o("fieldOfView"),value:a.fov,min:15,max:90,step:1,format:zr,onChange:n=>s("fov",n)})]}),l&&d(ae,{title:o("modelInfo"),children:[e(fe,{label:o("modelInfoObjects"),value:l.objects.toLocaleString()}),e(fe,{label:o("modelInfoTriangles"),value:l.triangles.toLocaleString()}),e(fe,{label:o("modelInfoMaterials"),value:l.materials.toLocaleString()}),e(fe,{label:o("size"),value:l.size})]}),e("div",{className:"ri-env-footer",children:d("button",{type:"button",className:"ri-env-reset",onClick:c,children:[e(Nn,{size:12,"aria-hidden":"true"}),o("resetSettings")]})})]})]})]})}function jn(r){let i=0,a=new Set;r.traverse(s=>{if(Te(s)){i+=1;for(let c of[s.material].flat())a.add(c.name||c.uuid)}});let l=new ze().setFromObject(r).getSize(new Y);return{objects:i,triangles:Re(r),materials:a.size,size:[l.x,l.y,l.z].map(s=>Number(s.toPrecision(3))).join(" \xD7 ")}}function In({meshKeys:r,hiddenKeys:i,selectedKey:a,isOpen:l,onToggle:s,onFocus:c,onHover:o,onToggleVisibility:n}){let u=me(),[x,U]=g(""),[k,T]=g(null),L=Object.values(r).filter(h=>h.label.toLowerCase().includes(x.toLowerCase()));return d("div",{className:`ri-right-panel-wrapper ${l?"ri-right-panel-wrapper--open":"ri-right-panel-wrapper--closed"}`,children:[!l&&e("button",{className:"ri-side-panel__open-btn",onClick:()=>s(!0),children:e(Cn,{size:20,strokeWidth:1.8})}),d("div",{className:`ri-side-panel ${l?"ri-side-panel--open":"ri-side-panel--closed"}`,"aria-hidden":!l,children:[e("div",{className:"ri-side-panel__header",children:d("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:u("sceneObjects")}),e("span",{className:"ri-side-panel__title","aria-label":u("objectCount",{count:L.length}),children:L.length}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>s(!1),title:u("close"),children:e(Pe,{size:12,strokeWidth:1.6})})]})}),e("div",{className:"ri-side-panel__search-wrap",children:e("input",{className:"ri-side-panel__search",type:"text",placeholder:u("searchObjects"),value:x,onChange:h=>U(h.target.value)})}),e("div",{className:"ri-side-panel__list",children:L.map(({key:h,label:B})=>{let D=!i.has(h),V=a===h,z=k===h;return d("div",{onClick:()=>c(h),onMouseEnter:()=>{T(h),o(h)},onMouseLeave:()=>{T(null),o(null)},className:["ri-side-panel__row",z?"ri-side-panel__row--hovered":"",V?"ri-side-panel__row--selected":""].filter(Boolean).join(" "),children:[e("button",{type:"button",className:`ri-side-panel__label ri-side-panel__labelButton${z||V?" ri-side-panel__label--hovered":""}`,"aria-current":V?"true":void 0,onFocus:()=>{T(h),o(h)},onBlur:()=>{T(null),o(null)},children:B}),e("button",{type:"button",className:"ri-side-panel__vis-btn",title:u(D?"hide":"show"),"aria-label":u(D?"hideObject":"showObject",{name:B}),onClick:j=>{j.stopPropagation(),n(h)},children:e("span",{className:`ri-side-panel__checkbox${D?" ri-side-panel__checkbox--checked":""}`,children:D&&e(Vr,{size:9,strokeWidth:5,color:"white"})})})]},h)})})]})]})}function jr(r){return e(rr,{labels:r.labels,children:e(Fn,{...r})})}function Fn({modelUrl:r,poster:i,loading:a,reveal:l,modelFormat:s,dracoDecoderPath:c,ktx2TranscoderPath:o,meshopt:n=!0,backgroundColor:u="#1a1a1a",showSceneObjectsPanel:x=!0,showSceneSettingsPanel:U=!0,enableModelUpload:k=!1,zoomOnSelected:T=!1,highlightOnHover:L=!1,showLoadingOverlay:h=!0,refitOnResize:B=!0,backgroundEnabled:D=!1,autoRotate:V=!1,envPreset:z="city",exposure:j=1,ambientIntensity:M=.6,ambientColor:E="#ffffff",directionalIntensity:A=1.2,directionalColor:J="#ffffff",envIntensity:oe=1,envRotation:Q=0,backgroundBlur:ie=0,toneMapping:p="aces",groundShadow:m=!1,groundShadowOpacity:w=.5,showFloorGrid:Z=!1,wireframe:K=!1,autoRotateSpeed:b=1,fov:ee=45,onModelLoaded:S,onLoadError:se,reducedMotion:Ir="user"}){let I=me(),ge=Mr(Ir),De=V&&!ge;Rr("simple-model-viewer","SimpleModelViewer");let W=N(null),Ve=N({}),Oe=N(null),be=N(null),re=N(0),[R,he]=g(null),[je,Ie]=g(null),[Fr,xe]=g(!1),[Br,Fe]=g({}),[Be,Ae]=g(new Set),[Ke,He]=g(null),[Ar,Ge]=g(null),[Ue,We]=g(null),[Kr,Xe]=g(null),[Hr,le]=g(!1),[$e,qe]=g(!1),[we,ye]=g(!1),[Gr,de]=g(null),Ur=gr(Gr),[Wr,ce]=g(!1),[Xr,$r]=g(()=>typeof window>"u"?!0:window.innerWidth>900),[qr,Yr]=g(()=>typeof window>"u"?!0:window.innerWidth>900),pe=H(()=>({backgroundEnabled:D,backgroundColor:u,autoRotate:De,envPreset:z,exposure:j,ambientIntensity:M,ambientColor:E,directionalIntensity:A,directionalColor:J,envIntensity:oe,envRotation:Q,backgroundBlur:ie,toneMapping:p,groundShadow:m,groundShadowOpacity:w,showFloorGrid:Z,wireframe:K,autoRotateSpeed:b,fov:ee}),[D,u,De,z,j,M,E,A,J,oe,Q,ie,p,m,w,Z,K,b,ee]),[v,ue]=g(pe),C=k?Ue:r,Ye=N(null),_e=N(null),ke=N(null),[ne,Je]=g(null);_(()=>()=>{ne&&URL.revokeObjectURL(ne)},[ne]);let Qe=N(C);Qe.current=C;let Me=N(null),F=mr({loading:a,reveal:l,rootRef:Ye,onPark:()=>{Me.current=_e.current?.gl??null;let t=W.current;if(t&&we){ke.current={position:t.getPosition(new Y).toArray(),target:t.getTarget(new Y).toArray()};let f=C;ur(_e.current).then(P=>{P&&(f===Qe.current?Je(P):URL.revokeObjectURL(P))})}he(null),ye(!1)}});_(()=>{if(F.live)return;let t=Me.current;Me.current=null,t&&pr(t)},[F.live]);let X=y(()=>{ke.current=null,Je(null),he(null),Ie(null),xe(!1),Fe({}),Ae(new Set),He(null),Ge(null),le(!1),ye(!1),de(null)},[]),$=y(()=>{be.current?.cleanup(),be.current=null},[]),Jr=y(()=>{$(),We(null),Xe(null),X(),ue(pe)},[pe,X,$]),Ze=y(async t=>{qe(!0);try{let f=await tr(t);$(),be.current=f,We(f.url),Xe(f.name),X()}catch(f){le(!0),se?.(f)}finally{qe(!1)}},[se,X,$]),Se=y(t=>{let f=t?.[0];f&&Ze(f)},[Ze]);_(()=>()=>{$()},[$]);let Qr=y(()=>R,[R]),Zr=!v.backgroundEnabled&&new wn(v.backgroundColor).getHSL({h:0,s:0,l:0}).l>.5?"#000000":"#ffffff",en=H(()=>R?jn(R):null,[R]),q=H(()=>{if(!R)return null;let t=new ze().setFromObject(R);if(t.isEmpty())return null;let f=t.getSize(new Y);return{y:t.min.y,center:t.getCenter(new Y),size:Math.max(f.x,f.y,f.z)}},[R]),rn=y((t,f)=>{ue(P=>({...P,[t]:f}))},[]);_(()=>{ue(t=>({...t,backgroundColor:u}))},[u]),_(()=>{X()},[C,X]);let nn=y(t=>{Fe(t)},[]),tn=y(t=>{he(t),le(!1);let f=Re(t);Ie(f>ar?f:null),xe(!1),de(null),S?.(kr(t))},[S]),an=y(t=>{le(!0),de(null),se?.(t)},[se]),on=y(t=>{t.lengthComputable&&t.total>0&&de(t.loaded/t.total*100)},[]),er=y(t=>{if(He(t),!T)return;let f=Ve.current[t];!f||!W.current||W.current.fitToBox(f,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{})},[T]),sn=y(t=>{Ae(f=>{let P=new Set(f);return P.has(t)?P.delete(t):P.add(t),P})},[]),ln=y(t=>{!k||!ve(t.dataTransfer)||(t.preventDefault(),t.stopPropagation(),re.current+=1,ce(!0))},[k]),dn=y(t=>{!k||!ve(t.dataTransfer)||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="copy",ce(!0))},[k]),cn=y(t=>{!k||!ve(t.dataTransfer)||(t.preventDefault(),t.stopPropagation(),re.current=Math.max(0,re.current-1),re.current===0&&ce(!1))},[k]),pn=y(t=>{!k||!ve(t.dataTransfer)||(t.preventDefault(),t.stopPropagation(),re.current=0,ce(!1),Se(t.dataTransfer.files))},[k,Se]),un=h&&($e||!!(C&&F.live&&!Hr&&(!R||!we)));return d("div",{className:"smv-root",ref:Ye,"data-reduced-motion":ge?"":void 0,style:{background:v.backgroundColor},onDragEnter:ln,onDragOver:dn,onDragLeave:cn,onDrop:pn,children:[U&&C&&e(On,{isOpen:qr,onToggle:Yr,settings:v,modelInfo:en,onReset:()=>ue(pe),onChange:rn}),d("div",{className:"smv-canvasArea",children:[je!==null&&!Fr&&d("div",{className:"smv-largeModelBanner",children:[e(En,{size:14,className:"smv-largeModelBanner__icon"}),e("span",{children:I("simpleLargeModelWarning",{millions:Math.round(je/1e6)})}),e("button",{type:"button",className:"smv-largeModelBanner__dismiss",onClick:()=>xe(!0),"aria-label":I("dismiss"),children:e(Pe,{size:12})})]}),k?d(Pr,{children:[e("input",{ref:Oe,type:"file",accept:nr,className:"smv-upload-input",onChange:t=>{Se(t.target.files),t.currentTarget.value=""}}),C?e("div",{className:"smv-upload-toolbar",children:d(Pr,{children:[e("span",{className:"smv-upload-toolbar__name",children:Kr??I("uploadedModel")}),d("button",{type:"button",className:"smv-upload-toolbar__button smv-upload-toolbar__button--ghost",onClick:Jr,children:[e(Ln,{size:14}),I("clear")]})]})}):null]}):null,C&&!F.live?e(fr,{className:"ri-viewerPlaceholder--inset",background:v.backgroundColor,poster:ne??i,onReveal:F.awaitingReveal?F.reveal:void 0}):C?d(bn,{dpr:[1,2],frameloop:F.visible?"demand":"never",resize:{debounce:0,scroll:!1},raycaster:{firstHitOnly:!0},style:{background:v.backgroundColor},camera:{position:[0,0,5],fov:45,near:.1,far:1e3},children:[e(dr,{captureRef:_e}),e(cr,{}),d(Ce,{fallback:null,children:[e("ambientLight",{intensity:v.ambientIntensity,color:v.ambientColor}),e("directionalLight",{position:[-4,5,7],intensity:v.directionalIntensity,color:v.directionalColor,castShadow:!0}),e("directionalLight",{position:[-5,5,5],intensity:.5}),e(Ce,{fallback:null,children:e(gn,{preset:v.envPreset,background:v.backgroundEnabled,environmentIntensity:v.envIntensity,backgroundIntensity:v.envIntensity,backgroundBlurriness:v.backgroundBlur})}),e(hr,{rotation:v.envRotation}),e(Dn,{scene:R,exposure:v.exposure,toneMapping:v.toneMapping,fov:v.fov,wireframe:v.wireframe}),e(Vn,{enabled:v.autoRotate,speed:v.autoRotateSpeed,controlsRef:W}),v.groundShadow&&q&&e(br,{position:[q.center.x,q.y,q.center.z],scale:q.size*2,opacity:v.groundShadowOpacity,blur:2,far:q.size,resolution:1024,color:"#000000"}),v.showFloorGrid&&e(lr,{getTarget:Qr,revision:R,lineColor:Zr}),e(Ee,{onLoadError:an,children:e(Ce,{fallback:null,children:e(Pn,{url:C,format:Ue?void 0:s,dracoDecoderPath:c,ktx2TranscoderPath:o,meshopt:n,hiddenKeys:Be,selectedKey:Ke,panelHoveredKey:Ar,nodeRefsOut:Ve,onMeshesReady:nn,onModelLoaded:tn,onLoadProgress:on,onMeshClick:er,highlightOnHover:L})})},C),e(Tn,{scene:R,controlsRef:W,refitOnResize:B,onInitialFitComplete:()=>ye(!0),resumeViewRef:ke}),e(fn,{ref:W,makeDefault:!0,smoothTime:ge?0:.3})]})]}):e("div",{className:"smv-upload-empty-state",style:{background:v.backgroundColor},children:d("div",{className:"smv-upload-empty-state__card",children:[e("div",{className:"smv-upload-empty-state__icon",children:e(Ne,{size:24})}),e("p",{className:"smv-upload-empty-state__body",children:I("dropModelHint",{formats:".glb, .gltf, .obj, .fbx, .usdz, .stl, .ply, .zip"})}),d("button",{type:"button",className:"smv-upload-empty-state__button",onClick:()=>Oe.current?.click(),children:[e(Ne,{size:15}),I("chooseModel")]})]})}),C&&F.live?e(vr,{src:ne??i,hidden:!!(R&&we)}):null,e(Sr,{visible:un,message:I("loadingModel"),progress:$e?void 0:Ur??void 0}),k&&Wr?e("div",{className:"smv-upload-drop-overlay",children:d("div",{className:"smv-upload-drop-overlay__card",children:[e(Ne,{size:20}),e("span",{children:I("releaseToLoadYourModel")})]})}):null]}),x&&C&&e(In,{meshKeys:Br,hiddenKeys:Be,selectedKey:Ke,isOpen:Xr,onToggle:$r,onFocus:er,onHover:Ge,onToggleVisibility:sn})]})}export{mn as DEFAULT_MODEL_VIEWER_LABELS,jr as SimpleModelViewer};
1
+ "use client";import{a as Ir}from"./chunk-MMO7KCYU.mjs";import{A as Mr,C as Sr,D as Cr,H as Rr,J as Lr,L as Nr,M as Er,P as zr,Q as Pr,T as Tr,U as Dr,V as Vr,W as jr,h as cr,i as pr,k as ur,l as mr,m as vr,n as ze,o as gr,p as br,t as fr,u as hr,v as xr,w as wr,x as yr,y as _r,z as kr}from"./chunk-7MN2TMY6.mjs";import{a as dr,b as be}from"./chunk-GXY3VML4.mjs";import{a as Or}from"./chunk-37YITTIK.mjs";import"./chunk-6Q6YZ7O5.mjs";import{a as Nn}from"./chunk-IOLT2VXU.mjs";import"./chunk-BNKTI3CY.mjs";import"./chunk-JR557W27.mjs";import{useRef as R,useState as g,useCallback as k,useEffect as M,useMemo as $,Component as En,Suspense as Pe}from"react";import{CameraControls as zn,Environment as Pn}from"@react-three/drei";import{useFrame as Wr,useThree as X}from"@react-three/fiber";import{Canvas as Tn}from"@react-three/fiber";import{ACESFilmicToneMapping as Dn,AgXToneMapping as Vn,Box3 as we,Color as On,MeshStandardMaterial as jn,NeutralToneMapping as In,NoToneMapping as Bn,PerspectiveCamera as $r,Vector3 as D}from"three";import{SkeletonUtils as An}from"three-stdlib";import{X as De,Check as Xr,Settings as Fn,ChevronDown as Kn,Boxes as Hn,RotateCcw as Gn,Trash2 as Un,Upload as Te,AlertTriangle as Wn}from"lucide-react";import{Fragment as Ur,jsx as e,jsxs as c}from"react/jsx-runtime";var Br={color:"#93c5fd",intensity:.05},Ar=["apartment","city","dawn","forest","lobby","night","park","studio","sunset","warehouse"],qr={aces:Dn,agx:Vn,neutral:In,none:Bn};function Ve(r){return!!(r&&"isMesh"in r&&r.isMesh)}function Fr(r,o){Array.isArray(r)?r.forEach(o):o(r)}function Kr(r,o,a){if(!o)return;let d=o.camera;if(!(d instanceof $r))return;let s=new we().setFromObject(r).getSize(new D).length();if(!Number.isFinite(s)||s<=0)return;d.near=s/100,d.far=s*100,d.updateProjectionMatrix();let l=Nr(a);o.minDistance=a?.minDistance??s*.05,o.maxDistance=a?.maxDistance??s*10,o.minPolarAngle=l.minPolarAngle,o.maxPolarAngle=l.maxPolarAngle,o.minAzimuthAngle=l.minAzimuthAngle,o.maxAzimuthAngle=l.maxAzimuthAngle,o.boundaryEnclosesCamera=l.boundaryEnclosesCamera,o.boundaryFriction=l.boundaryFriction,o.setBoundary(l.panBoundary?new we(new D(...l.panBoundary[0]),new D(...l.panBoundary[1])):void 0)}var ye=class extends En{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){this.props.onLoadError?.(a)}render(){return this.state.hasError?null:this.props.children}};function $n({url:r,format:o,dracoDecoderPath:a,ktx2TranscoderPath:d,meshopt:s,hiddenKeys:l,selectedKey:b,panelHoveredKey:f,nodeRefsOut:t,onMeshesReady:i,onModelLoaded:V,onLoadProgress:h,onMeshClick:y,highlightOnHover:E}){let{scene:w}=zr(r,{dracoDecoderPath:a,ktx2TranscoderPath:d,meshopt:s},o,h),G=X(p=>p.invalidate),{setCanvasCursor:A,restoreCanvasCursor:O}=Dr(),[j,F]=g(null),L=$(()=>An.clone(w),[w]),z=$(()=>{let p={};return L.traverse(u=>{if(!Ve(u))return;let _=u.name||u.uuid;p[_]={key:_,label:u.name||u.type,ref:u}}),p},[L]),I=$(()=>{let p={};for(let[u,{ref:_}]of Object.entries(z)){let U=(Array.isArray(_.material)?_.material:[_.material]).map(x=>{let N=(Pr(x)??new jn).clone();return N.userData.baseColor=N.color.clone(),N.userData.baseMap=N.map,N.userData.baseEmissive=N.emissive.clone(),N.userData.baseEmissiveMap=N.emissiveMap,N.userData.baseEmissiveIntensity=N.emissiveIntensity,N});p[u]=Array.isArray(_.material)?U:U[0]}return p},[z]);M(()=>()=>{Object.values(I).forEach(p=>Fr(p,u=>u.dispose()))},[I]);let q=R(null);M(()=>{q.current!==r&&(q.current=r,L.updateWorldMatrix(!0,!0),Tr(L),i(z),V(L))},[r,L,z,i,V]),M(()=>{let p=new AbortController;return gr(L,p.signal),()=>{p.abort(),br(L)}},[L]);let ae=$(()=>!vr(L),[L]);M(()=>{for(let[p,{ref:u}]of Object.entries(z))t.current[p]=u},[z,t]),M(()=>{!E&&j!==null&&(F(null),O())},[E,j,O]),M(()=>{for(let[p,{ref:u}]of Object.entries(z)){u.visible=!l.has(p);let _=I[p];if(!_)continue;u.material=_;let ee=E&&j===p,U=E&&f===p;Fr(_,x=>{if(x.color.copy(x.userData.baseColor),x.map=x.userData.baseMap??null,x.emissive.copy(x.userData.baseEmissive),x.emissiveMap=x.userData.baseEmissiveMap??null,x.emissiveIntensity=x.userData.baseEmissiveIntensity,U||ee){let re=!!x.userData.baseEmissiveMap;x.emissive.set(Br.color),x.emissiveIntensity=re?x.userData.baseEmissiveIntensity:Br.intensity}x.needsUpdate=!0})}G()},[z,I,j,b,f,E,l,G]);let Z=p=>{if(!Er(p))return null;let u=p;for(;u;){let _=u.name||u.uuid;if(z[_])return _;u=u.parent}return null},ie=ae?{onClick:p=>{let u=Z(p.object);u&&(p.stopPropagation(),y(u))},...E?{onPointerOver:p=>{let u=Z(p.object);u&&(p.stopPropagation(),A("pointer"),F(u))},onPointerOut:p=>{p.stopPropagation(),O(),F(null)}}:{}}:{};return e("primitive",{object:L,...ie})}function Xn({scene:r,controlsRef:o,refitOnResize:a,onInitialFitComplete:d,resumeViewRef:s,cameraLimits:l}){let b=R(l);b.current=l;let f=JSON.stringify(l??null);M(()=>{r&&Kr(r,o.current,b.current)},[r,o,f]);let t=R(!1),i=X(y=>y.invalidate),V=X(y=>y.size),h=R(null);return M(()=>{t.current=!1,i()},[i,r]),Wr(()=>{if(t.current)return;if(!r||!o.current){i();return}t.current=!0,Kr(r,o.current,l);let y=s.current;if(y){s.current=null,o.current.setLookAt(...y.position,...y.target,!1).catch(()=>{}).finally(d);return}o.current.fitToBox(r,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{}).finally(d)}),M(()=>{if(!(!a||!t.current||!r||!o.current))return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{o.current?.fitToBox(r,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{}),i()},150),()=>{h.current&&clearTimeout(h.current)}},[V.width,V.height,a]),null}function qn({scene:r,exposure:o,toneMapping:a,fov:d,wireframe:s}){let l=X(t=>t.gl),b=X(t=>t.camera),f=X(t=>t.invalidate);return M(()=>{l.toneMappingExposure=o,f()},[l,o,f]),M(()=>{b instanceof $r&&(b.fov=d,b.updateProjectionMatrix(),f())},[b,d,f]),M(()=>{l.toneMapping=qr[a],r?.traverse(t=>{if(Ve(t))for(let i of[t.material].flat())i.wireframe=s,i.needsUpdate=!0}),f()},[l,r,a,s,f]),null}function Jn({enabled:r,speed:o,controlsRef:a}){let d=X(s=>s.invalidate);return Wr((s,l)=>{!r||!a.current||(a.current.rotate(l*.2*o,0,!1),d())}),null}function fe(r){return Array.from(r.types).includes("Files")}function oe({label:r,checked:o,onChange:a}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("button",{type:"button",className:"ri-env-checkbox-btn",role:"checkbox","aria-checked":o,"aria-label":r,onClick:()=>a(!o),children:e("span",{className:`ri-env-checkbox${o?" ri-env-checkbox--checked":""}`,children:o&&e(Xr,{size:10,strokeWidth:2.5,"aria-hidden":"true"})})})})]})}function he({label:r,value:o,onChange:a}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:c("label",{className:"ri-env-color-swatch",children:[e("span",{className:"ri-env-color-swatch__chip",style:{background:o}}),e("span",{className:"ri-env-color-swatch__hex",children:o}),e("input",{type:"color",className:"ri-env-color-swatch__input","aria-label":r,value:o,onChange:d=>a(d.target.value)})]})})]})}function B({label:r,value:o,min:a,max:d,step:s,format:l=f=>f.toFixed(2),onChange:b}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),c("div",{className:"ri-env-row__value ri-env-row__value--slider",children:[e("input",{type:"range",className:"ri-env-slider","aria-label":r,min:a,max:d,step:s,value:o,onChange:f=>b(Number(f.target.value))}),e("span",{className:"ri-env-slider__value",children:l(o)})]})]})}function Hr({label:r,optionLabels:o,value:a,options:d,onChange:s}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("select",{className:"ri-env-select","aria-label":r,value:a,onChange:l=>s(l.target.value),children:d.map(l=>e("option",{value:l,children:o?.[l]??l},l))})})]})}function xe({label:r,value:o}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("span",{className:"ri-env-row__info",children:o})]})}var Gr=r=>`${Math.round(r)}\xB0`;function Q({title:r,children:o}){let[a,d]=g(!1);return c("div",{className:"ri-env-section",children:[c("button",{type:"button",className:"ri-env-section__header","aria-expanded":!a,onClick:()=>d(s=>!s),children:[e(Kn,{size:12,strokeWidth:2,className:`ri-env-section__chevron${a?" env-section__chevron--collapsed":""}`}),e("span",{children:r})]}),!a&&e("div",{className:"ri-env-section__body",children:o})]})}function Yn({isOpen:r,onToggle:o,settings:a,modelInfo:d,onChange:s,onReset:l,environmentEnabled:b,environmentUrl:f}){let t=be();return c("div",{className:`ri-left-panel-wrapper ${r?"ri-left-panel-wrapper--open":"ri-left-panel-wrapper--closed"}`,children:[!r&&e("button",{className:"ri-side-panel__open-btn ri-side-panel__open-btn--left",onClick:()=>o(!0),children:e(Fn,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ri-side-panel--left ${r?"ri-side-panel--open-left":"ri-side-panel--closed-left"}`,"aria-hidden":!r,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:t("sceneSettings")}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>o(!1),title:t("close"),children:e(De,{size:12,strokeWidth:1.6})})]})}),c("div",{className:"ri-env-controls",children:[b&&c(Q,{title:t("environment"),children:[!f&&e(Hr,{label:t("environmentPreset"),value:a.envPreset,options:Ar,optionLabels:Object.fromEntries(Ar.map(i=>[i,t(`environment${i[0].toUpperCase()}${i.slice(1)}`)])),onChange:i=>s("envPreset",i)}),e(B,{label:t("environmentIntensity"),value:a.envIntensity,min:0,max:3,step:.05,onChange:i=>s("envIntensity",i)}),e(B,{label:t("rotation"),value:a.envRotation,min:0,max:360,step:1,format:Gr,onChange:i=>s("envRotation",i)}),e(oe,{label:t("showEnvironmentAsBackground"),checked:a.backgroundEnabled,onChange:i=>s("backgroundEnabled",i)}),a.backgroundEnabled?e(B,{label:t("backgroundBlur"),value:a.backgroundBlur,min:0,max:1,step:.01,onChange:i=>s("backgroundBlur",i)}):e(he,{label:t("backgroundColor"),value:a.backgroundColor,onChange:i=>s("backgroundColor",i)})]}),!b&&e(Q,{title:t("background"),children:e(he,{label:t("backgroundColor"),value:a.backgroundColor,onChange:i=>s("backgroundColor",i)})}),c(Q,{title:t("lighting"),children:[e(B,{label:t("exposure"),value:a.exposure,min:0,max:2,step:.05,onChange:i=>s("exposure",i)}),e(Hr,{label:t("toneMapping"),value:a.toneMapping,options:Object.keys(qr),optionLabels:{aces:t("toneMappingAces"),agx:t("toneMappingAgx"),neutral:t("toneMappingNeutral"),none:t("toneMappingNone")},onChange:i=>s("toneMapping",i)}),e(B,{label:t("ambientLightIntensity"),value:a.ambientIntensity,min:0,max:3,step:.05,onChange:i=>s("ambientIntensity",i)}),e(he,{label:t("ambientLightColor"),value:a.ambientColor,onChange:i=>s("ambientColor",i)}),e(B,{label:t("directLightIntensity"),value:a.directionalIntensity,min:0,max:5,step:.05,onChange:i=>s("directionalIntensity",i)}),e(he,{label:t("directLightColor"),value:a.directionalColor,onChange:i=>s("directionalColor",i)})]}),c(Q,{title:t("ground"),children:[e(oe,{label:t("groundShadow"),checked:a.groundShadow,onChange:i=>s("groundShadow",i)}),a.groundShadow&&e(B,{label:t("groundShadowOpacity"),value:a.groundShadowOpacity,min:0,max:1,step:.01,onChange:i=>s("groundShadowOpacity",i)}),e(oe,{label:t("floorGrid"),checked:a.showFloorGrid,onChange:i=>s("showFloorGrid",i)})]}),c(Q,{title:t("display"),children:[e(oe,{label:t("wireframe"),checked:a.wireframe,onChange:i=>s("wireframe",i)}),e(oe,{label:t("autoRotate"),checked:a.autoRotate,onChange:i=>s("autoRotate",i)}),a.autoRotate&&e(B,{label:t("autoRotateSpeed"),value:a.autoRotateSpeed,min:.1,max:5,step:.1,onChange:i=>s("autoRotateSpeed",i)}),e(B,{label:t("fieldOfView"),value:a.fov,min:15,max:90,step:1,format:Gr,onChange:i=>s("fov",i)})]}),d&&c(Q,{title:t("modelInfo"),children:[e(xe,{label:t("modelInfoObjects"),value:d.objects.toLocaleString()}),e(xe,{label:t("modelInfoTriangles"),value:d.triangles.toLocaleString()}),e(xe,{label:t("modelInfoMaterials"),value:d.materials.toLocaleString()}),e(xe,{label:t("size"),value:d.size})]}),e("div",{className:"ri-env-footer",children:c("button",{type:"button",className:"ri-env-reset",onClick:l,children:[e(Gn,{size:12,"aria-hidden":"true"}),t("resetSettings")]})})]})]})]})}function Qn(r){let o=0,a=new Set;r.traverse(s=>{if(Ve(s)){o+=1;for(let l of[s.material].flat())a.add(l.name||l.uuid)}});let d=new we().setFromObject(r).getSize(new D);return{objects:o,triangles:ze(r),materials:a.size,size:[d.x,d.y,d.z].map(s=>Number(s.toPrecision(3))).join(" \xD7 ")}}function Zn({meshKeys:r,hiddenKeys:o,selectedKey:a,isOpen:d,onToggle:s,onFocus:l,onHover:b,onToggleVisibility:f}){let t=be(),[i,V]=g(""),[h,y]=g(null),E=Object.values(r).filter(w=>w.label.toLowerCase().includes(i.toLowerCase()));return c("div",{className:`ri-right-panel-wrapper ${d?"ri-right-panel-wrapper--open":"ri-right-panel-wrapper--closed"}`,children:[!d&&e("button",{className:"ri-side-panel__open-btn",onClick:()=>s(!0),children:e(Hn,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ${d?"ri-side-panel--open":"ri-side-panel--closed"}`,"aria-hidden":!d,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:t("sceneObjects")}),e("span",{className:"ri-side-panel__title","aria-label":t("objectCount",{count:E.length}),children:E.length}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>s(!1),title:t("close"),children:e(De,{size:12,strokeWidth:1.6})})]})}),e("div",{className:"ri-side-panel__search-wrap",children:e("input",{className:"ri-side-panel__search",type:"text",placeholder:t("searchObjects"),value:i,onChange:w=>V(w.target.value)})}),e("div",{className:"ri-side-panel__list",children:E.map(({key:w,label:G})=>{let A=!o.has(w),O=a===w,j=h===w;return c("div",{onClick:()=>l(w),onMouseEnter:()=>{y(w),b(w)},onMouseLeave:()=>{y(null),b(null)},className:["ri-side-panel__row",j?"ri-side-panel__row--hovered":"",O?"ri-side-panel__row--selected":""].filter(Boolean).join(" "),children:[e("button",{type:"button",className:`ri-side-panel__label ri-side-panel__labelButton${j||O?" ri-side-panel__label--hovered":""}`,"aria-current":O?"true":void 0,onFocus:()=>{y(w),b(w)},onBlur:()=>{y(null),b(null)},children:G}),e("button",{type:"button",className:"ri-side-panel__vis-btn",title:t(A?"hide":"show"),"aria-label":t(A?"hideObject":"showObject",{name:G}),onClick:F=>{F.stopPropagation(),f(w)},children:e("span",{className:`ri-side-panel__checkbox${A?" ri-side-panel__checkbox--checked":""}`,children:A&&e(Xr,{size:9,strokeWidth:5,color:"white"})})})]},w)})})]})]})}function Jr(r){return e(dr,{labels:r.labels,children:e(et,{...r})})}function et({modelUrl:r,poster:o,loading:a,reveal:d,modelFormat:s,dracoDecoderPath:l,ktx2TranscoderPath:b,meshopt:f=!0,backgroundColor:t="#1a1a1a",showSceneObjectsPanel:i=!0,showSceneSettingsPanel:V=!0,enableModelUpload:h=!1,zoomOnSelected:y=!1,highlightOnHover:E=!1,showLoadingOverlay:w=!0,showLoadError:G=!0,refitOnResize:A=!0,cameraLimits:O,showResetButton:j=!0,backgroundEnabled:F=!1,autoRotate:L=!1,envPreset:z="city",environmentUrl:I,environmentEnabled:q=!0,exposure:ae=1,ambientIntensity:Z=.6,ambientColor:ie="#ffffff",directionalIntensity:p=1.2,directionalColor:u="#ffffff",envIntensity:_=1,envRotation:ee=0,backgroundBlur:U=0,toneMapping:x="aces",groundShadow:re=!1,groundShadowOpacity:N=.5,showFloorGrid:Oe=!1,wireframe:je=!1,autoRotateSpeed:Ie=1,fov:Be=45,onModelLoaded:Ae,onLoadError:se,labels:Yr,reducedMotion:Qr="user"}){let P=be(),le=Or(Qr),Fe=L&&!le;Ir("simple-model-viewer","SimpleModelViewer");let K=R(null),de=R(null),Ke=R({}),He=R(null),_e=R(null),ne=R(0),[C,ke]=g(null),[Ge,Ue]=g(null),[Zr,Me]=g(!1),[en,We]=g({}),[$e,Xe]=g(new Set),[qe,Je]=g(null),[rn,Ye]=g(null),[Qe,Ze]=g(null),[nn,er]=g(null),[rr,ce]=g(!1),[tn,Se]=g(null),[on,an]=g(0),[nr,tr]=g(!1),[pe,Ce]=g(!1),[sn,ue]=g(null),ln=Cr(sn),[dn,me]=g(!1),[cn,pn]=g(()=>typeof window>"u"?!0:window.innerWidth>900),[un,mn]=g(()=>typeof window>"u"?!0:window.innerWidth>900),ve=$(()=>({backgroundEnabled:F,backgroundColor:t,autoRotate:Fe,envPreset:z,exposure:ae,ambientIntensity:Z,ambientColor:ie,directionalIntensity:p,directionalColor:u,envIntensity:_,envRotation:ee,backgroundBlur:U,toneMapping:x,groundShadow:re,groundShadowOpacity:N,showFloorGrid:Oe,wireframe:je,autoRotateSpeed:Ie,fov:Be}),[F,t,Fe,z,ae,Z,ie,p,u,_,ee,U,x,re,N,Oe,je,Ie,Be]),[v,ge]=g(ve),S=h?Qe:r,or=R(null),Re=R(null),Le=R(null),[te,ar]=g(null);M(()=>()=>{te&&URL.revokeObjectURL(te)},[te]);let ir=R(S);ir.current=S;let Ne=R(null),H=_r({loading:a,reveal:d,rootRef:or,onPark:()=>{Ne.current=Re.current?.gl??null;let n=K.current;if(n&&pe){Le.current={position:n.getPosition(new D).toArray(),target:n.getTarget(new D).toArray()};let m=S;yr(Re.current).then(T=>{T&&(m===ir.current?ar(T):URL.revokeObjectURL(T))})}ke(null),Ce(!1)}});M(()=>{if(H.live)return;let n=Ne.current;Ne.current=null,n&&wr(n)},[H.live]);let W=k(()=>{Le.current=null,de.current=null,ar(null),ke(null),Ue(null),Me(!1),We({}),Xe(new Set),Je(null),Ye(null),ce(!1),Se(null),Ce(!1),ue(null)},[]),J=k(()=>{_e.current?.cleanup(),_e.current=null},[]),vn=k(()=>{J(),Ze(null),er(null),W(),ge(ve)},[ve,W,J]),sr=k(async n=>{tr(!0);try{let m=await ur(n);J(),_e.current=m,Ze(m.url),er(m.name),W()}catch(m){ce(!0),Se(m),se?.(m)}finally{tr(!1)}},[se,W,J]),Ee=k(n=>{let m=n?.[0];m&&sr(m)},[sr]);M(()=>()=>{J()},[J]);let gn=k(()=>C,[C]),bn=!(q&&v.backgroundEnabled)&&new On(v.backgroundColor).getHSL({h:0,s:0,l:0}).l>.5?"#000000":"#ffffff",fn=$(()=>C?Qn(C):null,[C]),Y=$(()=>{if(!C)return null;let n=new we().setFromObject(C);if(n.isEmpty())return null;let m=n.getSize(new D);return{y:n.min.y,center:n.getCenter(new D),size:Math.max(m.x,m.y,m.z)}},[C]),hn=k((n,m)=>{ge(T=>({...T,[n]:m}))},[]);M(()=>{ge(n=>({...n,backgroundColor:t}))},[t]),M(()=>{W()},[S,W]);let xn=k(n=>{We(n)},[]),wn=k(n=>{ke(n),ce(!1);let m=ze(n);Ue(m>mr?m:null),Me(!1),ue(null),Ae?.(Vr(n))},[Ae]),yn=k(n=>{ce(!0),Se(n),ue(null),se?.(n)},[se]),_n=k(n=>{n.lengthComputable&&n.total>0&&ue(n.loaded/n.total*100)},[]),lr=k(n=>{if(Je(n),!y)return;let m=Ke.current[n];!m||!K.current||K.current.fitToBox(m,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{})},[y]),kn=k(n=>{Xe(m=>{let T=new Set(m);return T.has(n)?T.delete(n):T.add(n),T})},[]),Mn=k(n=>{!h||!fe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),ne.current+=1,me(!0))},[h]),Sn=k(n=>{!h||!fe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),n.dataTransfer.dropEffect="copy",me(!0))},[h]),Cn=k(n=>{!h||!fe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),ne.current=Math.max(0,ne.current-1),ne.current===0&&me(!1))},[h]),Rn=k(n=>{!h||!fe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),ne.current=0,me(!1),Ee(n.dataTransfer.files))},[h,Ee]),Ln=w&&(nr||!!(S&&H.live&&!rr&&(!C||!pe)));return c("div",{className:"smv-root",ref:or,"data-reduced-motion":le?"":void 0,style:{background:v.backgroundColor},onDragEnter:Mn,onDragOver:Sn,onDragLeave:Cn,onDrop:Rn,children:[V&&S&&e(Yn,{isOpen:un,onToggle:mn,environmentUrl:I,environmentEnabled:q,settings:v,modelInfo:fn,onReset:()=>ge(ve),onChange:hn}),c("div",{className:"smv-canvasArea",children:[G&&rr&&S&&c("div",{className:"smv-load-error",role:"alert",children:[e("strong",{children:P("loadErrorTitle")}),e("p",{children:Sr(tn,S,s,Yr).detail}),e("button",{type:"button",onClick:()=>{cr(S),W(),an(n=>n+1)},children:P("retryModelLoad")})]}),j&&C&&pe&&e("button",{type:"button",className:"smv-reset-camera",onClick:()=>{let n=K.current,m=de.current;!n||!m||n.setLookAt(...m.position,...m.target,!1).then(()=>n.fitToBox(C,!le,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5})).catch(()=>{})},children:P("resetCameraView")}),Ge!==null&&!Zr&&c("div",{className:"smv-largeModelBanner",children:[e(Wn,{size:14,className:"smv-largeModelBanner__icon"}),e("span",{children:P("simpleLargeModelWarning",{millions:Math.round(Ge/1e6)})}),e("button",{type:"button",className:"smv-largeModelBanner__dismiss",onClick:()=>Me(!0),"aria-label":P("dismiss"),children:e(De,{size:12})})]}),h?c(Ur,{children:[e("input",{ref:He,type:"file",accept:pr,className:"smv-upload-input",onChange:n=>{Ee(n.target.files),n.currentTarget.value=""}}),S?e("div",{className:"smv-upload-toolbar",children:c(Ur,{children:[e("span",{className:"smv-upload-toolbar__name",children:nn??P("uploadedModel")}),c("button",{type:"button",className:"smv-upload-toolbar__button smv-upload-toolbar__button--ghost",onClick:vn,children:[e(Un,{size:14}),P("clear")]})]})}):null]}):null,S&&!H.live?e(Mr,{className:"ri-viewerPlaceholder--inset",background:v.backgroundColor,poster:te??o,onReveal:H.awaitingReveal?H.reveal:void 0}):S?c(Tn,{dpr:[1,2],frameloop:H.visible?"demand":"never",resize:{debounce:0,scroll:!1},raycaster:{firstHitOnly:!0},style:{background:v.backgroundColor},camera:{position:[0,0,5],fov:45,near:.1,far:1e3},children:[e(hr,{captureRef:Re}),e(xr,{}),c(Pe,{fallback:null,children:[e("ambientLight",{intensity:v.ambientIntensity,color:v.ambientColor}),e("directionalLight",{position:[-4,5,7],intensity:v.directionalIntensity,color:v.directionalColor,castShadow:!0}),e("directionalLight",{position:[-5,5,5],intensity:.5}),q&&e(ye,{children:e(Pe,{fallback:null,children:e(Pn,{...I?{files:I}:{preset:v.envPreset},background:v.backgroundEnabled,environmentIntensity:v.envIntensity,backgroundIntensity:v.envIntensity,backgroundBlurriness:v.backgroundBlur})})},I??v.envPreset),e(Lr,{rotation:v.envRotation}),e(qn,{scene:C,exposure:v.exposure,toneMapping:v.toneMapping,fov:v.fov,wireframe:v.wireframe}),e(Jn,{enabled:v.autoRotate,speed:v.autoRotateSpeed,controlsRef:K}),v.groundShadow&&Y&&e(Rr,{position:[Y.center.x,Y.y,Y.center.z],scale:Y.size*2,opacity:v.groundShadowOpacity,blur:2,far:Y.size,resolution:1024,color:"#000000"}),v.showFloorGrid&&e(fr,{getTarget:gn,revision:C,lineColor:bn}),e(ye,{onLoadError:yn,children:e(Pe,{fallback:null,children:e($n,{url:S,format:Qe?void 0:s,dracoDecoderPath:l,ktx2TranscoderPath:b,meshopt:f,hiddenKeys:$e,selectedKey:qe,panelHoveredKey:rn,nodeRefsOut:Ke,onMeshesReady:xn,onModelLoaded:wn,onLoadProgress:_n,onMeshClick:lr,highlightOnHover:E})})},`${S}:${on}`),e(Xn,{scene:C,controlsRef:K,refitOnResize:A,onInitialFitComplete:()=>{let n=K.current;n&&!de.current&&(de.current={position:n.getPosition(new D).toArray(),target:n.getTarget(new D).toArray()}),Ce(!0)},cameraLimits:O,resumeViewRef:Le}),e(zn,{ref:K,makeDefault:!0,smoothTime:le?0:.3})]})]}):e("div",{className:"smv-upload-empty-state",style:{background:v.backgroundColor},children:c("div",{className:"smv-upload-empty-state__card",children:[e("div",{className:"smv-upload-empty-state__icon",children:e(Te,{size:24})}),e("p",{className:"smv-upload-empty-state__body",children:P("dropModelHint",{formats:".glb, .gltf, .obj, .fbx, .usdz, .stl, .ply, .zip"})}),c("button",{type:"button",className:"smv-upload-empty-state__button",onClick:()=>He.current?.click(),children:[e(Te,{size:15}),P("chooseModel")]})]})}),S&&H.live?e(kr,{src:te??o,hidden:!!(C&&pe)}):null,e(jr,{visible:Ln,message:P("loadingModel"),progress:nr?void 0:ln??void 0}),h&&dn?e("div",{className:"smv-upload-drop-overlay",children:c("div",{className:"smv-upload-drop-overlay__card",children:[e(Te,{size:20}),e("span",{children:P("releaseToLoadYourModel")})]})}):null]}),i&&S&&e(Zn,{meshKeys:en,hiddenKeys:$e,selectedKey:qe,isOpen:cn,onToggle:pn,onFocus:lr,onHover:Ye,onToggleVisibility:kn})]})}export{Nn as DEFAULT_MODEL_VIEWER_LABELS,Jr as SimpleModelViewer};
package/dist/utils.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { bl as SceneLight, ao as ObjectBinding, aD as ObjectBindingType, a9 as MeasurementUnit, a6 as MeasurementSettings, b4 as SavedMeasurement, a3 as MeasurementPoint, a5 as MeasurementResult, a8 as MeasurementTool, a2 as MeasurementCollection, ay as ObjectBindingStyle, az as ObjectBindingTarget, bs as SceneProductConfig, aS as ProductDefinition, b0 as ProductSelections, aQ as ProductConfiguration, b1 as ProductSku, aT as ProductDefinitionWarning, aK as ProductAvailability, aZ as ProductOptionState, a_ as ProductPrice, V as InspectAssetOptions, q as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, bR as ShareableViewerState, c7 as ViewerStateStorage, bJ as SequenceEasing, bz as SceneSequence, bO as SequenceTrack, bP as SequenceValue, bK as SequenceKeyframe, bu as SceneSectionConfig, bx as SceneSectionSettings } from './modelViewerProps-CGgtm4Zb.mjs';
2
- export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, l as AnimationLoopMode, p as AssetDiagnosticIssue, r as AssetDiagnosticsSource, s as AssetTextureDiagnostic, t as AssetTransform, B as BindingEdit, E as ComparisonCategory, F as ComparisonChange, G as ComparisonHighlight, H as ComparisonObject, I as ComparisonStatus, J as ConfigurationComparisonInput, K as ConfigurationComparisonReport, N as DEFAULT_SCENE_CONFIG, O as DEFAULT_SECTION_CONFIG, Q as DeepPartial, R as EnvironmentPreset, S as GlitchModeName, W as IsolatedObjectBindings, Y as KernelSizeName, Z as MATERIAL_BLENDING_MODES, _ as MATERIAL_SIDES, $ as MAX_VIEWER_STATE_BYTES, a1 as MeasurementAnchor, a4 as MeasurementPosition, a7 as MeasurementStatus, an as ObjectActionEvent, ap as ObjectBindingAction, aq as ObjectBindingCameraState, ar as ObjectBindingDecal, as as ObjectBindingMaterial, at as ObjectBindingMaterialBlendingMode, au as ObjectBindingMaterialSide, av as ObjectBindingPatch, aw as ObjectBindingSelector, ax as ObjectBindingStatus, aA as ObjectBindingTextureChannel, aB as ObjectBindingTextureSlot, aC as ObjectBindingTransform, aF as ObjectPointerEvent, aG as ObjectSurfacePoint, aJ as ProductAppearance, aL as ProductCheckoutContext, aM as ProductCheckoutLink, aN as ProductCommerceAdapter, aO as ProductCommerceContext, aP as ProductCommerceResult, aR as ProductConfigurationIssue, aU as ProductGroupDisplay, aV as ProductOption, aW as ProductOptionGroup, aX as ProductOptionRef, aY as ProductOptionRule, a$ as ProductPricing, b2 as RampTypeName, b3 as RendererBackend, b5 as SceneAnimationClipConfig, b6 as SceneAnimationConfig, b7 as SceneAnnotationCameraView, b8 as SceneAnnotationImage, b9 as SceneAnnotationLink, ba as SceneAnnotationMarker, bb as SceneBackgroundConfig, bc as SceneCameraConfig, bd as SceneCinematicConfig, be as SceneCinematicWaypoint, bg as SceneConfig, bi as SceneConfigPatch, bj as SceneEnvironmentConfig, bk as SceneGroundShadowConfig, bm as SceneLightAttachment, bn as SceneLightType, bo as SceneLightingConfig, bp as SceneModelConfig, bq as SceneModelRenderer, br as ScenePostProcessingConfig, bt as SceneSectionAxis, by as SceneSelectionSet, bA as SceneShadowConfig, bB as SceneStyleColorScale, bC as SceneStyleCondition, bD as SceneStylePulse, bE as SceneStyleRule, bF as SceneWireframeConfig, bG as SemanticComparisonOptions, bH as SequenceCameraView, bI as SequenceControls, bL as SequenceObjectProperty, bM as SequencePlaybackState, bN as SequenceTarget, bQ as SequenceVector3, bS as StreamingDiagnostics, bT as StyledObjectBindings, bU as StyledObjectPulse, c0 as ViewerConfiguration, c2 as ViewerIsolation, c3 as ViewerObjectInfo, c6 as ViewerRuntimeStats, ca as applyIsolation, cb as applyStyleRules, cc as colorScaleValue, cd as compareViewerConfigurations, ce as groundAsset, cf as isolatedBindingKeys, cg as material, ch as parseAssetTransform, ci as parseSelectionSets, cj as parseViewerState, ck as patchBindings, cl as patchSceneConfig, cm as prepareViewerState, cn as selectBindingKeys, co as selectBindings, cp as serializeViewerState, cq as snapAssetToGrid } from './modelViewerProps-CGgtm4Zb.mjs';
3
- import { M as MaterialVariantGroup } from './modelFileResolver-pPzMl63D.mjs';
4
- export { D as DEFAULT_MODEL_VIEWER_LABELS, a as MaterialVariantOption, c as ModelViewerLabelKey, d as ModelViewerLabels, R as ReducedMotionSetting, h as chooseMaterialVariant } from './modelFileResolver-pPzMl63D.mjs';
1
+ import { bm as SceneLight, ap as ObjectBinding, aE as ObjectBindingType, aa as MeasurementUnit, a7 as MeasurementSettings, b5 as SavedMeasurement, a4 as MeasurementPoint, a6 as MeasurementResult, a9 as MeasurementTool, a3 as MeasurementCollection, az as ObjectBindingStyle, aA as ObjectBindingTarget, bt as SceneProductConfig, aT as ProductDefinition, b1 as ProductSelections, aR as ProductConfiguration, b2 as ProductSku, aU as ProductDefinitionWarning, aL as ProductAvailability, a_ as ProductOptionState, a$ as ProductPrice, U as InspectAssetOptions, q as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, bS as ShareableViewerState, c8 as ViewerStateStorage, bK as SequenceEasing, bA as SceneSequence, bP as SequenceTrack, bQ as SequenceValue, bL as SequenceKeyframe, bv as SceneSectionConfig, by as SceneSectionSettings } from './modelViewerProps-HazR2IE_.mjs';
2
+ export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, l as AnimationLoopMode, p as AssetDiagnosticIssue, r as AssetDiagnosticsSource, s as AssetTextureDiagnostic, t as AssetTransform, B as BindingEdit, D as ComparisonCategory, E as ComparisonChange, F as ComparisonHighlight, G as ComparisonObject, H as ComparisonStatus, I as ConfigurationComparisonInput, J as ConfigurationComparisonReport, M as DEFAULT_SCENE_CONFIG, N as DEFAULT_SECTION_CONFIG, P as DeepPartial, Q as EnvironmentPreset, R as GlitchModeName, V as IsolatedObjectBindings, X as KernelSizeName, _ as MATERIAL_BLENDING_MODES, $ as MATERIAL_SIDES, a0 as MAX_VIEWER_STATE_BYTES, a2 as MeasurementAnchor, a5 as MeasurementPosition, a8 as MeasurementStatus, ao as ObjectActionEvent, aq as ObjectBindingAction, ar as ObjectBindingCameraState, as as ObjectBindingDecal, at as ObjectBindingMaterial, au as ObjectBindingMaterialBlendingMode, av as ObjectBindingMaterialSide, aw as ObjectBindingPatch, ax as ObjectBindingSelector, ay as ObjectBindingStatus, aB as ObjectBindingTextureChannel, aC as ObjectBindingTextureSlot, aD as ObjectBindingTransform, aG as ObjectPointerEvent, aH as ObjectSurfacePoint, aK as ProductAppearance, aM as ProductCheckoutContext, aN as ProductCheckoutLink, aO as ProductCommerceAdapter, aP as ProductCommerceContext, aQ as ProductCommerceResult, aS as ProductConfigurationIssue, aV as ProductGroupDisplay, aW as ProductOption, aX as ProductOptionGroup, aY as ProductOptionRef, aZ as ProductOptionRule, b0 as ProductPricing, b3 as RampTypeName, b4 as RendererBackend, b6 as SceneAnimationClipConfig, b7 as SceneAnimationConfig, b8 as SceneAnnotationCameraView, b9 as SceneAnnotationImage, ba as SceneAnnotationLink, bb as SceneAnnotationMarker, bc as SceneBackgroundConfig, bd as SceneCameraConfig, be as SceneCinematicConfig, bf as SceneCinematicWaypoint, bh as SceneConfig, bj as SceneConfigPatch, bk as SceneEnvironmentConfig, bl as SceneGroundShadowConfig, bn as SceneLightAttachment, bo as SceneLightType, bp as SceneLightingConfig, bq as SceneModelConfig, br as SceneModelRenderer, bs as ScenePostProcessingConfig, bu as SceneSectionAxis, bz as SceneSelectionSet, bB as SceneShadowConfig, bC as SceneStyleColorScale, bD as SceneStyleCondition, bE as SceneStylePulse, bF as SceneStyleRule, bG as SceneWireframeConfig, bH as SemanticComparisonOptions, bI as SequenceCameraView, bJ as SequenceControls, bM as SequenceObjectProperty, bN as SequencePlaybackState, bO as SequenceTarget, bR as SequenceVector3, bT as StreamingDiagnostics, bU as StyledObjectBindings, bV as StyledObjectPulse, c1 as ViewerConfiguration, c3 as ViewerIsolation, c4 as ViewerObjectInfo, c7 as ViewerRuntimeStats, cb as applyIsolation, cc as applyStyleRules, cd as colorScaleValue, ce as compareViewerConfigurations, cf as groundAsset, cg as isolatedBindingKeys, ch as material, ci as parseAssetTransform, cj as parseSelectionSets, ck as parseViewerState, cl as patchBindings, cm as patchSceneConfig, cn as prepareViewerState, co as selectBindingKeys, cp as selectBindings, cq as serializeViewerState, cr as snapAssetToGrid } from './modelViewerProps-HazR2IE_.mjs';
3
+ import { M as MaterialVariantGroup } from './modelFileResolver-ChKYsF21.mjs';
4
+ export { D as DEFAULT_MODEL_VIEWER_LABELS, a as MaterialVariantOption, c as ModelViewerLabelKey, d as ModelViewerLabels, R as ReducedMotionSetting, h as chooseMaterialVariant } from './modelFileResolver-ChKYsF21.mjs';
5
5
  import { Object3D } from 'three';
6
6
  import 'react';
7
7
  import '@react-three/drei';
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { bl as SceneLight, ao as ObjectBinding, aD as ObjectBindingType, a9 as MeasurementUnit, a6 as MeasurementSettings, b4 as SavedMeasurement, a3 as MeasurementPoint, a5 as MeasurementResult, a8 as MeasurementTool, a2 as MeasurementCollection, ay as ObjectBindingStyle, az as ObjectBindingTarget, bs as SceneProductConfig, aS as ProductDefinition, b0 as ProductSelections, aQ as ProductConfiguration, b1 as ProductSku, aT as ProductDefinitionWarning, aK as ProductAvailability, aZ as ProductOptionState, a_ as ProductPrice, V as InspectAssetOptions, q as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, bR as ShareableViewerState, c7 as ViewerStateStorage, bJ as SequenceEasing, bz as SceneSequence, bO as SequenceTrack, bP as SequenceValue, bK as SequenceKeyframe, bu as SceneSectionConfig, bx as SceneSectionSettings } from './modelViewerProps-07WgBVqm.js';
2
- export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, l as AnimationLoopMode, p as AssetDiagnosticIssue, r as AssetDiagnosticsSource, s as AssetTextureDiagnostic, t as AssetTransform, B as BindingEdit, E as ComparisonCategory, F as ComparisonChange, G as ComparisonHighlight, H as ComparisonObject, I as ComparisonStatus, J as ConfigurationComparisonInput, K as ConfigurationComparisonReport, N as DEFAULT_SCENE_CONFIG, O as DEFAULT_SECTION_CONFIG, Q as DeepPartial, R as EnvironmentPreset, S as GlitchModeName, W as IsolatedObjectBindings, Y as KernelSizeName, Z as MATERIAL_BLENDING_MODES, _ as MATERIAL_SIDES, $ as MAX_VIEWER_STATE_BYTES, a1 as MeasurementAnchor, a4 as MeasurementPosition, a7 as MeasurementStatus, an as ObjectActionEvent, ap as ObjectBindingAction, aq as ObjectBindingCameraState, ar as ObjectBindingDecal, as as ObjectBindingMaterial, at as ObjectBindingMaterialBlendingMode, au as ObjectBindingMaterialSide, av as ObjectBindingPatch, aw as ObjectBindingSelector, ax as ObjectBindingStatus, aA as ObjectBindingTextureChannel, aB as ObjectBindingTextureSlot, aC as ObjectBindingTransform, aF as ObjectPointerEvent, aG as ObjectSurfacePoint, aJ as ProductAppearance, aL as ProductCheckoutContext, aM as ProductCheckoutLink, aN as ProductCommerceAdapter, aO as ProductCommerceContext, aP as ProductCommerceResult, aR as ProductConfigurationIssue, aU as ProductGroupDisplay, aV as ProductOption, aW as ProductOptionGroup, aX as ProductOptionRef, aY as ProductOptionRule, a$ as ProductPricing, b2 as RampTypeName, b3 as RendererBackend, b5 as SceneAnimationClipConfig, b6 as SceneAnimationConfig, b7 as SceneAnnotationCameraView, b8 as SceneAnnotationImage, b9 as SceneAnnotationLink, ba as SceneAnnotationMarker, bb as SceneBackgroundConfig, bc as SceneCameraConfig, bd as SceneCinematicConfig, be as SceneCinematicWaypoint, bg as SceneConfig, bi as SceneConfigPatch, bj as SceneEnvironmentConfig, bk as SceneGroundShadowConfig, bm as SceneLightAttachment, bn as SceneLightType, bo as SceneLightingConfig, bp as SceneModelConfig, bq as SceneModelRenderer, br as ScenePostProcessingConfig, bt as SceneSectionAxis, by as SceneSelectionSet, bA as SceneShadowConfig, bB as SceneStyleColorScale, bC as SceneStyleCondition, bD as SceneStylePulse, bE as SceneStyleRule, bF as SceneWireframeConfig, bG as SemanticComparisonOptions, bH as SequenceCameraView, bI as SequenceControls, bL as SequenceObjectProperty, bM as SequencePlaybackState, bN as SequenceTarget, bQ as SequenceVector3, bS as StreamingDiagnostics, bT as StyledObjectBindings, bU as StyledObjectPulse, c0 as ViewerConfiguration, c2 as ViewerIsolation, c3 as ViewerObjectInfo, c6 as ViewerRuntimeStats, ca as applyIsolation, cb as applyStyleRules, cc as colorScaleValue, cd as compareViewerConfigurations, ce as groundAsset, cf as isolatedBindingKeys, cg as material, ch as parseAssetTransform, ci as parseSelectionSets, cj as parseViewerState, ck as patchBindings, cl as patchSceneConfig, cm as prepareViewerState, cn as selectBindingKeys, co as selectBindings, cp as serializeViewerState, cq as snapAssetToGrid } from './modelViewerProps-07WgBVqm.js';
3
- import { M as MaterialVariantGroup } from './modelFileResolver-pPzMl63D.js';
4
- export { D as DEFAULT_MODEL_VIEWER_LABELS, a as MaterialVariantOption, c as ModelViewerLabelKey, d as ModelViewerLabels, R as ReducedMotionSetting, h as chooseMaterialVariant } from './modelFileResolver-pPzMl63D.js';
1
+ import { bm as SceneLight, ap as ObjectBinding, aE as ObjectBindingType, aa as MeasurementUnit, a7 as MeasurementSettings, b5 as SavedMeasurement, a4 as MeasurementPoint, a6 as MeasurementResult, a9 as MeasurementTool, a3 as MeasurementCollection, az as ObjectBindingStyle, aA as ObjectBindingTarget, bt as SceneProductConfig, aT as ProductDefinition, b1 as ProductSelections, aR as ProductConfiguration, b2 as ProductSku, aU as ProductDefinitionWarning, aL as ProductAvailability, a_ as ProductOptionState, a$ as ProductPrice, U as InspectAssetOptions, q as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, bS as ShareableViewerState, c8 as ViewerStateStorage, bK as SequenceEasing, bA as SceneSequence, bP as SequenceTrack, bQ as SequenceValue, bL as SequenceKeyframe, bv as SceneSectionConfig, by as SceneSectionSettings } from './modelViewerProps-Ch6pIZIE.js';
2
+ export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, l as AnimationLoopMode, p as AssetDiagnosticIssue, r as AssetDiagnosticsSource, s as AssetTextureDiagnostic, t as AssetTransform, B as BindingEdit, D as ComparisonCategory, E as ComparisonChange, F as ComparisonHighlight, G as ComparisonObject, H as ComparisonStatus, I as ConfigurationComparisonInput, J as ConfigurationComparisonReport, M as DEFAULT_SCENE_CONFIG, N as DEFAULT_SECTION_CONFIG, P as DeepPartial, Q as EnvironmentPreset, R as GlitchModeName, V as IsolatedObjectBindings, X as KernelSizeName, _ as MATERIAL_BLENDING_MODES, $ as MATERIAL_SIDES, a0 as MAX_VIEWER_STATE_BYTES, a2 as MeasurementAnchor, a5 as MeasurementPosition, a8 as MeasurementStatus, ao as ObjectActionEvent, aq as ObjectBindingAction, ar as ObjectBindingCameraState, as as ObjectBindingDecal, at as ObjectBindingMaterial, au as ObjectBindingMaterialBlendingMode, av as ObjectBindingMaterialSide, aw as ObjectBindingPatch, ax as ObjectBindingSelector, ay as ObjectBindingStatus, aB as ObjectBindingTextureChannel, aC as ObjectBindingTextureSlot, aD as ObjectBindingTransform, aG as ObjectPointerEvent, aH as ObjectSurfacePoint, aK as ProductAppearance, aM as ProductCheckoutContext, aN as ProductCheckoutLink, aO as ProductCommerceAdapter, aP as ProductCommerceContext, aQ as ProductCommerceResult, aS as ProductConfigurationIssue, aV as ProductGroupDisplay, aW as ProductOption, aX as ProductOptionGroup, aY as ProductOptionRef, aZ as ProductOptionRule, b0 as ProductPricing, b3 as RampTypeName, b4 as RendererBackend, b6 as SceneAnimationClipConfig, b7 as SceneAnimationConfig, b8 as SceneAnnotationCameraView, b9 as SceneAnnotationImage, ba as SceneAnnotationLink, bb as SceneAnnotationMarker, bc as SceneBackgroundConfig, bd as SceneCameraConfig, be as SceneCinematicConfig, bf as SceneCinematicWaypoint, bh as SceneConfig, bj as SceneConfigPatch, bk as SceneEnvironmentConfig, bl as SceneGroundShadowConfig, bn as SceneLightAttachment, bo as SceneLightType, bp as SceneLightingConfig, bq as SceneModelConfig, br as SceneModelRenderer, bs as ScenePostProcessingConfig, bu as SceneSectionAxis, bz as SceneSelectionSet, bB as SceneShadowConfig, bC as SceneStyleColorScale, bD as SceneStyleCondition, bE as SceneStylePulse, bF as SceneStyleRule, bG as SceneWireframeConfig, bH as SemanticComparisonOptions, bI as SequenceCameraView, bJ as SequenceControls, bM as SequenceObjectProperty, bN as SequencePlaybackState, bO as SequenceTarget, bR as SequenceVector3, bT as StreamingDiagnostics, bU as StyledObjectBindings, bV as StyledObjectPulse, c1 as ViewerConfiguration, c3 as ViewerIsolation, c4 as ViewerObjectInfo, c7 as ViewerRuntimeStats, cb as applyIsolation, cc as applyStyleRules, cd as colorScaleValue, ce as compareViewerConfigurations, cf as groundAsset, cg as isolatedBindingKeys, ch as material, ci as parseAssetTransform, cj as parseSelectionSets, ck as parseViewerState, cl as patchBindings, cm as patchSceneConfig, cn as prepareViewerState, co as selectBindingKeys, cp as selectBindings, cq as serializeViewerState, cr as snapAssetToGrid } from './modelViewerProps-Ch6pIZIE.js';
3
+ import { M as MaterialVariantGroup } from './modelFileResolver-ChKYsF21.js';
4
+ export { D as DEFAULT_MODEL_VIEWER_LABELS, a as MaterialVariantOption, c as ModelViewerLabelKey, d as ModelViewerLabels, R as ReducedMotionSetting, h as chooseMaterialVariant } from './modelFileResolver-ChKYsF21.js';
5
5
  import { Object3D } from 'three';
6
6
  import 'react';
7
7
  import '@react-three/drei';