@liveroom-tech/react-immersive 5.2.0 → 5.3.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/LICENSE +10 -6
  2. package/README.md +106 -3856
  3. package/dist/binding-builder.css +1 -1
  4. package/dist/binding-builder.js +64 -17
  5. package/dist/binding-builder.mjs +1 -1
  6. package/dist/chunk-4FDMYUGT.mjs +3 -0
  7. package/dist/chunk-CV4E7DOO.mjs +79 -0
  8. package/dist/chunk-F4WT3HEK.mjs +1 -0
  9. package/dist/chunk-FPJZDEON.mjs +1 -0
  10. package/dist/chunk-JHKMRMJH.mjs +1 -0
  11. package/dist/chunk-TW2M4UXT.mjs +1 -0
  12. package/dist/chunk-W24UP6NM.mjs +1 -0
  13. package/dist/hosted.css +1 -1
  14. package/dist/hosted.d.mts +8 -6
  15. package/dist/hosted.d.ts +8 -6
  16. package/dist/hosted.js +63 -16
  17. package/dist/hosted.mjs +1 -1
  18. package/dist/index.css +1 -1
  19. package/dist/index.d.mts +18 -10
  20. package/dist/index.d.ts +18 -10
  21. package/dist/index.js +62 -15
  22. package/dist/index.mjs +1 -1
  23. package/dist/{materialVariants-DnZe9eMC.d.mts → materialVariants-DjTuiWmN.d.mts} +6 -1
  24. package/dist/{materialVariants-DnZe9eMC.d.ts → materialVariants-DjTuiWmN.d.ts} +6 -1
  25. package/dist/{modelInfo-XfUQO7C_.d.ts → modelInfo-BQ5UZu95.d.ts} +1 -1
  26. package/dist/{modelInfo-BYebMPdZ.d.mts → modelInfo-CcYpydB7.d.mts} +1 -1
  27. package/dist/{modelViewerProps-CIZ2R_Fv.d.ts → modelViewerProps-BalkRDni.d.ts} +54 -5
  28. package/dist/{modelViewerProps-DoRiTZMn.d.mts → modelViewerProps-DdsJDRB7.d.mts} +54 -5
  29. package/dist/{rendererBackend-QwMzISTn.d.mts → rendererBackend-C_Jb4_Jy.d.mts} +15 -1
  30. package/dist/{rendererBackend-QwMzISTn.d.ts → rendererBackend-C_Jb4_Jy.d.ts} +15 -1
  31. package/dist/simple-model-viewer.d.mts +4 -4
  32. package/dist/simple-model-viewer.d.ts +4 -4
  33. package/dist/simple-model-viewer.js +3 -3
  34. package/dist/simple-model-viewer.mjs +1 -1
  35. package/dist/utils.d.mts +3 -3
  36. package/dist/utils.d.ts +3 -3
  37. package/dist/utils.js +1 -1
  38. package/dist/utils.mjs +1 -1
  39. package/package.json +2 -1
  40. package/dist/chunk-4NLJSD3S.mjs +0 -1
  41. package/dist/chunk-B7REIGDG.mjs +0 -1
  42. package/dist/chunk-HYFJ5DYJ.mjs +0 -1
  43. package/dist/chunk-QC3NT76G.mjs +0 -3
  44. package/dist/chunk-SEESCGUS.mjs +0 -1
  45. package/dist/chunk-T3M3BQ7H.mjs +0 -32
  46. package/dist/chunk-ZPK67UG7.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{A as ne,b as J,c as q,e as Q,f as ee,q as x,y as te,z as re}from"./chunk-JHKMRMJH.mjs";import{createContext as tt,useContext as rt,useMemo as nt}from"react";import{jsx as st}from"react/jsx-runtime";var se=tt(void 0);function Hr({labels:e,children:t}){return st(se.Provider,{value:e,children:t})}function oe(){let e=rt(se);return nt(()=>Object.assign((t,r)=>J(e,t,r),{message:t=>q(e,t)}),[e])}import{Box3 as ot,BufferAttribute as at,Mesh as it}from"three";import{acceleratedRaycast as ut,computeBoundsTree as lt,disposeBoundsTree as ct,MeshBVH as pt}from"three-mesh-bvh";var ae=!1,h=new WeakMap,M=new WeakMap;function dt(){ae||(it.prototype.raycast=ut,ae=!0)}function ft(e){let t=new Set;return e.traverse(r=>{let n=r.geometry;!n||!n.attributes?.position||t.add(n)}),[...t]}function ie(e){let t=0;for(let r of e){let n=r.index?r.index.count:r.attributes.position.count;t+=n/3}return t}var ue=12e6;function Jr(e){return mt(e)>ue}function mt(e){let t=new Set;return e.traverse(r=>{let n=r.geometry;n?.attributes?.position&&t.add(n)}),ie([...t])}function bt(e,t){return new Promise((r,n)=>{let s=l=>{let c=l.data;if(!c||!c.error&&!c.serialized)return;if(e.removeEventListener("message",s),e.removeEventListener("error",o),c.error){n(new Error(String(c.error)));return}let{serialized:p}=c,d=pt.deserialize(p,t,{setIndex:!1});p.index&&(t.index?t.index.array=p.index:t.setIndex(new at(p.index,1,!1))),t.boundingBox=d.getBoundingBox(new ot),r(d)},o=l=>{e.removeEventListener("message",s),e.removeEventListener("error",o),n(new Error(l.message||"BVH worker error"))};e.addEventListener("message",s),e.addEventListener("error",o);let a=t.index?t.index.array.slice():null,u=t.attributes.position.array.slice(),i=[u,...a?[a]:[]].map(l=>l.buffer);e.postMessage({index:a,position:u,options:{groups:[...t.groups]}},i)})}async function ht(){if(typeof window>"u"||typeof Worker>"u")return null;try{let{bvhWorkerCode:e}=await import("./bvhWorkerCode-6366A3UC.mjs"),t=new Blob([e],{type:"text/javascript"}),r=URL.createObjectURL(t),n=new Worker(r);return{worker:n,dispose:()=>{n.terminate(),URL.revokeObjectURL(r)}}}catch{return null}}async function vt(e,t){if(t)try{return await bt(t,e)}catch{}let r=lt.call(e);return e.boundsTree=void 0,await new Promise(n=>setTimeout(n,0)),r}async function gt(e,t,r){if(e.boundsTree)return;if(t.buildPromise)return t.buildPromise;let n=(async()=>{let s=await r();t.references>0&&!e.boundsTree&&(e.boundsTree=s,t.ownedTree=s)})();return t.buildPromise=n.finally(()=>{t.buildPromise=void 0,t.references===0&&h.delete(e)}),t.buildPromise}async function qr(e,t){if(t?.aborted)return;let r=M.get(e);if(!r){if(r=ft(e),ie(r)>ue){M.set(e,[]);return}M.set(e,r);for(let s of r){let o=h.get(s)??{references:0};o.references+=1,h.set(s,o)}}if(r.length===0)return;dt();let n=await ht();if(t?.aborted){n?.dispose();return}try{for(let s of r){if(t?.aborted)return;let o=h.get(s);o&&await gt(s,o,()=>vt(s,n?.worker))}}finally{n?.dispose()}}function Qr(e){let t=M.get(e);if(t){M.delete(e);for(let r of t){let n=h.get(r);n&&(n.references=Math.max(0,n.references-1),!(n.references>0)&&(n.ownedTree&&r.boundsTree===n.ownedTree&&(ct.call(r),r.boundsTree=void 0),n.ownedTree=void 0,n.buildPromise||h.delete(r)))}}}import{useThree as E}from"@react-three/fiber";import{useEffect as pe}from"react";import{useEffect as Mt,useState as yt}from"react";function S(e){return!!e?.isWebGPURenderer}var le;function wt(){return le??(le=(async()=>{let e=typeof navigator>"u"?void 0:navigator.gpu;if(!e)return!1;try{return!!await e.requestAdapter()}catch{return!1}})()),le}var ce=!1;function rn(e){let[t,r]=yt(null);return Mt(()=>{if(!e)return;let n=!1;return wt().then(s=>{n||(!s&&!ce&&(ce=!0,console.info("[react-immersive] WebGPU isn't available in this browser; using WebGL.")),r(s))}),()=>{n=!0}},[e]),e?t===null?null:t?"webgpu":"webgl":"webgl"}async function nn(e){let{WebGPURenderer:t}=await import("three/webgpu"),r=new t({canvas:e.canvas,antialias:e.antialias??!0,alpha:e.alpha??!0});return await r.init(),r}function ln({captureRef:e}){let{gl:t,scene:r,camera:n,invalidate:s,get:o}=E();return pe(()=>{if(!e)return;let a=()=>{let u=o();u.advance(u.frameloop==="never"?u.clock.elapsedTime:performance.now())};return e.current={gl:t,scene:r,camera:n,invalidate:s,drawNow:a},()=>{e.current=null}},[e,t,r,n,s,o]),null}function cn(){let e=E(r=>r.frameloop),t=E(r=>r.invalidate);return pe(()=>{e!=="never"&&t()},[e,t]),null}function pn(e){e.dispose(),"forceContextLoss"in e&&!S(e)&&(e.forceContextLoss(),e.forceContextLoss=()=>{})}function dn(e){if(!e)return Promise.resolve(null);try{e.drawNow();let t=e.gl.domElement;return new Promise(r=>{t.toBlob(n=>r(n?URL.createObjectURL(n):null),"image/webp",.85)})}catch{return Promise.resolve(null)}}import{useEffect as Et,useState as Tt}from"react";import{useEffect as xt,useState as de}from"react";var St="200px",fe=new Map;function me(e,t,r){let n=fe.get(t);if(!n){let a=new Map;n={observer:new IntersectionObserver(i=>{for(let l of i)a.get(l.target)?.(l.isIntersecting)},{rootMargin:t}),watchers:a},fe.set(t,n)}let{observer:s,watchers:o}=n;return o.set(e,r),s.observe(e),()=>{o.delete(e),s.unobserve(e)}}function be(e){let t=typeof IntersectionObserver<"u",[r,n]=de(!t),[s,o]=de(!t);return xt(()=>{let a=e.current;if(!a||!t)return;let u=me(a,St,n),i=me(a,"0px",o);return()=>{u(),i()}},[e,t]),{near:r,visible:s}}import{useEffect as he,useRef as ve,useState as Rt}from"react";function T(){return typeof navigator>"u"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Lt(){if(typeof navigator>"u")return!1;let e=navigator.userAgent;return/iPhone|iPad|iPod/i.test(e)?!0:navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1}function hn(){return T()||Lt()}function Pt(){if(typeof window>"u"||typeof navigator>"u")return!1;let e=a=>typeof window.matchMedia=="function"&&window.matchMedia(a).matches,t=e("(pointer: coarse)")||e("(any-pointer: coarse)"),r=e("(hover: none)")||e("(any-hover: none)"),n=navigator.maxTouchPoints>0,s=typeof window.screen<"u"&&Math.min(window.screen.width,window.screen.height)<=1024,o=T();return t||o||n&&r||n&&s}function O(){if(!Pt())return!1;if(T())return!0;let e=navigator.deviceMemory;return!(typeof e=="number"&&e>=8)}function vn(e="auto"){switch(e){case"high":return!1;case"low":return!0;default:return O()}}function kt(e,t){let r=new Set,n=s=>{for(let o of s){if(r.size>=t)return;r.add(o.id)}};return n(e.filter(s=>s.wanted).sort((s,o)=>Number(o.visible)-Number(s.visible)||Number(o.live)-Number(s.live)||s.since-o.since)),n(e.filter(s=>!s.wanted&&s.live).sort((s,o)=>o.since-s.since)),r}var Bt=12,Dt=6,L=new Map,At=1,z=!1,ge;function Me(){z||(z=!0,queueMicrotask(()=>{z=!1,ge??(ge=O()?Dt:Bt);let e=kt([...L.values()],ge);for(let t of L.values()){let r=e.has(t.id);r!==t.live&&(t.live=r,t.onLiveChange(r))}}))}function ye({managed:e,wanted:t,visible:r,onPark:n}){let[s,o]=Rt(!1),a=ve(n);a.current=n;let u=ve(null);return he(()=>{if(!e)return;let i={id:At++,wanted:!1,visible:!1,live:!1,since:performance.now(),onLiveChange:l=>{l||a.current?.(),o(l)}};return L.set(i.id,i),u.current=i,()=>{L.delete(i.id),u.current=null,o(!1),Me()}},[e]),he(()=>{let i=u.current;!i||i.wanted===t&&i.visible===r||(i.wanted!==t&&(i.since=performance.now()),i.wanted=t,i.visible=r,Me())},[e,t,r]),e?s:t}function Pn({loading:e="lazy",reveal:t="auto",rootRef:r,onPark:n}){let{near:s,visible:o}=be(r),[a,u]=Tt(t==="auto");return Et(()=>{t==="auto"&&u(!0)},[t]),{live:ye({managed:e==="lazy",wanted:a&&(e==="eager"||s),visible:o,onPark:n}),visible:o,awaitingReveal:!a,reveal:()=>u(!0)}}import{Box as Ot}from"lucide-react";import{jsx as C,jsxs as we}from"react/jsx-runtime";function zt({src:e,hidden:t=!1}){return e?C("img",{className:`ri-poster${t?" ri-poster--hidden":""}`,src:e,alt:"","aria-hidden":"true",draggable:!1,decoding:"async"}):null}function Tn({className:e,background:t,poster:r,onReveal:n}){let s=oe();return we("div",{className:`${e} ri-viewerPlaceholder`,style:{background:t},children:[C(zt,{src:r}),n?we("button",{type:"button",className:"ri-revealButton",onClick:n,children:[C(Ot,{size:16,"aria-hidden":"true"}),s("viewIn3D")]}):null]})}import{strFromU8 as Ct,strToU8 as Ut,unzip as It}from"fflate";var xe;function Se(e){xe=e}function y(e){xe?.(e)}var Gt=[".glb",".gltf",".obj",".fbx",".usdz",".stl",".ply",".zip"],Ft=["model/gltf-binary","model/gltf+json","model/vnd.usdz+zip","application/vnd.usdz+zip","application/zip","application/x-zip-compressed"],w=1024*1024,Le=128*w,Pe=1024,Re=128*w,ke=256*w,Be=200,Vt=w,b=new Map,Gn=".glb,.gltf,.obj,.fbx,.usdz,.stl,.ply,.zip,model/gltf-binary,model/gltf+json,model/vnd.usdz+zip,application/vnd.usdz+zip,application/zip";function I(e){let t=e.split(/[?#]/,1)[0].toLowerCase();return t.endsWith(".obj")?"obj":t.endsWith(".fbx")?"fbx":t.endsWith(".usdz")?"usdz":t.endsWith(".stl")?"stl":t.endsWith(".ply")?"ply":t.endsWith(".gltf")?"gltf":"glb"}function Te(e){return b.get(e)??{format:I(e)}}function Wt(e){let t=e.name.toLowerCase();return Gt.some(r=>t.endsWith(r))||Ft.includes(e.type)}async function Fn(e){if(!Wt(e))throw new Error("Unsupported model file. Please upload a .glb, .gltf, .obj, .fbx, .usdz, .stl, .ply, or .zip asset.");let t=e.name.toLowerCase();if(t.endsWith(".usdz")||e.type==="model/vnd.usdz+zip"||e.type==="application/vnd.usdz+zip")return De(e,"usdz");if(t.endsWith(".zip")||_t(e.type))return jt(e);if(t.endsWith(".gltf")||e.type==="model/gltf+json")return Ae(e);let r=I(e.name);return r==="gltf"?Ae(e):De(e,r)}function De(e,t){let r=URL.createObjectURL(e);return b.set(r,{format:t,entryPath:e.name}),{url:r,name:e.name,format:t,cleanup:()=>{y(r),b.delete(r),URL.revokeObjectURL(r)}}}function _t(e){return e==="application/zip"||e==="application/x-zip-compressed"}async function Ae(e){let t=await e.text(),r=Oe(t,e.name);for(let s of ze(r))if(!G(s))throw new Error(`${e.name} references external assets. Upload a .zip containing the .gltf file and its dependencies.`);let n=URL.createObjectURL(e);return b.set(n,{format:"gltf",entryPath:e.name}),{url:n,name:e.name,format:"gltf",cleanup:()=>{y(n),b.delete(n),URL.revokeObjectURL(n)}}}async function jt(e){if(e.size>Le)throw new Error(`Model zip is too large. The compressed archive must be ${U(Le)} or smaller.`);let t=await Nt(new Uint8Array(await e.arrayBuffer())),r=new Map;for(let[a,u]of Object.entries(t)){let i=F(a);!i||Ce(i)||r.set(i,u)}let n=[...r.keys()].filter(a=>/\.(gltf|obj|fbx|stl|ply)$/i.test(a));if(n.length===0)throw new Error("Invalid model zip: no .gltf, .obj, .fbx, .stl, or .ply file found.");if(n.length>1)throw new Error("Invalid model zip: multiple model entry files found.");let s=n[0],o=I(s);if(o==="gltf")return Ht(e,s,r);if(o==="obj"||o==="fbx"||o==="stl"||o==="ply")return $t(e,s,o,r);throw new Error(`Unsupported model entry ${s}.`)}function Nt(e){return new Promise((t,r)=>{let n=0,s=0,o=null,a=i=>(o??(o=new Error(`Invalid model zip: ${i}`)),!1);It(e,{filter:i=>{if(o)return!1;if(n+=1,n>Pe)return a(`archive contains more than ${Pe.toLocaleString()} entries.`);if(i.originalSize>Re)return a(`${i.name} expands beyond the ${U(Re)} per-file limit.`);if(s+=i.originalSize,s>ke)return a(`expanded contents exceed ${U(ke)}.`);if(i.originalSize>=Vt&&(i.size===0||i.originalSize/i.size>Be))return a(`${i.name} exceeds the ${Be}:1 compression-ratio limit.`);let l=F(i.name);return!!l&&!Ce(l)}},(i,l)=>{o?r(o):i?r(new Error(`Invalid model zip: ${i.message}`)):t(l)})})}function U(e){return`${e/w} MiB`}function $t(e,t,r,n){let s=[],o={};for(let[u,i]of n){let l=URL.createObjectURL(new Blob([i],{type:Ue(u)}));s.push(l),o[u]=l}let a=o[t];if(!a)throw s.forEach(u=>URL.revokeObjectURL(u)),new Error(`Invalid model zip: could not read ${t}.`);return b.set(a,{format:r,entryPath:t,resourceUrls:o}),{url:a,name:e.name,format:r,cleanup:()=>{y(a),b.delete(a),s.forEach(u=>URL.revokeObjectURL(u))}}}function Ht(e,t,r){let n=r.get(t);if(!n)throw new Error("Invalid GLTF zip: no .gltf found.");let s=Oe(Ct(n),t);Zt(s,t);let o=Yt(t),a=[];try{Ee(s.buffers,o,r,a),Ee(s.images,o,r,a);let u=new Blob([Ut(JSON.stringify(s))],{type:"model/gltf+json"}),i=URL.createObjectURL(u);return a.push(i),b.set(i,{format:"gltf",entryPath:t}),{url:i,name:e.name,format:"gltf",cleanup:()=>{y(i),b.delete(i),a.forEach(l=>URL.revokeObjectURL(l))}}}catch(u){throw a.forEach(i=>URL.revokeObjectURL(i)),u}}function Ee(e,t,r,n){for(let s of e??[]){if(typeof s.uri!="string"||G(s.uri))continue;let o=Xt(t,s.uri),a=r.get(o);if(!a)throw new Error(`Invalid GLTF zip: missing referenced asset ${s.uri}.`);let u=URL.createObjectURL(new Blob([a],{type:Ue(o)}));n.push(u),s.uri=u}}function Oe(e,t){try{return JSON.parse(e)}catch{throw new Error(`${t} is not a valid .gltf JSON file.`)}}function ze(e){return[...e.buffers??[],...e.images??[]].map(t=>t.uri).filter(t=>typeof t=="string"&&t.length>0)}function Zt(e,t){for(let r of ze(e)){if(G(r))continue;let n=/^[a-z][a-z0-9+.-]*:/i.test(r),s=r.startsWith("/")||r.startsWith("\\");if(n||s)throw new Error(`${t} references external assets. Include every dependency inside the uploaded .zip.`)}}function G(e){return e.startsWith("data:")}function F(e){let t=[];for(let r of e.replace(/\\/g,"/").replace(/^\/+/,"").split("/").filter(n=>n&&n!==".")){if(r===".."){t.pop();continue}t.push(r)}return t.join("/")}function Ce(e){let t=e.split("/");return e.endsWith("/")||t.includes("__MACOSX")||t.some(r=>r===".DS_Store"||r.startsWith("._"))}function Yt(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Xt(e,t){let r=t.split(/[?#]/)[0],n=Kt(r);return F(e?`${e}/${n}`:n)}function Kt(e){try{return decodeURI(e)}catch{return e}}function Ue(e){let t=e.toLowerCase();return t.endsWith(".obj")||t.endsWith(".mtl")?"text/plain":t.endsWith(".fbx")?"application/octet-stream":t.endsWith(".usdz")?"model/vnd.usdz+zip":t.endsWith(".bin")?"application/octet-stream":t.endsWith(".png")?"image/png":t.endsWith(".jpg")||t.endsWith(".jpeg")?"image/jpeg":t.endsWith(".webp")?"image/webp":t.endsWith(".avif")?"image/avif":t.endsWith(".ktx2")?"image/ktx2":"application/octet-stream"}import{BufferGeometry as Jt,Float32BufferAttribute as qt,Group as Ge,Mesh as V,MeshStandardMaterial as Qt}from"three";import{STLLoader as er}from"three/examples/jsm/loaders/STLLoader.js";import{PLYLoader as tr}from"three/examples/jsm/loaders/PLYLoader.js";var rr=12106948,Fe="This PLY file is a point cloud: it has vertices but no faces.",P=class extends Error{constructor(){super(Fe),this.name="PointCloudError"}};function Nn(e){return e instanceof P||e instanceof Error&&e.message.includes(Fe)}function Ve(e,t){let r=e.split(/[?#]/,1)[0],n=r.slice(r.lastIndexOf("/")+1);try{n=decodeURIComponent(n)}catch{}return n.replace(/\.[^.]*$/,"").trim()||t}function W(e){return new Qt({color:e?16777215:rr,vertexColors:e,metalness:0,roughness:.6})}function Ie(e,t,r){let n=e.itemSize;return new qt(e.array.slice(t*n,(t+r)*n),n)}function We(e,t){let r=new er().parse(e),n=!!r.hasColors,s=new Ge;if(r.groups.length>1){let u=r.userData.groupNames??[],i=r.getAttribute("position"),l=r.getAttribute("normal");return r.groups.forEach((c,p)=>{let d=new Jt;d.setAttribute("position",Ie(i,c.start,c.count)),l&&d.setAttribute("normal",Ie(l,c.start,c.count));let f=new V(d,W(!1));f.name=u[p]?.trim()||`${t} ${p+1}`,s.add(f)}),r.dispose(),s}r.clearGroups();let o=W(n);n&&r.alpha!==void 0&&r.alpha<1&&(o.opacity=r.alpha,o.transparent=!0);let a=new V(r,o);return a.name=t,s.add(a),s}function nr(e){let r=new TextDecoder().decode(new Uint8Array(e,0,Math.min(e.byteLength,65536))).split("end_header",1)[0],n=/^\s*element\s+face\s+(\d+)/m.exec(r);return!!(n&&Number(n[1])>0)}function _e(e,t){if(!nr(e))throw new P;let r=new tr().parse(e);r.getAttribute("normal")||r.computeVertexNormals();let n=new V(r,W(!!r.getAttribute("color")));n.name=t;let s=new Ge;return s.add(n),s}import{useLoader as $e,useThree as dr}from"@react-three/fiber";import{FileLoader as He,Loader as fr,LoadingManager as mr}from"three";import{FBXLoader as br,GLTFLoader as hr,MTLLoader as vr,OBJLoader as gr}from"three-stdlib";import{USDLoader as Mr}from"three/examples/jsm/loaders/USDLoader.js";import{useGLTF as Zn}from"@react-three/drei";import{useThree as Xn}from"@react-three/fiber";import{useMemo as Jn}from"react";import{SRGBColorSpace as sr}from"three";import{DRACOLoader as or,KTX2Loader as ar,MeshoptDecoder as ir}from"three-stdlib";function ur(e){return{name:"RI_unlit_emissive_texture",async afterRoot(t){let r=e.json.materials??[],n=new Map;if(r.forEach(o=>{let a=!!o?.extensions?.KHR_materials_unlit,u=!!o?.pbrMetallicRoughness?.baseColorTexture;a&&!u&&o?.emissiveTexture&&o.name&&n.set(o.name,o.emissiveTexture.index)}),n.size===0||!t.scene)return;let s=new Map;await Promise.all([...n].map(async([o,a])=>{let u=await e.getDependency("texture",a);u&&(u.colorSpace=sr,s.set(o,u))})),t.scene.traverse(o=>{let a=Array.isArray(o.material)?o.material:o.material?[o.material]:[];for(let u of a){let i=u.name?s.get(u.name):void 0;i&&!u.map&&(u.map=i,u.needsUpdate=!0)}})}}}var lr="https://assets.react-immersive.liveroom.dev/three-r184/draco/",cr="https://assets.react-immersive.liveroom.dev/three-r184/basis/";function pr(e,t){if(!S(t))return e.detectSupport(t);let r=t,n=s=>r.hasFeature(s);return e.workerConfig={astcSupported:n("texture-compression-astc"),etc1Supported:n("texture-compression-etc1"),etc2Supported:n("texture-compression-etc2"),dxtSupported:n("texture-compression-s3tc"),bptcSupported:n("texture-compression-bc"),pvrtcSupported:n("texture-compression-pvrtc")},e}function je(e,t={},r){let{dracoDecoderPath:n=lr,ktx2TranscoderPath:s=cr,meshopt:o=!0}=t;if(n){let a=new or;a.setDecoderPath(n),e.setDRACOLoader(a)}if(o&&e.setMeshoptDecoder(ir),s&&r){let a=pr(new ar().setTranscoderPath(s),r);e.setKTX2Loader(a)}e.register((a=>ur(a)))}var k=class extends fr{constructor(){super(...arguments);this.options={source:{format:"glb"}}}configure(r){return this.options=r,this}load(r,n,s,o){this.loadAsset(r,s).then(n).catch(o)}async loadAsset(r,n){let s=xr(this.options.source),{format:o}=this.options.source;if(o==="obj")return yr(r,s,this.options.source,n);if(o==="fbx"){let i=_(this,new br(s)),l=Pr(r,this.options.source);l&&i.setResourcePath(l);let c=await i.loadAsync(r,n);return R(c,"FBXMesh",!1),{scene:c,animations:c.animations??[]}}if(o==="stl"||o==="ply"){let i=await wr(r,s,n),l=Ve(this.options.source.entryPath??r,o==="stl"?"STL model":"PLY model"),c=o==="stl"?We(i,l):_e(i,l);return R(c,o==="stl"?"STLMesh":"PLYMesh",!0),{scene:c,animations:[]}}if(o==="usdz"){let l=await _(this,new Mr(s)).loadAsync(r,n);return R(l,"USDZMesh",!1),{scene:l,animations:l.animations??[]}}let a=_(this,new hr(s));je(a,this.options.decoderConfig,this.options.renderer);let u=await a.loadAsync(r,n);return{scene:u.scene,animations:u.animations??[],materialVariants:te(u)}}};Se(e=>{$e.clear(k,e)});function ps(e,t={},r,n){let s=dr(u=>u.gl),o=Te(e),a=r?{...o,format:r}:o;return $e(k,e,u=>{u.configure({source:a,decoderConfig:t,renderer:s})},n)}async function yr(e,t,r,n){let s=await Ne(e,t,n),o=new gr(t),a=Sr(s);if(a){let i=Lr(a,e,r);if(i)try{let l=await Ne(i.url,t),p=new vr(t).parse(l,i.basePath);p.preload(),o.setMaterials(p)}catch(l){console.warn(`[react-immersive] Could not load OBJ material ${a}; rendering geometry with fallback materials.`,l)}}let u=o.parse(s);return R(u,"OBJMesh",!0),{scene:u,animations:[]}}function R(e,t,r){let n=new Set,s=0;e.traverse(o=>{if(!("isMesh"in o&&o.isMesh===!0)){o.name&&n.add(o.name);return}let u=o.name||`${t}_${++s}`;if(!r&&o.name){n.add(o.name);return}let i=u,l=2;for(;n.has(i);)i=`${u}_${l++}`;o.name=i,n.add(i)})}function Ne(e,t,r){let n=new He(t);return n.setResponseType("text"),n.loadAsync(e,r)}function wr(e,t,r){let n=new He(t);return n.setResponseType("arraybuffer"),n.loadAsync(e,r)}function _(e,t){return t.setCrossOrigin(e.crossOrigin),t.setWithCredentials(e.withCredentials),t.setRequestHeader(e.requestHeader),t}function xr(e){let t=new mr,r=e.resourceUrls;return r&&t.setURLModifier(n=>{if(/^(?:blob:|data:)/i.test(n))return n;let s=D(Ye(n).split(/[?#]/)[0]),o=r[s];if(o)return o;let a=B(e.entryPath??""),u=D(a?`${a}/${s}`:s);return r[u]??n}),t}function Sr(e){return/^\s*mtllib\s+(.+?)\s*$/im.exec(e)?.[1]?.trim()||null}function Lr(e,t,r){if(r.resourceUrls&&r.entryPath){let n=D(`${B(r.entryPath)}/${Ye(e)}`),s=r.resourceUrls[n];if(!s)return null;let o=B(n);return{url:s,basePath:o?`${o}/`:""}}try{let n=new URL(e,t).href;return{url:n,basePath:Ze(n)}}catch{return null}}function Pr(e,t){if(t.resourceUrls&&t.entryPath){let r=B(t.entryPath);return r?`${r}/`:""}return Ze(e)}function Ze(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t+1)}function B(e){let t=D(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function D(e){let t=[];for(let r of e.replace(/\\/g,"/").replace(/^\/+/,"").split("/").filter(n=>n&&n!=="."))r===".."?t.pop():t.push(r);return t.join("/")}function Ye(e){try{return decodeURI(e)}catch{return e}}import{Color as j,MeshPhysicalMaterial as Rr,MeshStandardMaterial as kr,Texture as N}from"three";function bs(e){if(Q(e))return e;if(!e||typeof e!="object")return null;let t=e,r=new kr;typeof t.name=="string"&&(r.name=t.name),r.metalness=0,r.roughness=1,t.type==="MeshBasicMaterial"||t.isMeshBasicMaterial===!0?(r.color.set(0),r.emissiveIntensity=1,t.map instanceof N?(r.emissiveMap=t.map,r.emissive.set(16777215)):t.color instanceof j&&r.emissive.copy(t.color)):(t.color instanceof j&&r.color.copy(t.color),t.map instanceof N&&(r.map=t.map),t.emissive instanceof j&&r.emissive.copy(t.emissive),t.emissiveMap instanceof N&&(r.emissiveMap=t.emissiveMap));let s=["aoMap","aoMapIntensity","lightMap","lightMapIntensity","alphaMap","opacity","transparent","alphaTest","side","vertexColors","wireframe","depthTest","depthWrite","visible","toneMapped","fog"];for(let o of s)t[o]!==void 0&&(r[o]=t[o]);return r.needsUpdate=!0,r}function hs(e){if(ee(e))return e.clone();let t=new Rr;return t.name=e.name,t.color.copy(e.color),t.map=e.map,t.lightMap=e.lightMap,t.lightMapIntensity=e.lightMapIntensity,t.aoMap=e.aoMap,t.aoMapIntensity=e.aoMapIntensity,t.emissive.copy(e.emissive),t.emissiveIntensity=e.emissiveIntensity,t.emissiveMap=e.emissiveMap,t.bumpMap=e.bumpMap,t.bumpScale=e.bumpScale,t.normalMap=e.normalMap,t.normalMapType=e.normalMapType,t.normalScale.copy(x(e.normalScale)),t.displacementMap=e.displacementMap,t.displacementScale=e.displacementScale,t.displacementBias=e.displacementBias,t.roughness=e.roughness,t.roughnessMap=e.roughnessMap,t.metalness=e.metalness,t.metalnessMap=e.metalnessMap,t.alphaMap=e.alphaMap,t.envMap=e.envMap,t.envMapRotation.copy(e.envMapRotation),t.envMapIntensity=e.envMapIntensity,t.wireframe=e.wireframe,t.wireframeLinewidth=e.wireframeLinewidth,t.flatShading=e.flatShading,t.fog=e.fog,t.opacity=e.opacity,t.transparent=e.transparent,t.alphaHash=e.alphaHash,t.blendSrc=e.blendSrc,t.blendDst=e.blendDst,t.blendEquation=e.blendEquation,t.blendSrcAlpha=e.blendSrcAlpha,t.blendDstAlpha=e.blendDstAlpha,t.blendEquationAlpha=e.blendEquationAlpha,t.blending=e.blending,t.premultipliedAlpha=e.premultipliedAlpha,t.dithering=e.dithering,t.alphaTest=e.alphaTest,t.depthTest=e.depthTest,t.depthWrite=e.depthWrite,t.colorWrite=e.colorWrite,t.stencilWrite=e.stencilWrite,t.stencilWriteMask=e.stencilWriteMask,t.stencilFunc=e.stencilFunc,t.stencilRef=e.stencilRef,t.stencilFuncMask=e.stencilFuncMask,t.stencilFail=e.stencilFail,t.stencilZFail=e.stencilZFail,t.stencilZPass=e.stencilZPass,t.side=e.side,t.shadowSide=e.shadowSide,t.toneMapped=e.toneMapped,t.vertexColors=e.vertexColors,t.visible=e.visible,t.clippingPlanes=e.clippingPlanes,t.clipIntersection=e.clipIntersection,t.clipShadows=e.clipShadows,t.forceSinglePass=e.forceSinglePass,t.polygonOffset=e.polygonOffset,t.polygonOffsetFactor=e.polygonOffsetFactor,t.polygonOffsetUnits=e.polygonOffsetUnits,t}function vs(e){e.userData.baseColor=e.color.clone(),e.userData.baseMap=e.map??null,e.userData.baseVertexColors=e.vertexColors,e.userData.baseMetalness=e.metalness,e.userData.baseMetalnessMap=e.metalnessMap??null,e.userData.baseRoughness=e.roughness,e.userData.baseRoughnessMap=e.roughnessMap??null,e.userData.baseEmissive=e.emissive.clone(),e.userData.baseEmissiveIntensity=e.emissiveIntensity,e.userData.baseEmissiveMap=e.emissiveMap??null,e.userData.baseOpacity=e.opacity,e.userData.baseTransparent=e.transparent,e.userData.baseAlphaMap=e.alphaMap??null,e.userData.baseAlphaTest=e.alphaTest,e.userData.baseAlphaHash=e.alphaHash,e.userData.baseDithering=e.dithering,e.userData.baseBlending=e.blending,e.userData.baseDepthWrite=e.depthWrite,e.userData.baseSide=e.side,e.userData.baseNormalMap=e.normalMap??null,e.userData.baseNormalScale=x(e.normalScale),e.userData.baseBumpMap=e.bumpMap??null,e.userData.baseBumpScale=e.bumpScale,e.userData.baseAoMap=e.aoMap??null,e.userData.baseAoMapIntensity=e.aoMapIntensity,e.userData.baseDisplacementMap=e.displacementMap??null,e.userData.baseDisplacementScale=e.displacementScale,e.userData.baseDisplacementBias=e.displacementBias,e.userData.baseClearcoat=e.clearcoat,e.userData.baseClearcoatMap=e.clearcoatMap??null,e.userData.baseClearcoatRoughness=e.clearcoatRoughness,e.userData.baseClearcoatRoughnessMap=e.clearcoatRoughnessMap??null,e.userData.baseClearcoatNormalMap=e.clearcoatNormalMap??null,e.userData.baseClearcoatNormalScale=x(e.clearcoatNormalScale),e.userData.baseSheen=e.sheen,e.userData.baseSheenColor=e.sheenColor.clone(),e.userData.baseSheenColorMap=e.sheenColorMap??null,e.userData.baseSheenRoughness=e.sheenRoughness,e.userData.baseSheenRoughnessMap=e.sheenRoughnessMap??null,e.userData.baseAnisotropy=e.anisotropy,e.userData.baseAnisotropyRotation=e.anisotropyRotation,e.userData.baseAnisotropyMap=e.anisotropyMap??null,e.userData.baseTransmission=e.transmission,e.userData.baseTransmissionMap=e.transmissionMap??null,e.userData.baseThickness=e.thickness,e.userData.baseThicknessMap=e.thicknessMap??null,e.userData.baseAttenuationColor=e.attenuationColor.clone(),e.userData.baseAttenuationDistance=e.attenuationDistance,e.userData.baseReflectivity=e.reflectivity,e.userData.baseSpecularIntensity=e.specularIntensity,e.userData.baseSpecularIntensityMap=e.specularIntensityMap??null,e.userData.baseSpecularColor=e.specularColor.clone(),e.userData.baseSpecularColorMap=e.specularColorMap??null,e.userData.baseFlatShading=e.flatShading,e.userData.baseEnvMapIntensity=e.envMapIntensity}import{Box3 as Z,Matrix4 as Ar,Sphere as Er,Vector3 as Y}from"three";import{Matrix4 as Br,Vector3 as Dr}from"three";function $(e){return e.isSkinnedMesh===!0}function xs(e){let t=[];return e.traverse(r=>{$(r)&&t.push(r)}),t}var v="reactImmersiveSkinFreeze";function Ss(e){return!!e.userData[v]}function Ls(e,t){let r=e.userData,n=new Br().copy(t).invert(),s=r[v];if(s){s.frozenInverse.copy(n),e.bindMatrixInverse.copy(n);return}let o={frozenInverse:n,previousOnBeforeRender:e.onBeforeRender};e.bindMatrixInverse.copy(n),e.onBeforeRender=function(a,u,i,l,c,p){o.previousOnBeforeRender.call(this,a,u,i,l,c,p),e.bindMatrixInverse.copy(o.frozenInverse)},r[v]=o}function H(e){return e.userData[v]?.frozenInverse??null}function Ps(e){let t=e.userData,r=t[v];r&&(e.onBeforeRender=r.previousOnBeforeRender,delete t[v],e.updateMatrixWorld(!0))}function Rs(e){let t=e,r=H(e);r&&t.bindMatrixInverse.copy(r),t.skeleton?.update?.();let n=t.geometry.clone(),s=n.getAttribute("position");if(s){let o=new Dr;for(let a=0;a<s.count;a++)t.getVertexPosition(a,o),s.setXYZ(a,o.x,o.y,o.z);s.needsUpdate=!0}return n.deleteAttribute("skinIndex"),n.deleteAttribute("skinWeight"),n.morphAttributes={},n.morphTargetsRelative=!1,n.computeVertexNormals(),n.computeBoundingBox(),n.computeBoundingSphere(),n}function ks(e){return e.matrixWorld.clone()}var Xe=new WeakMap,Ke=new Y,Tr=new Y,Or=new Y,zr=new Z,Je=new Ar;function g(e){return"data"in e?e.data.version:e.version}function Cr(e){var i;let{geometry:t,skeleton:r}=e,n=t.getAttribute("position"),s=t.getAttribute("skinIndex"),o=t.getAttribute("skinWeight"),a=Xe.get(e);if(a?.geometry===t&&a.position===n&&a.indices===s&&a.weights===o&&a.skeleton===r&&a.bindMatrix.equals(e.bindMatrix)&&a.versions[0]===g(n)&&a.versions[1]===g(s)&&a.versions[2]===g(o)&&a.inverses.length===r.boneInverses.length&&a.inverses.every((l,c)=>l.equals(r.boneInverses[c])))return a;let u={geometry:t,position:n,indices:s,weights:o,skeleton:r,versions:[g(n),g(s),g(o)],bindMatrix:e.bindMatrix.clone(),inverses:r.boneInverses.map(l=>l.clone()),bones:[],weightDeviation:0};e:for(let l=0;l<n.count;l++){Ke.fromBufferAttribute(n,l).applyMatrix4(e.bindMatrix);let c=0;for(let d=0;d<4;d++){let f=o.getComponent(l,d);if(f===0)continue;let m=s.getComponent(l,d);if(!Number.isFinite(f)||f<0||!Number.isInteger(m)||!r.bones[m]||!u.inverses[m]){u.bones=null;break e}c+=f,((i=u.bones)[m]??(i[m]=new Z)).expandByPoint(Tr.copy(Ke).applyMatrix4(u.inverses[m]))}let p=Math.abs(c-1);if(p>1e-4){u.bones=null;break}u.weightDeviation=Math.max(u.weightDeviation,p)}return Xe.set(e,u),u}function Es(e,{precise:t=!1,updateFallbacks:r=!0}={}){e.updateMatrixWorld(!0),e.traverse(n=>{if(!$(n))return;let s=n;if(!s.skeleton)return;let o=H(s);o&&s.bindMatrixInverse.copy(o);let u=!!s.geometry.morphAttributes.position?.length?null:Cr(s);if(!t&&!u?.bones&&!r&&s.boundingBox&&s.boundingSphere)return;let i=s.boundingBox??(s.boundingBox=new Z),l=s.boundingSphere??(s.boundingSphere=new Er);if(i.makeEmpty(),t||!u?.bones){let c=s.geometry.getAttribute("position");for(let p=0;p<c.count;p++)i.expandByPoint(s.getVertexPosition(p,Or))}else{for(let c=0;c<u.bones.length;c++){let p=u.bones[c];p&&(Je.multiplyMatrices(s.bindMatrixInverse,s.skeleton.bones[c].matrixWorld),i.union(zr.copy(p).applyMatrix4(Je)))}if(!i.isEmpty()){let c=i.min,p=i.max,d=s.bindMatrixInverse.elements,f=Math.max(1,Math.abs(c.x),Math.abs(c.y),Math.abs(c.z),Math.abs(p.x),Math.abs(p.y),Math.abs(p.z)),m=Math.max(Math.abs(c.x-d[12]),Math.abs(p.x-d[12]),Math.abs(c.y-d[13]),Math.abs(p.y-d[13]),Math.abs(c.z-d[14]),Math.abs(p.z-d[14]));i.expandByScalar(u.weightDeviation*m+f*1e-10)}}i.getBoundingSphere(l)})}import{useCallback as qe,useEffect as Ur,useRef as Ir}from"react";import{useThree as Gr}from"@react-three/fiber";function Cs(){let e=Gr(s=>s.gl.domElement),t=Ir(void 0),r=qe(s=>{t.current===void 0&&(t.current=e.style.cursor),e.style.cursor=s},[e]),n=qe(()=>{let s=t.current;s!==void 0&&(e.style.cursor=s,t.current=void 0)},[e]);return Ur(()=>()=>{n()},[n]),{setCanvasCursor:r,restoreCanvasCursor:n}}import{Box3 as Fr,Vector3 as Qe}from"three";function A(e){return[e.x,e.y,e.z]}function Fs(e){let t=new Fr().setFromObject(e),r=0;return e.traverse(n=>{n.isMesh&&(r+=1)}),{bounds:{min:A(t.min),max:A(t.max),center:A(t.getCenter(new Qe)),size:A(t.getSize(new Qe))},objectCount:r,materialVariants:re(e),materialVariantGroups:ne(e)}}import{useSyncExternalStore as Vr}from"react";var et="(prefers-reduced-motion: reduce)";function Wr(e){if(typeof window>"u"||!window.matchMedia)return()=>{};let t=window.matchMedia(et);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}var _r=()=>typeof window<"u"&&!!window.matchMedia?.(et).matches;function _s(e="user"){let t=Vr(Wr,_r,()=>!1);return e==="always"?!0:e==="never"?!1:t}import{jsx as X,jsxs as K}from"react/jsx-runtime";function Zs({visible:e,message:t,tone:r="default",progress:n}){if(!e)return null;let s=typeof n=="number"&&Number.isFinite(n),o=s?Math.min(Math.max(n,0),100):0,a=Math.round(o);return K("div",{className:"bb-loadingOverlay",role:"status","aria-live":"polite",children:[s&&K("div",{className:"bb-loadingProgressRow",children:[X("div",{className:"bb-loadingProgress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:X("div",{className:"bb-loadingProgress__bar",style:{width:`${a}%`}})}),K("span",{className:"bb-loadingProgress__label",children:[a,"%"]})]}),r!=="success"&&X("span",{className:`bb-loadingMessage bb-status--${r}`,children:t})]})}export{Hr as a,oe as b,ue as c,Jr as d,mt as e,qr as f,Qr as g,S as h,rn as i,nn as j,ln as k,cn as l,pn as m,dn as n,Lt as o,hn as p,O as q,vn as r,Pn as s,zt as t,Tn as u,Gn as v,I as w,Fn as x,Nn as y,$ as z,xs as A,Ss as B,Ls as C,H as D,Ps as E,Rs as F,ks as G,lr as H,cr as I,ps as J,bs as K,hs as L,vs as M,Es as N,Cs as O,Fs as P,_s as Q,Zs as R};
@@ -0,0 +1 @@
1
+ import{w as p}from"./chunk-W24UP6NM.mjs";function c(n){if(typeof n!="object"||n===null)return!1;let e=Object.getPrototypeOf(n);return e===Object.prototype||e===null}function o(n,e){if(!c(e))return e;let i=c(n)?{...n}:{};for(let r of Object.keys(e)){let t=e[r];i[r]=c(t)?o(i[r],t):t}return i}function f(n){return Array.isArray(n)&&n.length>0&&typeof n[0]!="string"}function O(n,e,i){let r=f(e)?e:[{ids:e,patch:i??{}}],t=n;for(let d of r)for(let g of p(t,d.ids)){let s=t[g];if(!s)continue;let a=o(s,d.patch);t===n&&(t={...n}),t[g]=a}return t}function u(n){return{style:{material:n}}}function x(n,e){return o(n,e)}var B={type:"point",color:"#ffffff",intensity:1,position:[0,0,0],distance:0,decay:2,attachedToCamera:!1,castShadow:!1,shadowBias:-5e-4,visible:!0};function h(n){return{...B,...n}}function P(n){return n}export{O as a,u as b,x as c,h as d,P as e};
@@ -0,0 +1 @@
1
+ var S={verifyingLicense:"Verifying License",checkingYourLicenseKey:"Checking your license key...",invalidLicense:"Invalid License",licenseHasBeenRevokedOrHasExpired:"License has been revoked or has expired",failedToLoadPleaseContactTheSiteAdministrator:"Failed to load. Please contact the site administrator.",contextRestoringTitle:"Reloading viewer\u2026",contextLostTitle:"3D view interrupted",contextRestoringMessage:"Rebuilding the 3D view. Please wait\u2026",contextLostMessage:"The graphics connection was interrupted. The viewer will rebuild when it returns, or you can reload it now.",reloadViewer:"Reload viewer",texturePositioningHint:"Drag to move \xB7 Scroll to zoom \xB7 Click elsewhere to finish",texturePositioningStartHint:"Double-click to move or zoom",dismiss:"Dismiss",missingUVsAreShownInMagenta:"Missing UVs are shown in magenta.",viewThisModelInARWithAppleQuickLook:"View this model in AR with Apple Quick Look",viewInAR:"View in AR",openThisExperienceOnAPhoneForAR:"Open this experience on a phone for AR",openOnPhone:"Open on phone",viewThisModelInYourSpace:"View this model in your space",viewThisModelInVR:"View this model in VR",closePhoneHandoff:"Close phone handoff",arScanCode:"Scan the code and choose AR.",qrCodeToOpenThisModelOnAPhone:"QR code to open this model on a phone",disableUVChecker:"Disable UV checker",enableUVChecker:"Enable UV checker",explodedView:"Exploded view",explodeAmount:"Explode amount",removeSectionCut:"Remove section cut",sectionCut:"Section cut",sectionAxis:"Section axis",sectionPosition:"Section position",keepTheOtherSide:"Keep the other side",pauseCinematic:"Pause cinematic",playCinematic:"Play cinematic",stopCinematicAndResetCamera:"Stop cinematic and reset camera",cancel:"Cancel",annotationCategories:"Annotation categories",annotations:"Annotations",all:"All",uncategorized:"Uncategorized",decalDragHint:"Drag the decal on the object. Release to save; Escape to cancel.",showAll:"Show all",materialVariants:"Material variants",startGuidedTour:"Start guided tour",guidedTour:"Guided Tour",previousAnnotation:"Previous annotation",previous:"Prev",stopGuidedTour:"Stop guided tour",nextAnnotation:"Next annotation",next:"Next",exitFullscreen:"Exit fullscreen",enterFullscreen:"Enter fullscreen",resetCameraView:"Reset camera view",orbitControl:"Orbit Control",pointLock:"Point Lock",cameraController:"Camera controller",cameraControllerSettings:"Camera controller settings",downloadGLB:"Download static GLB",downloadGLBDescription:"All visible models and material edits in one static file. No animations, annotations or separate editor model slots. Duplicate mesh names may change on reimport.",downloadPNG:"Download PNG",downloadUVLayout:"Download UV Layout",videoFormat:"Video format",auto:"Auto",recordTurntableVideo:"Record turntable video",recordCinematicVideo:"Record cinematic video",videoUnsupported:"Video recording is not supported in this browser.",downloadOptions:"Download options",exporting:"Exporting\u2026",download:"Download",annotationTitlePlaceholder:"Title *",description:"Description",ok:"OK",arRelocate:"Relocate",tapToPlace:"Tap to place",closeAnnotation:"Close annotation",learnMore:"Learn more",stopMeasuring:"Stop measuring",startMeasuring:"Start measuring",toggleBoundingDimensions:"Toggle bounding dimensions",measurementTool:"Measurement tool",distance:"Distance",angle:"Angle",area:"Area",pointToPlane:"Point to plane",wrap:"Circumference (Edge)",wrapHorizontal:"Circumference (Horizontal)",measurementSnapping:"Measurement snapping",noSnapping:"No snapping",snapAuto:"Snap: auto",snapVertex:"Snap: vertex",snapEdge:"Snap: edge",undoMeasurementPoint:"Undo measurement point",clearMeasurements:"Clear measurements",finishArea:"Finish area",openSceneObjectsPanel:"Open scene objects panel",sceneObjects:"SCENE OBJECTS",searchNodesLabels:"Search nodes, labels",closeSceneObjectsPanel:"Close scene objects panel",objectNavigator:"Objects in the 3D view",compareBefore:"Before",compareAfter:"After",compareDivider:"Comparison divider",viewIn3D:"View in 3D",objectNavigatorHint:"Arrow keys browse \xB7 Enter selects \xB7 Esc clears",selectionCleared:"Selection cleared",cameraKeyboardHelp:"3D view. Arrow keys orbit, Shift with Up or Down zooms, and W, A, S, D, Space and C move the camera.",isolate:"Isolate",hide:"Hide",show:"Show",closePanel:"Close panel",actions:"Actions",openPanel:"Open panel",close:"Close",position:"Position",decalNudgeHint:"Click to fine-tune \xB7 Hold to move",decalNudgeControls:"Move decal in small steps",text:"Text",yourText:"Your text",textToAdd:"Text to add",textColour:"Text colour",addText:"Add text",image:"Image",chooseImage:"Choose image",imageToAdd:"Image to add",added:"Added",colour:"Colour",size:"Size",turn:"Turn",rotation:"Rotation",dragTheDecalAcrossTheObjectsSurface:"Drag the decal across the object's surface",move:"Move",remove:"Remove",noneAddedYet:"None added yet",done:"Done",moveForward:"Move forward",moveLeft:"Move left",moveRight:"Move right",moveBackward:"Move backward",sceneSettings:"Scene Settings",background:"Background",backgroundColor:"Background Color",environment:"Environment",autoRotate:"Auto Rotate",lighting:"Lighting",exposure:"Exposure",ambientLightIntensity:"Ambient Light Intensity",ambientLightColor:"Ambient Light Color",directLightIntensity:"Direct Light Intensity",directLightColor:"Direct Light Color",searchObjects:"Search objects",uploadedModel:"Uploaded model",clear:"Clear",chooseModel:"Choose model",loadingModel:"Loading model...",releaseToLoadYourModel:"Release to load your model",arFindSurface:"Move your device over a flat surface",arReleaseToPlace:"Release to place",arGestureHint:"Pinch to resize \xB7 Twist to rotate",angleFirstArmHint:"Pick the first arm",angleVertexHint:"Pick the angle's vertex",angleSecondArmHint:"Pick the second arm",angleNewHint:"Pick a point to start a new angle",areaNewHint:"Pick a point to start a new area",areaCornersHint:"Pick polygon corners in order, then Finish area",pointToPlaneFaceHint:"Pick the reference face",pointToPlanePointHint:"Pick a point to measure its perpendicular distance",pointToPlaneNewHint:"Pick a face to start a new measurement",distanceHint:"Pick points on the model to measure distances",wrapHint:"Click a point on the surface to measure its circumference, following the surface (best for limbs)",wrapHorizontalHint:"Click a point to measure a level circumference around it (best for the torso/waist)",visibleEntries:"{count} visible entries",objectCount:"{count} objects",annotationMarker:"Annotation {id}: {title}",recordingVideo:"Recording video \xB7 {progress}%",isolatedObjects:"Isolated: {count} objects",largeModelWarning:"Very large model ({millions}M triangles) \u2014 it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the objects panel to select parts.",preparingLargeModel:"Preparing large model ({millions}M triangles) \u2014 the first display can take a while on this device...",enterAR:"Enter AR",enterVR:"Enter VR",decalImage:"Image {index}",decalText:"Text {index}",decalAdded:"{count} added",up:"up",down:"down",left:"left",right:"right",moveDecal:"Move decal {direction}",moveDecalOnSurface:"Move {direction} on the visible surface",showAllObject:"Show all {name}",isolateObject:"Isolate {name}",isolatedObject:"Isolated: {name}",hideObject:"Hide {name}",showObject:"Show {name}",objectSelected:"{name} selected",objectNavigatorPosition:"{position} of {count}",compareDividerValue:"{before} {percent}%, {after} {rest}%",bindingMismatchOne:"1 object binding doesn't match this model",bindingMismatchMany:"{count} object bindings don't match this model",simpleLargeModelWarning:"Very large model detected ({millions}M triangles) \u2014 it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the scene objects panel to select parts.",dropModelHint:"Drag and drop {formats} here",loadErrorTitle:"This model couldn't be loaded",loadErrorNotFound:"Nothing was found at this address ({status}). Check that modelUrl points to the file.",loadErrorDenied:"The server refused access to the file ({status}). Check that the file is public, or that a signed URL hasn't expired.",loadErrorStatus:"The server responded with {status} when the file was requested.",loadErrorNetwork:"The download was blocked or failed. Check that the URL is correct and, if the file is on another domain, that its server allows cross-origin requests (CORS) from this site.",loadErrorHtml:"The server sent back a web page instead of a model. There's probably no file at this path: many servers answer a missing file with their index.html.",loadErrorInvalidFile:"The file couldn't be read as {format}. Check that it's a valid {format} file.",loadErrorInvalidExplicitFormat:"The file couldn't be read as {format}. Check that it's a valid {format} file and that modelFormat matches it.",loadErrorMissingFormat:"The file couldn't be read as {format}. The URL has no file extension, so set modelFormat to the file's format.",loadErrorPointCloud:"This PLY file is a point cloud: it has points but no faces, and the viewer shows meshes. Turn it into a mesh first, for example with MeshLab or Blender.",measurementReferenceFaceRequired:"Pick a triangle face to define the reference plane.",measurementTooManyPoints:"Finish or clear this measurement before adding more points.",measurementAngleDistinct:"Pick a point away from the angle's vertex.",areaMinimumPoints:"Pick at least three points to finish the area.",areaDistinctPoints:"Area points must be distinct.",areaStraightLine:"Area points must not lie on one straight line.",areaNotPlanar:"Area points must lie on one plane.",areaEdgesCross:"Area edges must not cross or touch each other.",areaZero:"The polygon has no measurable area.",decalSurfaceMissing:"Could not find a surface on this object for the decal.",decalDirectionMissing:"No visible surface in that direction. Try another arrow or rotate the view.",fullscreenExitFailed:"Could not exit fullscreen. Press Escape to exit.",fullscreenEnterFailed:"Could not enter fullscreen. Check your browser or iframe fullscreen permissions and try again.",uvCoordinatesMissing:"This model does not contain UV coordinates.",uvExportFailed:"Could not create the UV layout archive.",videoExportFailed:"Could not export the video.",videoNotReady:"Viewer not ready for video export.",videoExitXR:"Exit the XR session before recording a video.",videoAlreadyRecording:"A video export is already in progress.",videoPathRequired:"Enable a cinematic camera path before recording it.",videoDurationInvalid:"Video duration must be greater than 0 and at most 300 seconds.",videoFrameRateInvalid:"Video frame rate must be between 1 and 60.",videoBitrateInvalid:"Video bitrate must be a positive number.",videoContextLost:"Video export stopped because the WebGL context was lost.",videoTimedOut:"Video export timed out. Keep the viewer tab visible while recording.",videoEncodingFailed:"The browser could not encode the video.",videoEmpty:"The browser produced an empty video.",videoDidNotStart:"Video recording did not start.",videoWebMUnsupported:"Video recording as WEBM is not supported in this browser.",videoMP4Unsupported:"Video recording as MP4 is not supported in this browser.",videoGIFUnsupported:"Video recording as GIF is not supported in this browser.",videoGifWidthInvalid:"GIF width must be a whole number of pixels from 16 to 4096.",environmentApartment:"apartment",environmentCity:"city",environmentDawn:"dawn",environmentForest:"forest",environmentLobby:"lobby",environmentNight:"night",environmentPark:"park",environmentStudio:"studio",environmentSunset:"sunset",environmentWarehouse:"warehouse",color:"Color",material:"Material",texturePreview:"texture preview",noTextureApplied:"No texture applied",noTextureCoordinates:"This part has no texture coordinates, so an image can't be placed on it.",replaceImage:"Replace image",uploadImage:"Upload image",removeTexture:"Remove texture",texturePosition:"Texture position",offsetX:"Offset X",offsetY:"Offset Y",confirmTexturePosition:"Confirm this texture position and exit positioning mode",donePositioning:"Done positioning",textureOffsetHint:"Double-click the object in the preview to drag its texture directly (scroll to zoom), or edit its offset numerically.",actionToggleLight:"Toggle Light",actionChangeLightColor:"Change Light Color",actionSetBrightness:"Set Brightness",actionChangeColor:"Change Color",actionChangeMaterial:"Change Material",actionToggleVisibility:"Toggle Visibility"};function E(e,t,n={}){return(e?.[t]??S[t]).replace(/\{(\w+)\}/g,(s,l)=>Object.prototype.hasOwnProperty.call(n,l)?String(n[l]):s)}var L=new Map(Object.entries(S).map(([e,t])=>[t,e]));function X(e,t){let n=L.get(t);return n?E(e,n):t}var w="KHR_materials_variants",V="riMaterialVariants",k="riMaterialVariantGroups";function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function O(e){if(!c(e)||!c(e.extensions))return[];let t=e.extensions[w];if(!c(t)||!Array.isArray(t.variants))return[];let n=new Set;return t.variants.map((o,s)=>{let l=c(o)&&typeof o.name=="string"&&o.name?o.name:`Variant ${s+1}`,d=l;for(let g=2;n.has(d);g+=1)d=`${l} (${g})`;return n.add(d),d})}function q(e){let t=e.userData?.gltfExtensions;if(!c(t))return[];let n=t[w];return!c(n)||!Array.isArray(n.mappings)?[]:n.mappings.filter(o=>c(o)&&Number.isInteger(o.material)&&Array.isArray(o.variants)&&o.variants.every(Number.isInteger))}function Q(e,t){for(let n=t.length-1;n>=0;n-=1){let o=t[n];if(o<0)continue;let s=e.find(l=>l.variants.includes(o));if(s)return s.material}return null}var D=/^\s*(.+?)\s*(?::|\s\/\s)\s*(.+?)\s*$/;function N(e){let t=Math.min(Math.max(e,0),1),n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function j(e){if(!c(e))return;let t=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{};if(t.baseColorTexture!==void 0)return;let n=Array.isArray(t.baseColorFactor)?t.baseColorFactor:[1,1,1,1];if(n.slice(0,3).every(o=>typeof o=="number"))return`#${n.slice(0,3).map(o=>N(o).toString(16).padStart(2,"0")).join("")}`}function I(e,t){if(t.length===0)return[];let n=c(e)?e:{},o=Array.isArray(n.meshes)?n.meshes:[],s=Array.isArray(n.accessors)?n.accessors:[],l=Array.isArray(n.materials)?n.materials:[],d=t.map(()=>new Set),g=t.map(()=>new Map);o.forEach((r,a)=>{(c(r)&&Array.isArray(r.primitives)?r.primitives:[]).forEach((p,i)=>{if(!c(p))return;let m=c(p.extensions)?p.extensions[w]:void 0;if(!c(m)||!Array.isArray(m.mappings))return;let b=c(p.attributes)?p.attributes.POSITION:void 0,x=typeof b=="number"?s[b]:void 0,R=c(x)&&typeof x.count=="number"?x.count:1;for(let M of m.mappings)if(!(!c(M)||!Number.isInteger(M.material)||!Array.isArray(M.variants)))for(let v of M.variants){if(!Number.isInteger(v)||!d[v])continue;d[v].add(`${a}/${i}`);let T=g[v],A=M.material;T.set(A,(T.get(A)??0)+R)}})});let C=t.map((r,a)=>{let u=null;for(let[i,m]of g[a])(u===null||m>(g[a].get(u)??0))&&(u=i);let p=u===null?void 0:j(l[u]);return{name:r,label:r,...p?{swatch:p}:{}}}),f=t.map(()=>-1),h=[],y=new Map;return t.forEach((r,a)=>{let u=D.exec(r);if(!u)return;let[,p,i]=u;y.has(p)||(y.set(p,h.length),h.push({name:p,members:[]})),f[a]=y.get(p),h[f[a]].members.push(a),C[a].label=i}),t.map((r,a)=>a).filter(r=>f[r]<0).sort((r,a)=>+(d[r].size===0)-+(d[a].size===0)).forEach(r=>{let a=h.map((i,m)=>({group:i,groupIndex:m})).filter(({group:i})=>i.name===null&&i.members.some(m=>d[r].size===0||d[m].size===0?!1:[...d[r]].some(b=>d[m].has(b)))).map(({groupIndex:i})=>i);if(a.length===0&&d[r].size===0){let i=h.findIndex(m=>m.name===null);i>=0&&a.push(i)}if(a.length===0){f[r]=h.length,h.push({name:null,members:[r]});return}let[u,...p]=a;for(let i of p){for(let m of h[i].members)f[m]=u;h[u].members.push(...h[i].members),h[i].members=[]}f[r]=u,h[u].members.push(r)}),h.filter(r=>r.members.length>0).sort((r,a)=>Math.min(...r.members)-Math.min(...a.members)).map(r=>({name:r.name,variants:[...r.members].sort((a,u)=>a-u).map(a=>C[a])}))}function J(e,t,n){let o=n.find(l=>l.variants.some(d=>d.name===t)),s=new Set(o?.variants.map(l=>l.name)??[t]);return[...e.filter(l=>!s.has(l)),t]}function Z(e){if(Array.isArray(e.activeVariants))return e.activeVariants.filter(n=>typeof n=="string");let t=e.materialVariant;return typeof t=="string"&&t?[t]:[]}function ee(e){let t=e.parser,n=O(t?.json);if(!(!t||n.length===0))return e.scene.userData[V]=n,e.scene.userData[k]=I(t.json,n),{names:n,resolveMaterial:async(o,s)=>{let l={geometry:s.geometry,material:await t.getDependency("material",o),isPoints:s.isPoints,isLine:s.isLine};return t.assignFinalMaterial(l),l.material}}}function F(e){let t=e.userData?.[V];return Array.isArray(t)&&t.every(n=>typeof n=="string")?t:[]}function te(e){let t=e.userData?.[k];if(Array.isArray(t))return t;let n=F(e);return n.length>0?[{name:null,variants:n.map(o=>({name:o,label:o}))}]:[]}function ne(e,t){let{materialVariant:n,...o}=e;return{...o,activeVariants:t}}import{AdditiveBlending as B,BackSide as G,DoubleSide as U,FrontSide as H,NoColorSpace as K,NormalBlending as _,SRGBColorSpace as z,Vector2 as P}from"three";function pe(e){let t=!0;return e?.traverse(n=>{let o=n.isMesh?n.geometry:null;o&&!o.getAttribute("uv")&&(t=!1)}),t}function me(e){return!!(e&&typeof e=="object"&&"clone"in e&&"color"in e&&"metalness"in e&&"roughness"in e)}function he(e){return!!(e&&typeof e=="object"&&"isMeshPhysicalMaterial"in e&&e.isMeshPhysicalMaterial)}function ge(e){return!!(e&&"isMesh"in e&&e.isMesh)}var fe=["texture","metalnessMap","roughnessMap","emissiveMap","alphaMap","normalMap","bumpMap","aoMap","displacementMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","anisotropyMap","transmissionMap","thicknessMap","sheenColorMap","sheenRoughnessMap","specularIntensityMap","specularColorMap"],Me={texture:"map",metalnessMap:"metalnessMap",roughnessMap:"roughnessMap",emissiveMap:"emissiveMap",alphaMap:"alphaMap",normalMap:"normalMap",bumpMap:"bumpMap",aoMap:"aoMap",displacementMap:"displacementMap",clearcoatMap:"clearcoatMap",clearcoatRoughnessMap:"clearcoatRoughnessMap",clearcoatNormalMap:"clearcoatNormalMap",anisotropyMap:"anisotropyMap",transmissionMap:"transmissionMap",thicknessMap:"thicknessMap",sheenColorMap:"sheenColorMap",sheenRoughnessMap:"sheenRoughnessMap",specularIntensityMap:"specularIntensityMap",specularColorMap:"specularColorMap"},Y=new Set(["texture","emissiveMap","sheenColorMap","specularColorMap"]);function be(e){return Y.has(e)?z:K}function ve(e,t){return e?.[t]?.path}function ye(e,t){let n=e?.[t]?.offset;if(!n)return;let[o,s]=n;if(!(!Number.isFinite(o)||!Number.isFinite(s)))return o===0&&s===0?void 0:[o,s]}function xe(e,t){let n=e?.[t]?.scale;if(!(!Number.isFinite(n)||!n))return n===1?void 0:n}function we(e,t){let n=e?.[t]?.rotation;if(!(!Number.isFinite(n)||!n))return n}function Ce(e){return e==="back"?G:e==="double"?U:H}function Te(e){return e==="additive"?B:_}function Ae(e,t=1,n=t){if(e&&typeof e=="object"){let o=e;if(typeof o.x=="number"&&Number.isFinite(o.x)&&typeof o.y=="number"&&Number.isFinite(o.y))return new P(o.x,o.y)}return new P(t,n)}function Se(e){return Number.isFinite(e)&&e>0?e:1}function Ve(e,t){return e?.animations.clips.find(n=>n.sourceName===t)}function ke(e){return e?.loopMode??"repeat"}export{S as a,E as b,X as c,pe as d,me as e,he as f,ge as g,fe as h,Me as i,be as j,ve as k,ye as l,xe as m,we as n,Ce as o,Te as p,Ae as q,Se as r,Ve as s,ke as t,q as u,Q as v,J as w,Z as x,ee as y,F as z,te as A,ne as B};
@@ -0,0 +1 @@
1
+ var n={licenseKey:!0,dracoDecoderPath:!0,ktx2TranscoderPath:!0,meshopt:!0},i={licenseValidationUrl:!0,onObjectEditLeaseChange:!0,onSelectionClear:!0,onSceneLoaded:!0,onTexturePositioningChange:!0,endTexturePositioningRef:!0};function s(r,t){let e={};for(let o of Object.keys(t))o in r&&(e[o]=r[o]);return e}function c(r,t){let e={...r};for(let o of Object.keys(t))delete e[o];return e}export{n as a,i as b,s as c,c as d};
@@ -0,0 +1 @@
1
+ import{d as j}from"./chunk-JHKMRMJH.mjs";var f=Object.freeze([{id:"change-color",label:"Change Color",handling:"viewer",description:"Opens a color picker docked under the action and commits the result to style.material.baseColor."},{id:"change-material",label:"Change Material",handling:"viewer",description:"Opens the material picker so the viewer can swap the object's texture."},{id:"add-text",label:"Add Text",handling:"viewer",description:"Opens a text box docked under the action; the viewer's user types, clicks the object to place it, and can resize, turn, move, or remove it. Saved to the binding's decals."},{id:"add-image",label:"Add Image",handling:"viewer",description:"Lets the viewer's user choose an image, click the object to place it, and resize, turn, move, or remove it. Saved to the binding's decals."},{id:"toggle-visibility",label:"Toggle Visibility",handling:"viewer",description:"Flips the binding's visible flag."},{id:"toggle-light",label:"Toggle Light",handling:"viewer",description:"Turns the scene lights attached to this object on or off, or the object's own glow when none is attached."},{id:"change-light-color",label:"Change Light Color",handling:"viewer",description:"Opens a color picker docked under the action for the scene lights attached to this object, or the object's own glow."},{id:"set-brightness",label:"Set Brightness",handling:"viewer",description:"Opens a brightness slider docked under the action for the scene lights attached to this object, or the object's own glow."}]),X="__custom__";function E(n){return f.find(e=>e.id===n)}var B=f.filter(n=>n.handling==="viewer").map(n=>n.id),k=new Set(["","New Action",...f.map(n=>n.label)]);function Z(n){return k.has(n.trim())}function x(n,e){let t=Array.from({length:e.length+1},(r,i)=>i);for(let r=1;r<=n.length;r+=1){let i=[r];for(let l=1;l<=e.length;l+=1){let a=t[l-1]+(n[r-1]===e[l-1]?0:1);i[l]=Math.min(i[l-1]+1,t[l]+1,a)}t=i}return t[e.length]}function q(n){if(E(n))return null;let e=n.trim().toLowerCase();if(!e)return null;let t=e.replace(/[^a-z0-9]/g,""),r=null;for(let i of f){let l=Math.min(x(e,i.id),x(t,i.id.replace(/[^a-z0-9]/g,"")));(!r||l<r.distance)&&(r={id:i.id,distance:l})}return r&&r.distance<=2?r.id:null}function Q(n){let e=n.trim();return e?/\.(hdr|exr|jpg|jpeg|png|webp)(?:[?#].*)?$/i.test(e):!1}var ee=["none","directional","point","spot","hemisphere"],ne=["pbr","matcap","uv-checker"],te=["apartment","city","dawn","forest","lobby","night","park","studio","sunset","warehouse"];var re=["sporadic","constantMild","constantWild"],ie=["linear","radial","mirroredLinear"],oe=["verySmall","small","medium","large","veryLarge","huge"],ae=["x","y","z"],se={enabled:!1,axis:"y",position:.5,flip:!1},I={clips:[],autoplayClip:null},N={autofocus:{enabled:!1,focusDistance:5,focusRange:5,focalLength:.02,bokehScale:6,target:[0,0,0],mouse:!0,debug:0,manual:!1,smoothTime:.25},toneMapping:{enabled:!1,mode:"aces",exposure:1,resolution:256,whitePoint:4,middleGrey:.6,minLuminance:.01,averageLuminance:1,adaptationRate:1},brightnessContrast:{enabled:!1,brightness:0,contrast:0},hueSaturation:{enabled:!1,hue:0,saturation:0},colorAverage:{enabled:!1},dotScreen:{enabled:!1,angle:Math.PI/2,scale:1},glitch:{enabled:!1,mode:"sporadic",delay:[1.5,3.5],duration:[.6,1],strength:[.3,1],chromaticAberrationOffset:[0,0],columns:.05,ratio:.85},ssao:{enabled:!1,samples:30,rings:4,intensity:8,radius:.25,bias:.025,luminanceInfluence:.6,fade:.01,minRadiusScale:.33,worldDistanceThreshold:20,worldDistanceFalloff:5,worldProximityThreshold:6,worldProximityFalloff:3},bloom:{enabled:!1,intensity:.3,luminanceThreshold:.9,luminanceSmoothing:.2,mipmapBlur:!0,radius:0,levels:8},godRays:{enabled:!1,sunPosition:[5,10,5],samples:60,density:.96,decay:.9,weight:.4,exposure:.6,clampMax:1,blur:!0,kernelSize:"small"},grid:{enabled:!1,scale:1,lineWidth:0},noise:{enabled:!1,opacity:1,premultiply:!1},depthOfField:{enabled:!1,focusDistance:5,focusRange:5,focalLength:.02,bokehScale:6},chromaticAberration:{enabled:!1,offsetX:.002,offsetY:.002,radialModulation:!1,modulationOffset:.15},lensflare:{enabled:!1,lensPosition:[-25,6,-60],smoothTime:.07,glareSize:.2,flareSize:.01,flareSpeed:.01,flareShape:.01,animated:!0,anamorphic:!1,colorGain:"#141414",haloScale:.5,secondaryGhosts:!0,aditionalStreaks:!0,ghostScale:0,opacity:1,starBurst:!1},vignette:{enabled:!1,offset:.3,darkness:.3,eskil:!1},smaa:{enabled:!1},sepia:{enabled:!1,intensity:0},scanline:{enabled:!1,density:1.25},pixelation:{enabled:!1,granularity:5},outline:{enabled:!1,selectionLayer:10,edgeStrength:2.5,pulseSpeed:0,visibleEdgeColor:"#ffffff",hiddenEdgeColor:"#22090a",kernelSize:"large",blur:!1,xRay:!0},selectiveBloom:{enabled:!1,selectionLayer:10,intensity:1,luminanceThreshold:.9,luminanceSmoothing:.025,kernelSize:"large",mipmapBlur:!0,inverted:!1,ignoreBackground:!1},ramp:{enabled:!1,rampType:"linear",rampStart:[.5,.5],rampEnd:[1,1],startColor:"#000000",endColor:"#ffffff",opacity:.5,rampBias:.5,rampGain:.5,rampMask:!1,rampInvert:!1}},le={model:{rotation:[0,0,0],showAdvancedRotation:!1,renderer:"pbr",shading:"lit",autoRotate:!1,autoRotateSpeed:1},camera:{fieldOfView:50,showAdvancedSettings:!1},lighting:{ambient:{intensity:.25,color:"#ffffff"},lights:[{id:"light-hemi",type:"hemisphere",color:"#ffffff",intensity:.3,position:[0,1,0],attachedToCamera:!1,castShadow:!1,shadowBias:-5e-4,visible:!0},{id:"light-key",type:"directional",color:"#ffffff",intensity:2.5,position:[6,12,6],attachedToCamera:!1,castShadow:!0,shadowBias:-5e-4,visible:!0},{id:"light-fill",type:"directional",color:"#ffffff",intensity:0,position:[-6,8,-6],attachedToCamera:!1,castShadow:!1,shadowBias:-5e-4,visible:!0}]},shadows:{enabled:!0,mapSize:2048,bias:-5e-4,normalBias:.02,radius:3},environment:{source:"preset",preset:"apartment",customEnvironmentUrl:"",intensity:.25,rotation:0,shadowLight:{enabled:!1,intensity:2.5,bias:-5e-4}},wireframe:{enabled:!1,color:"#000000",opacity:1},background:{enabled:!1,type:"color",color:"#1c1c1d",imageUrl:""},groundShadows:{enabled:!1,mode:"shadowCatcher",intensity:.7,borderFade:1,height:0,size:10},postProcessing:N,animations:I,annotations:[]};function w(n,e){if(n[e])return e;let t=Object.entries(n).find(([,i])=>i.id===e)?.[0];return t||(Object.entries(n).find(([,i])=>i.modelObjectId===e)?.[0]??null)}function R(n){return typeof n=="object"&&!Array.isArray(n)}function D(n,e){return"group"in e?n.group===e.group:"tag"in e?n.tags?.includes(e.tag)??!1:(n.type??"other")===e.type}function p(n,e){if(R(e))return Object.entries(n).filter(([,i])=>D(i,e)).map(([i])=>i);let r=(typeof e=="string"?[e]:e).map(i=>w(n,i)).filter(i=>i!==null);return[...new Set(r)]}function be(n,e){return p(n,e).map(t=>n[t]).filter(t=>t!==void 0)}var L="#ff3b30",_=Object.freeze({}),C=n=>n;function P(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function z(n,e){let t=n.metadata;for(let r of e.split(".")){if(!P(t))return;t=t[r]}return t}function G(n,e){if("metric"in e){let t=n.metrics?.[e.metric];return!(typeof t!="number"||!Number.isFinite(t)||e.above!==void 0&&!(t>e.above)||e.below!==void 0&&!(t<e.below))}if("status"in e){let t=n.status??"normal";return Array.isArray(e.status)?e.status.includes(t):e.status===t}return z(n,e.metadata)===e.equals}function F(n){let e=n.trim().replace(/^#/,""),t=e.length===3?e.split("").map(r=>r+r).join(""):e;return/^[0-9a-f]{6}$/i.test(t)?[0,2,4].map(r=>parseInt(t.slice(r,r+2),16)):null}var h=n=>`#${n.map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`;function V(n,e){let t=n.map(([o,s])=>({at:o,rgb:F(s)})).filter(o=>Number.isFinite(o.at)&&o.rgb!==null).sort((o,s)=>o.at-s.at);if(t.length===0||!Number.isFinite(e))return null;if(e<=t[0].at)return h(t[0].rgb);let r=t[t.length-1];if(e>=r.at)return h(r.rgb);let i=t.findIndex(o=>o.at>=e),l=t[i-1],a=t[i],c=a.at===l.at?1:(e-l.at)/(a.at-l.at);return h(l.rgb.map((o,s)=>o+(a.rgb[s]-o)*c))}function pe(n,e){if(!e?.length)return{bindings:n,pulses:_,sourceOf:C};let t=new Map,r={};for(let a of e){let c=a.target?p(n,a.target):Object.keys(n),o=a.when?Array.isArray(a.when)?a.when:[a.when]:[];for(let s of c){let m=n[s];if(!o.every(d=>G(m,d)))continue;let u={...a.material};if(a.colorScale){let d=m.metrics?.[a.colorScale.metric],b=typeof d=="number"?V(a.colorScale.stops,d):null;b&&(u={...u,[a.colorScale.channel??"baseColor"]:b})}if(a.pulse){let d=a.pulse===!0?{}:a.pulse;r[s]={color:d.color??L,speed:d.speed!==void 0&&d.speed>0?d.speed:1};let b=u.emissiveIntensity??t.get(s)?.emissiveIntensity??m.style?.material?.emissiveIntensity;b!==void 0&&b>0||(u.emissiveIntensity=1)}Object.keys(u).length>0&&t.set(s,{...t.get(s),...u})}}if(t.size===0)return{bindings:n,pulses:r,sourceOf:C};let i={...n},l=new WeakMap;for(let[a,c]of t){let o=n[a],s={...o,style:{...o.style,material:{...o.style?.material,...c}}};i[a]=s,l.set(s,o)}return{bindings:i,pulses:r,sourceOf:a=>l.get(a)??a}}var $=.12,v=new Set;function U(n,e){return e?new Set(p(n,e.target)):v}function ye(n,e){let t=U(n.bindings,e);if(!e||t.size===0)return{...n,setAside:v};let r=Math.min(Math.max(e.ghostOpacity??$,0),1),i={...n.bindings},l=new WeakMap,a=new Set;for(let[c,o]of Object.entries(n.bindings)){if(t.has(c))continue;a.add(c);let s=e.mode==="hide"?{...o,visible:!1}:{...o,style:{...o.style,material:{...o.style?.material,opacity:Math.min(o.style?.material?.opacity??1,r)}}};i[c]=s,l.set(s,n.sourceOf(o))}return{bindings:i,pulses:n.pulses,sourceOf:c=>l.get(c)??n.sourceOf(c),setAside:a}}import{PropertyBinding as y}from"three";var S=Symbol("react-immersive.model-node-id");function W(n,e){Object.defineProperty(n,S,{value:e,configurable:!0})}function O(n){let e=new Map;n.traverse(o=>{if(!o.name)return;let s=e.get(o.name);s?s.push(o):e.set(o.name,[o])});let t=Object.create(null),r=new WeakMap,i=new Map,l=new Set(Array.from(e,([o,s])=>s.length===1?o:null).filter(o=>o!==null)),a=new Set,c=(o,s)=>{W(o,s),t[s]=o,r.set(o,s),a.add(s)};for(let[o,s]of e)s.length===1&&c(s[0],o);for(let[o,s]of e){if(s.length<2)continue;let m=[];s.forEach((u,d)=>{let b=`${o} [${d+1}]`,g=b,T=2;for(;l.has(g)||a.has(g);)g=`${b}.${T++}`;c(u,g),m.push(g)}),i.set(o,m)}return{nodesById:t,idByNode:r,duplicateNames:i}}function je(n){return n[S]??n.name??null}function xe(n,e){let t=e.replace(/\.[^./\\]+$/,"");n.traverse(r=>{r.name&&(r.name=y.sanitizeNodeName(`${t}_${r.name}`))})}function Be(n,e){let t=e.replace(/\.[^./\\]+$/,""),r=n.clone();for(let i of r.tracks){let a=y.parseTrackName(i.name).nodeName??"",c=y.sanitizeNodeName(`${t}_${a}`);i.name=c+i.name.slice(a.length)}return r}function we(n,e){let t=null,r=[];return n.traverse(i=>{i[S]===e&&(t=i),i.name===e&&r.push(i)}),t??(r.length===1?r[0]:null)}function K(n){return n.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").replace(/[^a-zA-Z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}function H(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Y(n){let e=n.toLowerCase();return e.includes("light")?"light":e.includes("wheel")||e.includes("rim")||e.includes("tire")?"wheel":e.includes("glass")||e.includes("window")||e.includes("windshield")||e.includes("sunroof")?"glass":e.includes("seat")||e.includes("dashboard")||e.includes("console")||e.includes("doorpanel")?"interior":e.includes("floor")?"floor":e.includes("wall")?"wall":e.includes("door")?"door":e.includes("chair")||e.includes("table")||e.includes("sofa")||e.includes("bed")?"furniture":"other"}function M(n,e=!0){return n==="light"||n.endsWith("light")?[{id:"toggle-light",label:"Toggle Light",type:"command"},{id:"change-light-color",label:"Change Light Color",type:"command"},{id:"set-brightness",label:"Set Brightness",type:"command"}]:[{id:"change-color",label:"Change Color",type:"command"},...e?[{id:"change-material",label:"Change Material",type:"command"}]:[],{id:"toggle-visibility",label:"Toggle Visibility",type:"command"}]}function A(n,e=!0){let t=Y(n);return{id:K(n),modelObjectId:n,type:t,label:H(n),status:"normal",selectable:!0,hoverable:!0,visible:!0,style:{},actions:M(t,e),metrics:{},metadata:{}}}function Te(n,e){return Object.fromEntries(n.map(t=>[t,A(t,!e?.has(t))]))}function Ee(n,e){let t=new Set,r={};for(let i of n){let l=A(i,!e?.has(i)),a=l.id||"object",c=a;for(let s=2;t.has(c);s++)c=`${a}-${s}`;t.add(c),l.id=c;let o=(l.actions??[]).filter(s=>B.includes(s.id));l.actions=o.length>0?o:M("other",!e?.has(i)),r[i]=l}return r}function ke(n){let e=new Set;for(let[t,r]of Object.entries(O(n).nodesById))j(r)||e.add(t);return e}function Ie(n){let{nodesById:e}=O(n),t=[];for(let[r,i]of Object.entries(e)){let l=i;l.isMesh&&l.geometry&&i.name&&t.push(r)}return t.sort((r,i)=>r.localeCompare(i))}var Re=["front","back","double"],De=["normal","additive"];export{f as a,X as b,E as c,B as d,Z as e,q as f,w as g,Q as h,ee as i,ne as j,te as k,re as l,ie as m,oe as n,ae as o,se as p,le as q,O as r,je as s,xe as t,Be as u,we as v,p as w,be as x,G as y,V as z,pe as A,U as B,ye as C,H as D,Y as E,A as F,Te as G,Ee as H,ke as I,Ie as J,Re as K,De as L};