@liveroom-tech/react-immersive 6.0.2 → 6.1.1
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.
- package/README.md +24 -0
- package/dist/AnimationsTab-NUJTEMZ5.mjs +1 -0
- package/dist/AnnotationsTab-OHRVWRKI.mjs +1 -0
- package/dist/CinematicTab-IJAY2BS6.mjs +1 -0
- package/dist/ConfigureTab-UQRRATCY.mjs +6 -0
- package/dist/RulesTab-YVBZGJZX.mjs +1 -0
- package/dist/SequencesTab-IC5LWQ6N.css +1 -0
- package/dist/SequencesTab-LWGOVQ6Y.mjs +1 -0
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.d.mts +3 -3
- package/dist/binding-builder.d.ts +3 -3
- package/dist/binding-builder.js +76 -23
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-37YITTIK.mjs +1 -0
- package/dist/chunk-5FLX45O5.mjs +2 -0
- package/dist/chunk-5PJ5MLKE.mjs +1 -0
- package/dist/chunk-644OGSQJ.mjs +83 -0
- package/dist/chunk-7JCFNZJM.mjs +1 -0
- package/dist/chunk-7OWHW66D.mjs +1 -0
- package/dist/chunk-AL6UIGWP.mjs +1 -0
- package/dist/chunk-BNKTI3CY.mjs +1 -0
- package/dist/chunk-CCBFMNAU.mjs +1 -0
- package/dist/chunk-DEFZEXTA.mjs +1 -0
- package/dist/chunk-E24EFHB5.mjs +1 -0
- package/dist/chunk-EV6THDXD.mjs +1 -0
- package/dist/chunk-F5QSXMME.mjs +1 -0
- package/dist/chunk-FGAJ2UT7.mjs +1 -0
- package/dist/chunk-FXV4CLAK.mjs +1 -0
- package/dist/chunk-GV4ZRXL6.mjs +1 -0
- package/dist/chunk-KNCABWVN.mjs +47 -0
- package/dist/chunk-LX3GXQNU.mjs +1 -0
- package/dist/chunk-MLT4JQAY.mjs +1 -0
- package/dist/chunk-OPDRK3GS.mjs +1 -0
- package/dist/chunk-Z2VQGUC2.mjs +3 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +24 -6
- package/dist/hosted.d.ts +24 -6
- package/dist/hosted.js +75 -22
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +66 -6
- package/dist/index.d.ts +66 -6
- package/dist/index.js +69 -21
- package/dist/index.mjs +1 -1
- package/dist/{modelFileResolver-Co7j1tdQ.d.mts → modelFileResolver-B8ADn9Nl.d.mts} +57 -7
- package/dist/{modelFileResolver-Co7j1tdQ.d.ts → modelFileResolver-B8ADn9Nl.d.ts} +57 -7
- package/dist/{modelViewerProps-BibuMND7.d.ts → modelViewerProps-BE4D56Ti.d.ts} +173 -3
- package/dist/{modelViewerProps-Ce4-wb57.d.mts → modelViewerProps-DBwh-fmu.d.mts} +173 -3
- package/dist/{publicProps-CP18d_mt.d.ts → publicProps-3LNTAskZ.d.ts} +1 -1
- package/dist/{publicProps-BaJHCDa_.d.mts → publicProps-Clr1nSE6.d.mts} +1 -1
- package/dist/simple-model-viewer.css +1 -1
- package/dist/simple-model-viewer.d.mts +25 -3
- package/dist/simple-model-viewer.d.ts +25 -3
- package/dist/simple-model-viewer.js +49 -3
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +47 -4
- package/dist/utils.d.ts +47 -4
- package/dist/utils.js +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +5 -1
- package/dist/chunk-33SUWPXC.mjs +0 -3
- package/dist/chunk-4JMJALRO.mjs +0 -2
- package/dist/chunk-EIBW7ZJE.mjs +0 -81
- package/dist/chunk-KFTJMFYF.mjs +0 -1
- package/dist/chunk-OTSCPJWF.mjs +0 -1
- package/dist/chunk-P2JZ5Z7I.mjs +0 -1
- package/dist/chunk-V7WZUWJ5.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as P}from"./chunk-GV4ZRXL6.mjs";import{c as j}from"./chunk-BNKTI3CY.mjs";function O(n){if(typeof n!="object"||n===null)return!1;let e=Object.getPrototypeOf(n);return e===Object.prototype||e===null}function S(n,e){if(!O(e))return e;let r=O(n)?{...n}:{};for(let s of Object.keys(e)){let i=e[s];r[s]=O(i)?S(r[s],i):i}return r}function M(n){return Array.isArray(n)&&n.length>0&&typeof n[0]!="string"}function x(n,e,r){let s=M(e)?e:[{ids:e,patch:r??{}}],i=n;for(let t of s)for(let o of P(i,t.ids)){let c=i[o];if(!c)continue;let a=S(c,t.patch);i===n&&(i={...n}),i[o]=a}return i}function J(n){return{style:{material:n}}}var A=new Set(["__proto__","constructor","prototype"]),I=(n,e)=>n<e?-1:n>e?1:0;function f(n){throw new Error(`Invalid product: ${n}`)}var g=n=>!!n&&typeof n=="object"&&!Array.isArray(n),y=n=>typeof n=="string"&&n.length>0&&n.length<=200&&!A.has(n),h=n=>typeof n=="string"&&n.trim().length>0&&n.length<=500;function D(n){let e=0;function r(s,i){return(++e>1e5||i>32)&&f("definition is too complex."),s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"&&Number.isFinite(s)?s:Array.isArray(s)?s.map(t=>r(t,i+1)):(g(s)||f("expected JSON data."),Object.fromEntries(Object.entries(s).filter(([,t])=>t!==void 0).map(([t,o])=>(A.has(t)&&f("reserved property name."),[t,r(o,i+1)]))))}return r(n,0)}function q(n){if(typeof n!="string"||n.length>2048)return!1;try{return["http:","https:"].includes(new URL(n.replace(/\{[a-zA-Z]+\}/g,"x")).protocol)}catch{return!1}}function C(n){let e=D(typeof n=="string"?JSON.parse(n):n);(!g(e)||!y(e.id)||!h(e.label)||!y(e.revision)||!Array.isArray(e.groups)||!e.groups.length||e.groups.length>64)&&f("id, label, revision, and 1\u201364 option groups are required.");let r=new Map;for(let i of e.groups){(!g(i)||!y(i.id)||r.has(i.id)||!h(i.label)||i.required!==void 0&&typeof i.required!="boolean"||!Array.isArray(i.options)||!i.options.length||i.options.length>128)&&f("groups need unique ids, labels, and 1\u2013128 options.");let t=new Set;r.set(i.id,t);for(let o of i.options)if((!g(o)||!y(o.id)||t.has(o.id)||!h(o.label)||o.sku!==void 0&&!h(o.sku))&&f("options need unique ids and labels."),t.add(o.id),o.description!==void 0&&!h(o.description)&&f("an option description must be text."),o.swatch!==void 0&&!(typeof o.swatch=="string"&&/^#[0-9a-f]{3,8}$/i.test(o.swatch))&&f("a swatch must be a hex color."),o.priceDeltaMinor!==void 0&&!Number.isSafeInteger(o.priceDeltaMinor)&&f("a price change must be a whole number of minor units."),o.variants!==void 0&&(!Array.isArray(o.variants)||o.variants.some(c=>!h(c)))&&f("variant names must be strings."),o.appearance!==void 0){(!Array.isArray(o.appearance)||o.appearance.length>128)&&f("invalid appearance edits.");for(let c of o.appearance){g(c)||f("invalid appearance edit.");let a=c.target;typeof a=="string"&&a||Array.isArray(a)&&a.every(u=>typeof u=="string"&&!!u)||g(a)&&Object.keys(a).length===1&&["group","tag","type"].some(u=>typeof a[u]=="string")||f("appearance needs an object id, id list, or selector."),c.visible!==void 0&&typeof c.visible!="boolean"&&f("visibility must be boolean."),c.material!==void 0&&!g(c.material)&&f("material must be an object.");for(let u of Object.values(c.material??{}))typeof u=="string"||typeof u=="number"||typeof u=="boolean"||u===null||g(u)&&typeof u.path=="string"&&(u.offset===void 0||Array.isArray(u.offset)&&u.offset.length===2&&u.offset.every(d=>typeof d=="number"))||f("invalid material field.")}}i.defaultOptionId!==void 0&&!t.has(i.defaultOptionId)&&f("a default must name an option in its group."),i.display!==void 0&&!["list","chips","swatches"].includes(i.display)&&f("a group's display must be list, chips or swatches.")}e.pricing!==void 0&&!(g(e.pricing)&&/^[A-Z]{3}$/.test(e.pricing.currency)&&Number.isSafeInteger(e.pricing.basePriceMinor)&&e.pricing.basePriceMinor>=0)&&f("pricing needs a 3-letter currency and a base price of zero or more."),e.checkout!==void 0&&(!g(e.checkout)||e.checkout.label!==void 0&&!h(e.checkout.label)||!q(e.checkout.urlTemplate))&&f("a checkout link needs an http or https URL.");let s=i=>g(i)&&typeof i.groupId=="string"&&typeof i.optionId=="string"&&!!r.get(i.groupId)?.has(i.optionId);if(e.rules!==void 0){(!Array.isArray(e.rules)||e.rules.length>2048)&&f("invalid rules.");let i=new Set;for(let t of e.rules){(!g(t)||!y(t.id)||i.has(t.id)||!s(t.when)||t.message!==void 0&&!h(t.message))&&f("rules need unique ids and valid option references."),i.add(t.id),["requires","excludes"].some(o=>Array.isArray(t[o])&&t[o].length>0)||f("a rule needs a requires or excludes constraint.");for(let o of["requires","excludes"])t[o]!==void 0&&(!Array.isArray(t[o])||t[o].length>128||!t[o].every(s))&&f("rule references must name existing options.")}}if(e.skus!==void 0){(!Array.isArray(e.skus)||e.skus.length>4096)&&f("invalid SKU table.");let i=new Set;for(let t of e.skus){(!g(t)||!h(t.sku)||!g(t.selections)||Object.keys(t.selections).length!==r.size)&&f("SKU mappings need one selection per group.");for(let[c,a]of Object.entries(t.selections))(!r.has(c)||a!==null&&!r.get(c).has(a))&&f("SKU mapping references an unknown option.");let o=JSON.stringify(Object.entries(t.selections).sort(([c],[a])=>I(c,a)));i.has(o)&&f("a combination can map to only one SKU."),i.add(o)}}return{id:e.id,label:e.label,revision:e.revision,groups:e.groups.map(i=>({id:i.id,label:i.label,...i.required!==void 0?{required:i.required}:{},...i.defaultOptionId!==void 0?{defaultOptionId:i.defaultOptionId}:{},...i.display!==void 0?{display:i.display}:{},options:i.options.map(t=>({id:t.id,label:t.label,...t.sku!==void 0?{sku:t.sku}:{},...t.description!==void 0?{description:t.description}:{},...t.swatch!==void 0?{swatch:t.swatch}:{},...t.priceDeltaMinor!==void 0?{priceDeltaMinor:t.priceDeltaMinor}:{},...t.variants!==void 0?{variants:t.variants}:{},...t.appearance!==void 0?{appearance:t.appearance.map(o=>({target:o.target,...o.material!==void 0?{material:o.material}:{},...o.visible!==void 0?{visible:o.visible}:{}}))}:{}}))})),...e.rules!==void 0?{rules:e.rules.map(i=>({id:i.id,when:i.when,...i.requires?{requires:i.requires}:{},...i.excludes?{excludes:i.excludes}:{},...i.message?{message:i.message}:{}}))}:{},...e.skus!==void 0?{skus:e.skus.map(i=>({sku:i.sku,selections:i.selections}))}:{},...e.pricing!==void 0?{pricing:{currency:e.pricing.currency,basePriceMinor:e.pricing.basePriceMinor}}:{},...e.checkout!==void 0?{checkout:{urlTemplate:e.checkout.urlTemplate,...e.checkout.label!==void 0?{label:e.checkout.label}:{}}}:{}}}function w(n){return Object.fromEntries(n.groups.map(e=>[e.id,e.defaultOptionId??null]))}function E(n,e){let r=[];for(let s of n.groups){if(e[s.id]===null)continue;let i=s.options.find(t=>t.id===e[s.id])?.sku;if(!i)return null;r.push(i)}return r.length?r.join("-"):null}function m(n,e=w(n),r=1){if(!Number.isSafeInteger(r)||r<1||r>9999)throw new Error("Quantity must be an integer from 1 to 9999.");if(!g(e)||Object.values(e).some(d=>d!==null&&typeof d!="string"))throw new Error("Product selections must map group ids to option ids or null.");let s=[],i=[...n.groups].sort((d,l)=>I(d.id,l.id)),t=Object.fromEntries(i.map(d=>[d.id,!Object.prototype.hasOwnProperty.call(e,d.id)||e[d.id]===void 0?d.defaultOptionId??null:e[d.id]]));for(let d of Object.keys(e).sort())n.groups.some(l=>l.id===d)||s.push({code:"unknown-group",groupIds:[d],message:`Unknown option group: ${d}.`});let o=[];for(let d of i){let l=t[d.id],p=d.options.find(b=>b.id===l);l!==null&&!p?s.push({code:"unknown-option",groupIds:[d.id],message:`Unknown choice for ${d.label}: ${l}.`}):d.required&&l===null&&s.push({code:"required",groupIds:[d.id],message:`Choose ${d.label}.`}),p&&o.push({groupId:d.id,optionId:p.id,label:p.label,...p.sku?{sku:p.sku}:{}})}let c=d=>n.groups.find(l=>l.id===d.groupId)?.options.find(l=>l.id===d.optionId)?.label??d.optionId;for(let d of[...n.rules??[]].sort((l,p)=>I(l.id,p.id)))if(t[d.when.groupId]===d.when.optionId){for(let l of d.requires??[])t[l.groupId]!==l.optionId&&s.push({code:"requires",ruleId:d.id,groupIds:[...new Set([d.when.groupId,l.groupId])],message:d.message??`${c(d.when)} requires ${c(l)}.`});for(let l of d.excludes??[])t[l.groupId]===l.optionId&&s.push({code:"excludes",ruleId:d.id,groupIds:[...new Set([d.when.groupId,l.groupId])],message:d.message??`${c(d.when)} cannot be combined with ${c(l)}.`})}let a=n.skus?.length?n.skus.find(d=>i.every(l=>d.selections[l.id]===t[l.id]))?.sku??null:E(n,t);n.skus?.length&&!a&&!s.length&&s.push({code:"sku",groupIds:i.map(d=>d.id),message:"This combination has no product SKU."});let u=JSON.stringify({productId:n.id,revision:n.revision,quantity:r,selections:t});return{version:1,productId:n.id,revision:n.revision,key:u,quantity:r,selections:t,sku:a,items:o,valid:!s.length,issues:s}}var T=new Set(["requires","excludes"]);function R(n,e,r,s,i=1){let t={...m(n,e,i).selections,[r]:s},o=new Set([JSON.stringify(t)]),c=[t];for(let a=0;a<c.length&&a<2e3;a++){let u=c[a],d=m(n,u,i).issues.filter(l=>T.has(l.code));if(!d.length)return u;for(let l of new Set(d.flatMap(p=>p.groupIds))){if(l===r)continue;let p=n.groups.find(b=>b.id===l);if(p)for(let b of[...p.options.map(k=>k.id),...p.required?[]:[null]]){let k={...u,[l]:b},v=JSON.stringify(k);o.has(v)||(o.add(v),c.push(k))}}}return null}function U(n,e,r,s,i){let t=R(n,e,r,s,i);return t?Object.entries(t).filter(([o,c])=>o!==r&&c!==e[o]&&c!==null).map(([o,c])=>({groupId:o,optionId:c})):null}function W(n,e){if(!n.pricing)return null;let r=n.pricing.basePriceMinor;for(let s of e.items)r+=n.groups.find(i=>i.id===s.groupId)?.options.find(i=>i.id===s.optionId)?.priceDeltaMinor??0;return{amountMinor:Math.max(0,r)*e.quantity,currency:n.pricing.currency}}function Z(n,e,r=!1){try{let s=new Intl.NumberFormat(void 0,{style:"currency",currency:e,...r?{signDisplay:"exceptZero"}:{}});return s.format(n/10**(s.resolvedOptions().maximumFractionDigits??2))}catch{return`${n} ${e}`}}function L(n,e){let r=n.checkout?.urlTemplate;if(!r||!e.valid||r.includes("{sku}")&&!e.sku)return null;let s={sku:e.sku??"",quantity:String(e.quantity),productId:n.id,revision:n.revision,selections:$(e.selections)};return r.replace(/\{([a-zA-Z]+)\}/g,(i,t)=>Object.prototype.hasOwnProperty.call(s,t)?encodeURIComponent(s[t]):i)}function $(n){return Object.entries(n).filter(([,e])=>e!==null).map(([e,r])=>`${encodeURIComponent(e)}:${encodeURIComponent(r)}`).join(",")}function Q(n,e){let r={...w(e)};for(let s of n.split(",")){let[i,t]=s.split(":");if(!i||!t)continue;let o,c;try{o=decodeURIComponent(i),c=decodeURIComponent(t)}catch{continue}e.groups.find(a=>a.id===o)?.options.some(a=>a.id===c)&&(r[o]=c)}return r}var B=4096;function X(n,e="-"){let r=[{}];for(let t of n.groups){let o=[...t.options.map(c=>c.id),...t.required?[]:[null]];if(r.length*o.length>B*8)throw new Error("This product has too many combinations to list. Use a pricing service to resolve SKUs instead.");r=r.flatMap(c=>o.map(a=>({...c,[t.id]:a})))}let s={...n,skus:void 0},i=[];for(let t of r){if(m(s,t).issues.length)continue;let o=n.groups.flatMap(c=>{let a=t[c.id];return a===null?[]:[c.options.find(u=>u.id===a)?.sku??null]});if(!(!o.length||o.includes(null))&&(i.push({sku:o.join(e),selections:t}),i.length>B))throw new Error("This product has too many combinations to list. Use a pricing service to resolve SKUs instead.")}return i}function H(n,e={},r){let s=[],i=w(n),t=m({...n,skus:void 0},i).issues.filter(c=>T.has(c.code));for(let c of t)s.push({code:"invalid-default",message:`The default choices conflict: ${c.message}`});n.checkout?.urlTemplate.includes("{sku}")&&!n.skus?.length&&n.groups.some(c=>c.options.some(a=>!a.sku))&&s.push({code:"missing-sku",message:"The buy link uses {sku}, but it won't appear until every option has an SKU."});let o=Object.keys(e).length>0;for(let c of n.groups)for(let a of c.options){let u=`${c.label} \u203A ${a.label}`,d={groupId:c.id,optionId:a.id};if(o)for(let p of a.appearance??[])P(e,p.target).length||s.push({code:"no-objects",message:`${u} changes objects that aren't in this model.`,...d});if(r)for(let p of a.variants??[])r.includes(p)||s.push({code:"missing-variant",message:`${u} uses a material variant this model doesn't have: ${p}.`,...d});let l={...i,[c.id]:a.id};R(n,l,c.id,a.id)||s.push({code:"unreachable",message:`The rules leave no way to choose ${u}.`,...d})}return s}function Y(n,e,r,s=1){return e=m(n,e,s).selections,n.groups.flatMap(i=>i.options.map(t=>{let c=m(n,{...e,[i.id]:t.id},s).issues.filter(d=>d.groupIds.includes(i.id)&&d.code!=="sku").map(d=>d.message),a=r?.options?.find(d=>d.groupId===i.id&&d.optionId===t.id);a?.available===!1&&c.push(a.reason??"Currently unavailable.");let u=c.length&&a?.available!==!1?U(n,e,i.id,t.id,s):null;return{groupId:i.id,optionId:t.id,selected:e[i.id]===t.id,available:!c.length,...u?{fix:u}:{},reasons:[...new Set(c)]}}))}function ee(n){g(n)||f("expected a product definition and selections.");let e=C(n.definition),r=m(e,n.selections??w(e));return r.issues.some(s=>s.code==="unknown-group"||s.code==="unknown-option")&&f("selections reference unknown options."),{definition:e,selections:r.selections}}function ne(n){return JSON.stringify({version:1,productId:n.productId,revision:n.revision,quantity:n.quantity,selections:n.selections})}function ie(n,e){let r=D(typeof n=="string"?JSON.parse(n):n);if(!g(r)||r.version!==1||r.productId!==e.id||r.revision!==e.revision)throw new Error("This configuration belongs to a different product or revision.");if(!g(r.selections)||!Number.isSafeInteger(r.quantity))throw new Error("Invalid product configuration selections or quantity.");let s=m(e,r.selections,r.quantity);if(s.issues.some(i=>i.code==="unknown-group"||i.code==="unknown-option"))throw new Error("This configuration references unknown product options.");return s}function te(n,e,r=[],s=[]){let i=n,t=[...r];if(!e)return{objectBindings:i,activeVariants:t};for(let o of e.definition.groups){let c=o.options.find(a=>a.id===(e.selections[o.id]===void 0?o.defaultOptionId:e.selections[o.id]));if(c){for(let a of c.appearance??[])i=x(i,a.target,{...a.material!==void 0?{style:{material:a.material}}:{},...a.visible!==void 0?{visible:a.visible}:{}});if(c.variants?.length){let a=new Set(o.options.flatMap(u=>u.variants??[]));t=t.filter(u=>!a.has(u));for(let u of c.variants)t=j(t,u,s)}}}return{objectBindings:i,activeVariants:t}}export{S as a,x as b,J as c,C as d,w as e,m as f,R as g,W as h,Z as i,L as j,$ as k,Q as l,X as m,H as n,Y as o,ee as p,ne as q,ie as r,te as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Vector3 as o}from"three";function f(t){if(!t?.trim()||/[\u0000-\u001f\u007f]/.test(t))return null;try{let n=new URL(t.trim(),"https://annotation.invalid/");return n.protocol==="https:"||n.protocol==="http:"?t.trim():null}catch{return null}}function i(t){return t.category?.trim()??""}function c(t,n){if(n===null)return t;let e=new Set(n.map(r=>r.trim()));return t.filter(r=>e.has(i(r)))}function l(t,n){let e=Number.isFinite(t.minDistance)?Math.max(0,t.minDistance):0,r=Number.isFinite(t.maxDistance)?Math.max(0,t.maxDistance):1/0;return n>=e&&n<=r}function a(t){return!!t&&[t.position,t.target].every(n=>Array.isArray(n)&&n.length===3&&n.every(Number.isFinite))}function p(t){let n=t.camera;return{position:t.getPosition(new o,!1).toArray(),target:t.getTarget(new o,!1).toArray(),azimuthAngle:t.azimuthAngle,polarAngle:t.polarAngle,fov:"fov"in n?Number(n.fov):null,zoom:n.zoom}}function s(t,n){a(n)&&(t.setLookAt(...n.position,...n.target,!0),Number.isFinite(n.azimuthAngle)&&Number.isFinite(n.polarAngle)&&t.rotateTo(n.azimuthAngle,n.polarAngle,!0),m(t,n))}function m(t,n){let e=!1;n.fov!=null&&Number.isFinite(n.fov)&&n.fov>0&&n.fov<180&&"fov"in t.camera&&(t.camera.fov=n.fov,t.camera.updateProjectionMatrix(),e=!0),n.zoom!=null&&Number.isFinite(n.zoom)&&n.zoom>0&&t.zoomTo(n.zoom,!0),e&&t.dispatchEvent({type:"update"})}export{f as a,i as b,c,l as d,a as e,p as f,s as g,m as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useLayoutEffect as y,useRef as x,useState as g}from"react";import{createPortal as T}from"react-dom";import{ChevronRight as P,Info as H}from"lucide-react";import{HexColorInput as I,HexColorPicker as S}from"react-colorful";import{useEffect as L}from"react";function w(e,n,t){L(()=>{if(!t)return;let a=Array.isArray(e)?e:[e],s=i=>{let o=i.target;a.some(u=>u.current?.contains(o))||n()};return document.addEventListener("pointerdown",s,!0),()=>{document.removeEventListener("pointerdown",s,!0)}},[e,n,t])}import{jsx as r,jsxs as c}from"react/jsx-runtime";function M({anchorRef:e,onClose:n,children:t}){let a=x(null),[s,i]=g(null);return w([a,e],n,!0),y(()=>{let o=e.current;if(!o)return;let l=o.getBoundingClientRect(),u=222,p=8,d=Math.min(Math.max(l.right-u,p),window.innerWidth-u-p),b=Math.min(l.bottom+6,window.innerHeight-200);i({top:b,left:d})},[e]),s?T(r("div",{ref:a,className:"se-colorPickerPopover",style:{position:"fixed",top:s.top,left:s.left},children:t}),document.body):null}function F(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function G({label:e,title:n,path:t,children:a}){return c("div",{className:"se-field se-fieldInline","data-ri-path":t,children:[r("span",{className:"se-fieldLabel",title:n??e,children:e}),a]})}function U({children:e}){return r("div",{className:"rui-actions",children:e})}function W({title:e,children:n}){return c("div",{className:"se-listHeader",children:[r("span",{children:e}),n?r("span",{className:"se-listHeaderActions",children:n}):null]})}function _({title:e,actions:n,children:t}){return c("div",{className:"rui-group",children:[c("div",{className:"rui-groupHeader",children:[r("span",{children:e}),n]}),t]})}function q({title:e,children:n}){return c("section",{className:"se-section",children:[r("h3",{className:"se-sectionTitle",children:e}),r("div",{className:"se-sectionBody",children:n})]})}function J({title:e,open:n,onToggle:t,trailing:a,children:s,disabled:i,tooltip:o}){return c("section",{className:"se-panel","data-ri-section":e,children:[c("div",{className:"se-panelHeaderRow",children:[c("button",{type:"button",className:"se-panelHeader",onClick:t,"aria-expanded":n,title:o,children:[r(P,{size:13,className:`se-panelChevron ${n?"se-panelChevron--open":""}`}),r("span",{className:"se-panelTitle",children:e}),o?r(H,{size:11,className:"se-panelHelp","aria-hidden":"true"}):null]}),a?r("span",{className:"se-panelTrailing",children:a}):null]}),n?r("div",{className:`se-panelBody ${i?"se-panelBody--disabled":""}`,children:s}):null]})}function Q({checked:e,onChange:n,label:t}){return c("label",{className:"se-switch","aria-label":t,children:[r("input",{type:"checkbox",checked:e,onChange:a=>n(a.target.checked)}),r("span",{className:"se-switchTrack",children:r("span",{className:"se-switchThumb"})})]})}function k(e){return e>=1||!Number.isFinite(e)?0:Math.min(6,Math.ceil(-Math.log10(e)-1e-9))}function N(e,n,t){let a=e;return n!==void 0&&Number.isFinite(n)&&(a=Math.max(n,a)),t!==void 0&&Number.isFinite(t)&&(a=Math.min(t,a)),a}function $({value:e,step:n,min:t,max:a,disabled:s,onChange:i}){return{onPointerDown(o){if(s||o.button!==0)return;o.preventDefault();let l=o.currentTarget;l.setPointerCapture(o.pointerId);let u=o.clientX,p=e,d=k(n),b=v=>{let h=(v.clientX-u)*n*(v.shiftKey?10:1);i(N(Number((p+h).toFixed(d)),t,a))},f=()=>{l.removeEventListener("pointermove",b),l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",f)};l.addEventListener("pointermove",b),l.addEventListener("pointerup",f),l.addEventListener("pointercancel",f)}}}function D({label:e,value:n,min:t,max:a,step:s,formatValue:i,onChange:o,disabled:l=!1,unset:u=!1}){let[p,d]=g(!1),[b,f]=g(""),v=a>t?N((n-t)/(a-t)*100,0,100):0,h=u?"\u2013":i?i(n):String(Number(n.toFixed(k(s)))),C=()=>{l||(f(String(n)),d(!0))},R=()=>{let m=Number(b);b.trim()!==""&&Number.isFinite(m)&&o(m),d(!1)};return p?r("input",{className:"rui-sliderInput",type:"number","aria-label":e,autoFocus:!0,step:s,value:b,onFocus:m=>m.currentTarget.select(),onChange:m=>f(m.target.value),onBlur:R,onKeyDown:m=>{m.key==="Enter"&&R(),m.key==="Escape"&&(m.stopPropagation(),d(!1))}}):c("div",{className:`rui-slider ${l?"rui-slider--disabled":""}`,children:[r("i",{className:"rui-sliderFill",style:{width:`${v}%`}}),r("span",{className:"rui-sliderValue",children:h}),r("input",{type:"range","aria-label":e,min:t,max:a,step:s,value:N(n,t,a),disabled:l,onChange:m=>o(Number(m.target.value)),onDoubleClick:C,onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),C())}})]})}function ee({label:e,value:n,min:t,max:a,step:s,formatValue:i,onChange:o,disabled:l=!1,path:u}){return c("div",{className:`se-field se-fieldInline ${l?"se-field--disabled":""}`,"data-ri-path":u,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r(D,{label:e,value:n,min:t,max:a,step:s,formatValue:i,onChange:o,disabled:l})]})}function ne({label:e,checked:n,onChange:t,path:a}){return c("label",{className:"se-field se-fieldInline","data-ri-path":a,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r("span",{className:"rui-checkCell",children:r("input",{type:"checkbox",className:"se-checkbox",checked:n,onChange:s=>t(s.target.checked)})})]})}function te({label:e,value:n,options:t,onChange:a,path:s}){return c("label",{className:"se-field se-fieldInline","data-ri-path":s,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r("select",{className:"se-select",value:n,onChange:i=>a(i.target.value),children:t.map(i=>r("option",{value:i,children:F(i)},i))})]})}function V({label:e,value:n,onChange:t}){let[a,s]=g(!1),i=x(null);return c("span",{className:"rui-color",ref:i,children:[r("button",{type:"button",className:"rui-colorSwatch",style:{background:n},"aria-label":`Pick ${e}`,"aria-expanded":a,onClick:()=>s(o=>!o)}),r(I,{prefixed:!0,className:"rui-colorHex","aria-label":e,color:n,onChange:t}),a?r(M,{anchorRef:i,onClose:()=>s(!1),children:r(S,{color:n,onChange:t})}):null]})}function ae({label:e,value:n,onChange:t,path:a}){return c("div",{className:"se-field se-fieldInline","data-ri-path":a,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r(V,{label:e,value:n,onChange:t})]})}function O({value:e,min:n,max:t,step:a,label:s,onChange:i}){let[o,l]=g(String(e)),u=x(!1);return y(()=>{u.current||l(String(e))},[e]),r("input",{type:"number",className:"se-numberInput","aria-label":s,min:n,max:t,step:a,value:o,onFocus:()=>{u.current=!0},onChange:p=>{let d=p.target.value;l(d),d!==""&&d!=="-"&&!Number.isNaN(Number(d))&&i(Number(d))},onBlur:()=>{u.current=!1,l(String(e))}})}function E({axis:e,label:n,value:t,min:a,max:s,step:i,onChange:o}){let l=$({value:t,step:i,min:a,max:s,onChange:o});return c("span",{className:"se-vectorAxis",children:[r("span",{className:`rui-axis rui-axis--${e.toLowerCase()}`,title:`Drag to change ${e}`,...l,children:e}),r(O,{value:t,min:a,max:s,step:i,label:`${n} ${e}`,onChange:o})]})}function re({label:e,value:n,min:t,max:a,step:s,onChange:i,path:o}){return c("div",{className:"se-field se-fieldInline","data-ri-path":o,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r("div",{className:"se-vectorRow",children:["X","Y","Z"].map((u,p)=>r(E,{axis:u,label:e,value:n[p],min:t,max:a,step:s,onChange:d=>{let b=[...n];b[p]=d,i(b)}},u))})]})}function se({label:e,value:n,min:t,max:a,step:s,onChange:i,path:o}){return c("div",{className:"se-field se-fieldInline","data-ri-path":o,children:[r("span",{className:"se-fieldLabel",title:e,children:e}),r("div",{className:"se-vectorRow se-vectorRow--2",children:["X","Y"].map((u,p)=>r(E,{axis:u,label:e,value:n[p],min:t,max:a,step:s,onChange:d=>{let b=[...n];b[p]=d,i(b)}},u))})]})}export{w as a,G as b,U as c,W as d,_ as e,q as f,J as g,Q as h,$ as i,D as j,ee as k,ne as l,te as m,V as n,ae as o,re as p,se as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var v="KHR_materials_variants",I="riMaterialVariants",N="riMaterialVariantGroups";function o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function S(e){if(!o(e)||!o(e.extensions))return[];let r=e.extensions[v];if(!o(r)||!Array.isArray(r.variants))return[];let n=new Set;return r.variants.map((a,g)=>{let m=o(a)&&typeof a.name=="string"&&a.name?a.name:`Variant ${g+1}`,u=m;for(let b=2;n.has(u);b+=1)u=`${m} (${b})`;return n.add(u),u})}function _(e){let r=e.userData?.gltfExtensions;if(!o(r))return[];let n=r[v];return!o(n)||!Array.isArray(n.mappings)?[]:n.mappings.filter(a=>o(a)&&Number.isInteger(a.material)&&Array.isArray(a.variants)&&a.variants.every(Number.isInteger))}function j(e,r){for(let n=r.length-1;n>=0;n-=1){let a=r[n];if(a<0)continue;let g=e.find(m=>m.variants.includes(a));if(g)return g.material}return null}var P=/^\s*(.+?)\s*(?::|\s\/\s)\s*(.+?)\s*$/;function D(e){let r=Math.min(Math.max(e,0),1),n=r<=.0031308?r*12.92:1.055*r**(1/2.4)-.055;return Math.round(n*255)}function R(e){if(!o(e))return;let r=o(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{};if(r.baseColorTexture!==void 0)return;let n=Array.isArray(r.baseColorFactor)?r.baseColorFactor:[1,1,1,1];if(n.slice(0,3).every(a=>typeof a=="number"))return`#${n.slice(0,3).map(a=>D(a).toString(16).padStart(2,"0")).join("")}`}function T(e,r){if(r.length===0)return[];let n=o(e)?e:{},a=Array.isArray(n.meshes)?n.meshes:[],g=Array.isArray(n.accessors)?n.accessors:[],m=Array.isArray(n.materials)?n.materials:[],u=r.map(()=>new Set),b=r.map(()=>new Map);a.forEach((t,s)=>{(o(t)&&Array.isArray(t.primitives)?t.primitives:[]).forEach((c,i)=>{if(!o(c))return;let p=o(c.extensions)?c.extensions[v]:void 0;if(!o(p)||!Array.isArray(p.mappings))return;let M=o(c.attributes)?c.attributes.POSITION:void 0,A=typeof M=="number"?g[M]:void 0,O=o(A)&&typeof A.count=="number"?A.count:1;for(let d of p.mappings)if(!(!o(d)||!Number.isInteger(d.material)||!Array.isArray(d.variants)))for(let h of d.variants){if(!Number.isInteger(h)||!u[h])continue;u[h].add(`${s}/${i}`);let w=b[h],G=d.material;w.set(G,(w.get(G)??0)+O)}})});let x=r.map((t,s)=>{let l=null;for(let[i,p]of b[s])(l===null||p>(b[s].get(l)??0))&&(l=i);let c=l===null?void 0:R(m[l]);return{name:t,label:t,...c?{swatch:c}:{}}}),y=r.map(()=>-1),f=[],V=new Map;return r.forEach((t,s)=>{let l=P.exec(t);if(!l)return;let[,c,i]=l;V.has(c)||(V.set(c,f.length),f.push({name:c,members:[]})),y[s]=V.get(c),f[y[s]].members.push(s),x[s].label=i}),r.map((t,s)=>s).filter(t=>y[t]<0).sort((t,s)=>+(u[t].size===0)-+(u[s].size===0)).forEach(t=>{let s=f.map((i,p)=>({group:i,groupIndex:p})).filter(({group:i})=>i.name===null&&i.members.some(p=>u[t].size===0||u[p].size===0?!1:[...u[t]].some(M=>u[p].has(M)))).map(({groupIndex:i})=>i);if(s.length===0&&u[t].size===0){let i=f.findIndex(p=>p.name===null);i>=0&&s.push(i)}if(s.length===0){y[t]=f.length,f.push({name:null,members:[t]});return}let[l,...c]=s;for(let i of c){for(let p of f[i].members)y[p]=l;f[l].members.push(...f[i].members),f[i].members=[]}y[t]=l,f[l].members.push(t)}),f.filter(t=>t.members.length>0).sort((t,s)=>Math.min(...t.members)-Math.min(...s.members)).map(t=>({name:t.name,variants:[...t.members].sort((s,l)=>s-l).map(s=>x[s])}))}function L(e,r,n){let a=n.find(m=>m.variants.some(u=>u.name===r)),g=new Set(a?.variants.map(m=>m.name)??[r]);return[...e.filter(m=>!g.has(m)),r]}function $(e){if(Array.isArray(e.activeVariants))return e.activeVariants.filter(n=>typeof n=="string");let r=e.materialVariant;return typeof r=="string"&&r?[r]:[]}function z(e){let r=e.parser,n=S(r?.json);if(!(!r||n.length===0))return e.scene.userData[I]=n,e.scene.userData[N]=T(r.json,n),{names:n,resolveMaterial:async(a,g)=>{let m={geometry:g.geometry,material:await r.getDependency("material",a),isPoints:g.isPoints,isLine:g.isLine};return r.assignFinalMaterial(m),m.material}}}function E(e){let r=e.userData?.[I];return Array.isArray(r)&&r.every(n=>typeof n=="string")?r:[]}function F(e){let r=e.userData?.[N];if(Array.isArray(r))return r;let n=E(e);return n.length>0?[{name:null,variants:n.map(a=>({name:a,label:a}))}]:[]}function B(e,r){let{materialVariant:n,...a}=e;return{...a,activeVariants:r}}export{_ as a,j as b,L as c,$ as d,z as e,E as f,F as g,B as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as d}from"./chunk-GV4ZRXL6.mjs";var g="#ff3b30",S=Object.freeze({}),y=n=>n;function O(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function j(n,t){let e=n.metadata;for(let i of t.split(".")){if(!O(e))return;e=e[i]}return e}function B(n,t){if("metric"in t){let e=n.metrics?.[t.metric];return!(typeof e!="number"||!Number.isFinite(e)||t.above!==void 0&&!(e>t.above)||t.below!==void 0&&!(e<t.below))}if("status"in t){let e=n.status??"normal";return Array.isArray(t.status)?t.status.includes(e):t.status===e}return j(n,t.metadata)===t.equals}function h(n){let t=n.trim().replace(/^#/,""),e=t.length===3?t.split("").map(i=>i+i).join(""):t;return/^[0-9a-f]{6}$/i.test(e)?[0,2,4].map(i=>parseInt(e.slice(i,i+2),16)):null}var p=n=>`#${n.map(t=>Math.round(t).toString(16).padStart(2,"0")).join("")}`;function w(n,t){let e=n.map(([s,o])=>({at:s,rgb:h(o)})).filter(s=>Number.isFinite(s.at)&&s.rgb!==null).sort((s,o)=>s.at-o.at);if(e.length===0||!Number.isFinite(t))return null;if(t<=e[0].at)return p(e[0].rgb);let i=e[e.length-1];if(t>=i.at)return p(i.rgb);let a=e.findIndex(s=>s.at>=t),l=e[a-1],r=e[a],f=r.at===l.at?1:(t-l.at)/(r.at-l.at);return p(l.rgb.map((s,o)=>s+(r.rgb[o]-s)*f))}function k(n,t){if(!t?.length)return{bindings:n,pulses:S,sourceOf:y};let e=new Map,i={};for(let r of t){let f=r.target?d(n,r.target):Object.keys(n),s=r.when?Array.isArray(r.when)?r.when:[r.when]:[];for(let o of f){let m=n[o];if(!s.every(c=>B(m,c)))continue;let u={...r.material};if(r.colorScale){let c=m.metrics?.[r.colorScale.metric],b=typeof c=="number"?w(r.colorScale.stops,c):null;b&&(u={...u,[r.colorScale.channel??"baseColor"]:b})}if(r.pulse){let c=r.pulse===!0?{}:r.pulse;i[o]={color:c.color??g,speed:c.speed!==void 0&&c.speed>0?c.speed:1};let b=u.emissiveIntensity??e.get(o)?.emissiveIntensity??m.style?.material?.emissiveIntensity;b!==void 0&&b>0||(u.emissiveIntensity=1)}Object.keys(u).length>0&&e.set(o,{...e.get(o),...u})}}if(e.size===0)return{bindings:n,pulses:i,sourceOf:y};let a={...n},l=new WeakMap;for(let[r,f]of e){let s=n[r],o={...s,style:{...s.style,material:{...s.style?.material,...f}}};a[r]=o,l.set(o,s)}return{bindings:a,pulses:i,sourceOf:r=>l.get(r)??r}}export{B as a,w as b,k as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o,c as t}from"./chunk-OPDRK3GS.mjs";import{createContext as l,useContext as n,useMemo as a}from"react";import{jsx as d}from"react/jsx-runtime";var i=l(void 0);function V({labels:e,children:r}){return d(i.Provider,{value:e,children:r})}function u(){let e=n(i);return a(()=>Object.assign((r,s)=>o(e,r,s),{message:r=>t(e,r)}),[e])}export{V as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=["other","body","light","wheel","glass","interior","floor","wall","door","furniture","decor","electronics","seat","table","chair","window","sofa","bed","engine","headlight"],t=["normal","hidden","selected","disabled"];export{e as a,t as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Box3 as F,Vector3 as O}from"three";var P=new Set(["KHR_binary_glTF","KHR_draco_mesh_compression","KHR_lights_punctual","KHR_materials_clearcoat","KHR_materials_dispersion","KHR_materials_ior","KHR_materials_sheen","KHR_materials_specular","KHR_materials_transmission","KHR_materials_iridescence","KHR_materials_anisotropy","KHR_materials_unlit","KHR_materials_volume","KHR_texture_basisu","KHR_texture_transform","KHR_mesh_quantization","KHR_materials_emissive_strength","KHR_materials_variants","EXT_materials_bump","EXT_texture_webp","EXT_texture_avif","EXT_meshopt_compression","EXT_mesh_gpu_instancing"]),K=new WeakMap;function ae(e,n){K.set(e,structuredClone(n))}function G(e){let n=K.get(e);return n?structuredClone(n):void 0}function U(e){if(/^(blob|data):/i.test(e))return"Local resource";let n=e.split(/[?#]/,1)[0].replace(/\\/g,"/");return n.slice(n.lastIndexOf("/")+1).slice(0,300)||"Resource"}function V(e){return/^(blob|data):/i.test(e)?"Local resource":e.split(/[?#]/,1)[0].replace(/\\/g,"/").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,"").replace(/^\/+/,"").slice(0,500)||"Resource"}function H(e){let n=t=>typeof t=="number"&&Number.isFinite(t)&&t>=0?t:null;return{...e.format?{format:e.format}:{},...e.name?{name:U(e.name)}:{},sourceBytes:n(e.sourceBytes),loadDurationMs:n(e.loadDurationMs),extensionsUsed:[...new Set(e.extensionsUsed??[])].sort(),extensionsRequired:[...new Set(e.extensionsRequired??[])].sort(),failedResources:[...new Set((e.failedResources??[]).map(V))].slice(0,50)}}function L(e){let n=new Set(e.extensionsRequired);return[...new Set([...e.extensionsUsed??[],...n])].sort().map(t=>({name:t,required:n.has(t),recognized:P.has(t)}))}function X(e,n){let t=e.image,r=m=>typeof m=="number"&&Number.isSafeInteger(m)&&m>0?m:null,a=r(t?.naturalWidth??t?.width),u=r(t?.naturalHeight??t?.height),l=!!e.isCompressedTexture,y=e.mipmaps.reduce((m,g)=>m+(g.data?.byteLength??0),0),c=a&&u?Math.ceil(a*u*4*(e.generateMipmaps?4/3:1)):null;return{name:e.name?U(e.name):n,width:a,height:u,compressed:l,estimatedBytes:l?y||null:c!==null&&Number.isSafeInteger(c)?c:null}}function ue(e,n={}){let t=H({...G(e),...n.source}),r=[],a=new Set,u=new Map,l=new Set,y=new Map,c=new Map,m=new Set,g=new Map,v=0,R=0,T=0,B=0,I=0,b=(s,i)=>{let o=g.get(s)??{count:0,names:[]};o.count++,o.names.length<20&&o.names.push(i||"Unnamed object"),g.set(s,o)},w=s=>{let i=s?.array??s?.data?.array;i?.buffer&&!m.has(i.buffer)&&(m.add(i.buffer),I+=i.buffer.byteLength)};e.traverse(s=>{let i=s;if(!i.isMesh||!i.geometry)return;v++,R+=i.isInstancedMesh?Number.isSafeInteger(i.count)?Math.max(0,i.count??0):0:1;let o=i.geometry,d=o.getAttribute("position"),D=o.getAttribute("uv"),k=i.material?Array.isArray(i.material)?i.material:[i.material]:[];if(!u.has(o)){let p=!!d&&(!Number.isSafeInteger(d.count)||d.count<0);for(let f=0;!p&&d&&f<d.count;f++)if(!Number.isFinite(d.getX(f))||!Number.isFinite(d.getY(f))||!Number.isFinite(d.getZ(f))){p=!0;break}u.set(o,p)}if(u.get(o)&&b("invalid-positions",s.name),d?.count||b("empty-geometry",s.name),D||b("missing-uv",s.name),o.getAttribute("normal")||b("missing-normals",s.name),o.boundingBox&&[...o.boundingBox.min.toArray(),...o.boundingBox.max.toArray()].some(p=>!Number.isFinite(p))&&b("invalid-bounds",s.name),!a.has(o)){a.add(o),T+=Number.isSafeInteger(d?.count)?Math.max(0,d?.count??0):0;let p=o.index?.count??d?.count??0;B+=Number.isSafeInteger(p)?Math.floor(Math.max(0,p)/3):0,Object.values(o.attributes).forEach(w),Object.values(o.morphAttributes).flat().forEach(w),w(o.index)}let j=!1;for(let p of k){l.add(p);let f=y.get(p);if(!f){f=Object.values(p).filter(h=>!!h&&h.isTexture===!0),y.set(p,f);for(let h of f)c.has(h)||c.set(h,`Texture ${c.size+1}`)}for(let h of f){let E=h.channel??0;o.getAttribute(E===0?"uv":`uv${E}`)||(j=!0)}}j&&b("textured-missing-uv",s.name)});let S=(s,i,o,d,D)=>{let k=g.get(s);k&&r.push({code:s,severity:i,title:o,detail:d,suggestion:D,count:k.count,objects:k.names})};S("empty-geometry","error","Empty mesh geometry","Some meshes have no position data.","Remove empty meshes or export their geometry again."),S("invalid-positions","error","Invalid vertex coordinates","Some vertices contain non-finite coordinates.","Repair NaN or infinite vertex positions in the source application, then re-export."),S("invalid-bounds","error","Invalid geometry bounds","Some cached bounds contain non-finite values.","Repair invalid coordinates in the source application and re-export."),S("textured-missing-uv","warning","Textures have no matching UV coordinates","A texture references a UV channel that its mesh does not contain.","Unwrap the affected meshes and export the UV channel used by each texture."),S("missing-uv","info","Meshes without UVs","Solid colors can work without UVs; image textures and surface decals need them.","Add a UV map before applying image textures or decals."),S("missing-normals","info","Meshes without normals","Some loaded meshes lack vertex normals; generated shading may differ from the source.","Export vertex normals to preserve hard edges and smooth surfaces."),v||r.push({code:"no-meshes",severity:"warning",title:"No mesh geometry found",detail:"This scene contains no loaded meshes.",suggestion:"Check that meshes were included in the export. Streamed scenes may still be loading."});let A=[...c].map(([s,i])=>X(s,i)),_=A.filter(s=>(s.width??0)>4096||(s.height??0)>4096);_.length&&r.push({code:"large-textures",severity:"warning",title:"Large texture dimensions",detail:"Some textures exceed 4096 pixels on one side.",suggestion:"Resize textures for the visible detail needed; use KTX2/Basis where appropriate.",count:_.length,objects:_.slice(0,20).map(s=>s.name)}),B>1e6&&r.push({code:"high-triangle-count",severity:"warning",title:"High geometry count",detail:"The loaded geometry contains more than one million unique triangles.",suggestion:"Simplify hidden detail, create lower-detail exports, or use streamed assets for large scenes."}),l.size>100&&r.push({code:"many-materials",severity:"warning",title:"Many material definitions",detail:"More than 100 materials can increase rendering work.",suggestion:"Reuse materials and atlas compatible textures; inspect runtime draw calls to confirm the cost."});let N=L(t);for(let s of N.filter(i=>!i.recognized))r.push({code:"unrecognized-extension",severity:s.required?"error":"warning",title:`${s.required?"Required":"Optional"} extension not recognized`,detail:s.name,suggestion:"Export with extensions supported by the bundled loader, or verify the asset's fallback appearance."});t.failedResources?.length&&r.push({code:"failed-resources",severity:"error",title:"Some resources failed to load",detail:"The model may be missing textures or other referenced resources.",suggestion:"Include sidecar files in the ZIP, correct their paths, and check HTTP access and CORS.",count:t.failedResources.length,objects:t.failedResources.slice(0,20)});let z=null,M=[...u.values()].some(Boolean)?new F:new F().setFromObject(e);!M.isEmpty()&&[...M.min.toArray(),...M.max.toArray(),...M.getSize(new O).toArray()].every(Number.isFinite)&&(z={min:M.min.toArray(),max:M.max.toArray(),center:M.getCenter(new O).toArray(),size:M.getSize(new O).toArray()}),n.scope==="resident-tiles"&&r.unshift({code:"partial-stream",severity:"info",title:"Loaded tiles only",detail:"Geometry and texture counts cover the current resident tiles, not the entire source asset.",suggestion:"Use the live cache/detail statistics to inspect streaming pressure. Rescan after moving the camera."});let C=s=>s.code==="partial-stream"?-1:s.severity==="error"?0:s.severity==="warning"?1:2;return r.sort((s,i)=>C(s)-C(i)),{version:1,status:"ready",scope:n.scope??"asset",source:t,units:t.format==="glb"||t.format==="gltf"?"meters (glTF convention)":"unknown",bounds:z,statistics:{meshes:v,instances:R,geometries:a.size,materials:l.size,textures:c.size,vertices:T,triangles:B,geometryBytes:I,estimatedTextureBytes:A.reduce((s,i)=>s+(i.estimatedBytes??0),0),unknownTextureSizes:A.filter(s=>s.estimatedBytes===null).length,meshesWithoutUvs:g.get("missing-uv")?.count??0,meshesWithoutNormals:g.get("missing-normals")?.count??0},textures:A,extensions:N,issues:r}}function ce(e={}){return{version:1,status:"failed",scope:"asset",source:H(e),units:"unknown",bounds:null,statistics:null,textures:[],extensions:L(e),issues:[{code:"load-failed",severity:"error",title:"Asset could not be loaded",detail:"Geometry and textures could not be inspected.",suggestion:"Check the file format, required decoders, sidecar paths, HTTP access and CORS, then reload the asset."}]}}import{Matrix4 as q,Vector3 as Y}from"three";function Z(e){return e.isSkinnedMesh===!0}function fe(e){let n=[];return e.traverse(t=>{Z(t)&&n.push(t)}),n}var x="reactImmersiveSkinFreeze";function ge(e){return!!e.userData[x]}function Me(e,n,t=[n]){let r=e.userData,a=new q().copy(n).invert(),u=r[x];if(u){u.frozenInverse.copy(a),u.restWorldTransforms=t.map(c=>c.clone()),e.bindMatrixInverse.copy(a);return}let l={frozenInverse:a,restWorldTransforms:t.map(c=>c.clone()),previousOnBeforeRender:e.onBeforeRender,previousUpdateMatrixWorld:Object.prototype.hasOwnProperty.call(e,"updateMatrixWorld")?e.updateMatrixWorld:void 0};e.bindMatrixInverse.copy(a);let y=e.updateMatrixWorld;e.updateMatrixWorld=function(c){y.call(this,c),e.bindMatrixInverse.copy(l.frozenInverse)},e.onBeforeRender=function(c,m,g,v,R,T){l.previousOnBeforeRender.call(this,c,m,g,v,R,T),e.bindMatrixInverse.copy(l.frozenInverse)},r[x]=l}function $(e){return e.userData[x]?.frozenInverse??null}function he(e){return e.userData[x]?.restWorldTransforms??null}function xe(e){let n=e.userData,t=n[x];t&&(e.onBeforeRender=t.previousOnBeforeRender,t.previousUpdateMatrixWorld?e.updateMatrixWorld=t.previousUpdateMatrixWorld:delete e.updateMatrixWorld,delete n[x],e.updateMatrixWorld(!0))}function ye(e){let n=e,t=$(e);t&&n.bindMatrixInverse.copy(t),n.skeleton?.update?.();let r=n.geometry.clone(),a=r.getAttribute("position");if(a){let u=new Y;for(let l=0;l<a.count;l++)n.getVertexPosition(l,u),a.setXYZ(l,u.x,u.y,u.z);a.needsUpdate=!0}return r.deleteAttribute("skinIndex"),r.deleteAttribute("skinWeight"),r.morphAttributes={},r.morphTargetsRelative=!1,r.computeVertexNormals(),r.computeBoundingBox(),r.computeBoundingSphere(),r}function be(e){return e.matrixWorld.clone()}import{AdditiveBlending as J,BackSide as Q,DoubleSide as ee,FrontSide as te,NoColorSpace as ne,NormalBlending as re,SRGBColorSpace as se,Vector2 as W}from"three";function De(e){let n=!0;return e?.traverse(t=>{let r=t.isMesh?t.geometry:null;r&&!r.getAttribute("uv")&&(n=!1)}),n}function Oe(e){return!!(e&&typeof e=="object"&&"clone"in e&&"color"in e&&"metalness"in e&&"roughness"in e)}function Ie(e){return!!(e&&typeof e=="object"&&"isMeshPhysicalMaterial"in e&&e.isMeshPhysicalMaterial)}function Ne(e){return!!(e&&"isMesh"in e&&e.isMesh)}var ze=["texture","metalnessMap","roughnessMap","emissiveMap","alphaMap","normalMap","bumpMap","aoMap","displacementMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","anisotropyMap","transmissionMap","thicknessMap","sheenColorMap","sheenRoughnessMap","specularIntensityMap","specularColorMap"],Ce={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"},ie=new Set(["texture","emissiveMap","sheenColorMap","specularColorMap"]);function je(e){return ie.has(e)?se:ne}function Ee(e,n){return e?.[n]?.path}function Fe(e,n){let t=e?.[n]?.offset;if(!t)return;let[r,a]=t;if(!(!Number.isFinite(r)||!Number.isFinite(a)))return r===0&&a===0?void 0:[r,a]}function Ke(e,n){let t=e?.[n]?.scale;if(!(!Number.isFinite(t)||!t))return t===1?void 0:t}function Ue(e,n){let t=e?.[n]?.rotation;if(!(!Number.isFinite(t)||!t))return t}function He(e){return e==="back"?Q:e==="double"?ee:te}function Le(e){return e==="additive"?J:re}function We(e,n=1,t=n){if(e&&typeof e=="object"){let r=e;if(typeof r.x=="number"&&Number.isFinite(r.x)&&typeof r.y=="number"&&Number.isFinite(r.y))return new W(r.x,r.y)}return new W(n,t)}function Pe(e){return Number.isFinite(e)&&e>0?e:1}function Ge(e,n){return e?.animations.clips.find(t=>t.sourceName===n)}function Ve(e){return e?.loopMode??"repeat"}export{Z as a,fe as b,ge as c,Me as d,$ as e,he as f,xe as g,ye as h,be as i,ae as j,G as k,U as l,V as m,ue as n,ce as o,De as p,Oe as q,Ie as r,Ne as s,ze as t,Ce as u,je as v,Ee as w,Fe as x,Ke as y,Ue as z,He as A,Le as B,We as C,Pe as D,Ge as E,Ve as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-7JCFNZJM.mjs";function c(e,i){return n(e,i)}var t={type:"point",color:"#ffffff",intensity:1,position:[0,0,0],distance:0,decay:2,attachedToCamera:!1,castShadow:!1,shadowBias:-5e-4,visible:!0};function r(e){return{...t,...e}}function s(e){return e}export{c as a,r as b,s as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={free:0,starter:1,growth:2};function p(e){return e==="starter"||e==="growth"?e:"free"}function n(e,t){return i[e]>=i[t]}var o={free:"Free",starter:"Starter",growth:"Growth"};var a={advancedMaterials:"starter",materialVariants:"starter",customEnvironment:"starter",backgroundImages:"starter",sectionPlanes:"starter",calibratedMeasurements:"starter",animationConfig:"starter",sceneBundle:"starter",cinematic:"starter",rules:"growth",postLighting:"starter",postSelection:"growth",productCommerce:"starter"};function b(e,t){return n(e,a[t])}var u={decalsPerObject:{free:1,starter:1/0,growth:1/0},lights:{free:3,starter:1/0,growth:1/0},annotations:{free:3,starter:1/0,growth:1/0},sequences:{free:1,starter:1/0,growth:1/0},selectionSets:{free:3,starter:1/0,growth:1/0},models:{free:1,starter:3,growth:1/0},productGroups:{free:2,starter:1/0,growth:1/0}};function d(e,t,r){return r<u[t][e]}function y(e,t){return["free","starter","growth"].find(r=>d(r,e,t))??"growth"}import{createContext as c,useContext as l}from"react";var g=c({isInsideEditor:!1,activeTab:"object",activeSubTab:"model",tier:"free"});var h=()=>l(g);import{Lock as T}from"lucide-react";import{jsx as f,jsxs as s}from"react/jsx-runtime";function R({requiredTier:e,feature:t}){return s("div",{className:"bb-tierLock",children:[f(T,{size:16}),s("p",{className:"bb-tierLockMessage",children:[t," requires the ",o[e]," plan or higher."]})]})}export{p as a,o as b,b as c,u as d,d as e,y as f,g,h,R as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as y,useId as E,useRef as b}from"react";import{X as N}from"lucide-react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var h='button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';function L({title:m,icon:v,onCancel:a,children:g,footer:p}){let d=E(),t=b(null),l=b(a);return l.current=a,y(()=>{let r=document.activeElement;t.current?.contains(document.activeElement)||t.current?.focus();let c=e=>{if(e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),l.current()),e.key!=="Tab"||!t.current)return;let i=Array.from(t.current.querySelectorAll(h)),s=i[0],u=i[i.length-1],n=document.activeElement;e.shiftKey&&(n===s||n===t.current)?(e.preventDefault(),u?.focus()):!e.shiftKey&&n===u&&(e.preventDefault(),s?.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),r?.focus?.()}},[]),o("div",{className:"bb-dialogBackdrop",onMouseDown:r=>{r.target===r.currentTarget&&a()},children:f("div",{ref:t,className:"bb-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,tabIndex:-1,children:[f("div",{className:"bb-dialogHeader",children:[v,o("h3",{id:d,children:m}),o("button",{type:"button",className:"bb-dialogClose",onClick:a,"aria-label":"Close dialog",children:o(N,{size:14})})]}),o("div",{className:"bb-dialogBody",children:g}),o("div",{className:"bb-dialogFooter",children:p})]})})}export{L as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(n,e){if(n[e])return e;let i=Object.entries(n).find(([,t])=>t.id===e)?.[0];return i||(Object.entries(n).find(([,t])=>t.modelObjectId===e)?.[0]??null)}function o(n){return typeof n=="object"&&!Array.isArray(n)}function g(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 d(n,e){if(o(e))return Object.entries(n).filter(([,t])=>g(t,e)).map(([t])=>t);let r=(typeof e=="string"?[e]:e).map(t=>c(n,t)).filter(t=>t!==null);return[...new Set(r)]}function l(n,e){return d(n,e).map(i=>n[i]).filter(i=>i!==void 0)}export{c as a,d as b,l as c};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{b as oe}from"./chunk-DEFZEXTA.mjs";import{C as P,a as ne,e as se,j as z,l as le,m as ce,q as de,r as pe}from"./chunk-EV6THDXD.mjs";import{e as ae,f as ie,g as ue}from"./chunk-BNKTI3CY.mjs";import{strFromU8 as vt,strToU8 as gt,unzip as yt}from"fflate";var fe;function me(e){fe=e}function M(e){fe?.(e)}var Mt=[".glb",".gltf",".obj",".fbx",".usdz",".stl",".ply",".zip"],wt=["model/gltf-binary","model/gltf+json","model/vnd.usdz+zip","application/vnd.usdz+zip","application/zip","application/x-zip-compressed"],w=1024*1024,be=128*w,he=1024,ve=128*w,ge=256*w,ye=200,xt=w,b=new Map,Pn=".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 U(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 Se(e){return b.get(e)??{format:U(e)}}function St(e){let t=e.name.toLowerCase();return Mt.some(r=>t.endsWith(r))||wt.includes(e.type)}async function Rn(e){if(!St(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 Me(e,"usdz");if(t.endsWith(".zip")||Lt(e.type))return Pt(e);if(t.endsWith(".gltf")||e.type==="model/gltf+json")return we(e);let r=U(e.name);return r==="gltf"?we(e):Me(e,r)}function Me(e,t){let r=URL.createObjectURL(e);return b.set(r,{format:t,entryPath:e.name,sourceBytes:e.size}),{url:r,name:e.name,format:t,cleanup:()=>{M(r),b.delete(r),URL.revokeObjectURL(r)}}}function Lt(e){return e==="application/zip"||e==="application/x-zip-compressed"}async function we(e){let t=await e.text(),r=Le(t,e.name);for(let s of Pe(r))if(!I(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,sourceBytes:e.size}),{url:n,name:e.name,format:"gltf",cleanup:()=>{M(n),b.delete(n),URL.revokeObjectURL(n)}}}async function Pt(e){if(e.size>be)throw new Error(`Model zip is too large. The compressed archive must be ${G(be)} or smaller.`);let t=await Rt(new Uint8Array(await e.arrayBuffer())),r=new Map;for(let[i,a]of Object.entries(t)){let u=F(i);!u||Re(u)||r.set(u,a)}let n=[...r.keys()].filter(i=>/\.(gltf|obj|fbx|stl|ply)$/i.test(i));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=U(s);if(o==="gltf")return Dt(e,s,r);if(o==="obj"||o==="fbx"||o==="stl"||o==="ply")return At(e,s,o,r);throw new Error(`Unsupported model entry ${s}.`)}function Rt(e){return new Promise((t,r)=>{let n=0,s=0,o=null,i=u=>(o??(o=new Error(`Invalid model zip: ${u}`)),!1);yt(e,{filter:u=>{if(o)return!1;if(n+=1,n>he)return i(`archive contains more than ${he.toLocaleString()} entries.`);if(u.originalSize>ve)return i(`${u.name} expands beyond the ${G(ve)} per-file limit.`);if(s+=u.originalSize,s>ge)return i(`expanded contents exceed ${G(ge)}.`);if(u.originalSize>=xt&&(u.size===0||u.originalSize/u.size>ye))return i(`${u.name} exceeds the ${ye}:1 compression-ratio limit.`);let l=F(u.name);return!!l&&!Re(l)}},(u,l)=>{o?r(o):u?r(new Error(`Invalid model zip: ${u.message}`)):t(l)})})}function G(e){return`${e/w} MiB`}function At(e,t,r,n){let s=[],o={};for(let[a,u]of n){let l=URL.createObjectURL(new Blob([u],{type:Ae(a)}));s.push(l),o[a]=l}let i=o[t];if(!i)throw s.forEach(a=>URL.revokeObjectURL(a)),new Error(`Invalid model zip: could not read ${t}.`);return b.set(i,{format:r,entryPath:t,resourceUrls:o}),{url:i,name:e.name,format:r,cleanup:()=>{M(i),b.delete(i),s.forEach(a=>URL.revokeObjectURL(a))}}}function Dt(e,t,r){let n=r.get(t);if(!n)throw new Error("Invalid GLTF zip: no .gltf found.");let s=Le(vt(n),t);Et(s,t);let o=Bt(t),i=[];try{xe(s.buffers,o,r,i),xe(s.images,o,r,i);let a=new Blob([gt(JSON.stringify(s))],{type:"model/gltf+json"}),u=URL.createObjectURL(a);return i.push(u),b.set(u,{format:"gltf",entryPath:t}),{url:u,name:e.name,format:"gltf",cleanup:()=>{M(u),b.delete(u),i.forEach(l=>URL.revokeObjectURL(l))}}}catch(a){throw i.forEach(u=>URL.revokeObjectURL(u)),a}}function xe(e,t,r,n){for(let s of e??[]){if(typeof s.uri!="string"||I(s.uri))continue;let o=Tt(t,s.uri),i=r.get(o);if(!i)throw new Error(`Invalid GLTF zip: missing referenced asset ${s.uri}.`);let a=URL.createObjectURL(new Blob([i],{type:Ae(o)}));n.push(a),s.uri=a}}function Le(e,t){try{return JSON.parse(e)}catch{throw new Error(`${t} is not a valid .gltf JSON file.`)}}function Pe(e){return[...e.buffers??[],...e.images??[]].map(t=>t.uri).filter(t=>typeof t=="string"&&t.length>0)}function Et(e,t){for(let r of Pe(e)){if(I(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 I(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 Re(e){let t=e.split("/");return e.endsWith("/")||t.includes("__MACOSX")||t.some(r=>r===".DS_Store"||r.startsWith("._"))}function Bt(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Tt(e,t){let r=t.split(/[?#]/)[0],n=Ct(r);return F(e?`${e}/${n}`:n)}function Ct(e){try{return decodeURI(e)}catch{return e}}function Ae(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{Box3 as kt,BufferAttribute as Ot,Mesh as zt}from"three";import{acceleratedRaycast as Gt,computeBoundsTree as Ut,disposeBoundsTree as It,MeshBVH as Ft}from"three-mesh-bvh";var De=!1,v=new WeakMap,x=new WeakMap;function jt(){De||(zt.prototype.raycast=Gt,De=!0)}function Wt(e){let t=new Set;return e.traverse(r=>{let n=r.geometry;!n||!n.attributes?.position||t.add(n)}),[...t]}function Ee(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 Be=12e6;function Bn(e){return _t(e)>Be}function _t(e){let t=new Set;return e.traverse(r=>{let n=r.geometry;n?.attributes?.position&&t.add(n)}),Ee([...t])}function Nt(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:d}=c,p=Ft.deserialize(d,t,{setIndex:!1});d.index&&(t.index?t.index.array=d.index:t.setIndex(new Ot(d.index,1,!1))),t.boundingBox=p.getBoundingBox(new kt),r(p)},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 i=t.index?t.index.array.slice():null,a=t.attributes.position.array.slice(),u=[a,...i?[i]:[]].map(l=>l.buffer);e.postMessage({index:i,position:a,options:{groups:[...t.groups]}},u)})}async function Vt(){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 $t(e,t){if(t)try{return await Nt(t,e)}catch{}let r=Ut.call(e);return e.boundsTree=void 0,await new Promise(n=>setTimeout(n,0)),r}async function Ht(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&&v.delete(e)}),t.buildPromise}async function Tn(e,t){if(t?.aborted)return;let r=x.get(e);if(!r){if(r=Wt(e),Ee(r)>Be){x.set(e,[]);return}x.set(e,r);for(let s of r){let o=v.get(s)??{references:0};o.references+=1,v.set(s,o)}}if(r.length===0)return;jt();let n=await Vt();if(t?.aborted){n?.dispose();return}try{for(let s of r){if(t?.aborted)return;let o=v.get(s);o&&await Ht(s,o,()=>$t(s,n?.worker))}}finally{n?.dispose()}}function Cn(e){let t=x.get(e);if(t){x.delete(e);for(let r of t){let n=v.get(r);n&&(n.references=Math.max(0,n.references-1),!(n.references>0)&&(n.ownedTree&&r.boundsTree===n.ownedTree&&(It.call(r),r.boundsTree=void 0),n.ownedTree=void 0,n.buildPromise||v.delete(r)))}}}import{useEffect as W,useMemo as Xt,useRef as Zt,useState as Kt}from"react";import{Box3 as Oe,Color as _,DoubleSide as Yt,ShaderMaterial as Jt,Vector3 as qt}from"three";import{useThree as Qt}from"@react-three/fiber";var Te="riEditorGizmo",j=new WeakMap;function Ce(e){return e.userData[Te]=!0,e}function Gn(e,t){let r=j.get(e);return r||(r=new Set,j.set(e,r)),r.add(t),()=>{r.delete(t)}}function Un(e){let t=[],r=n=>{n.visible=!1,t.push(n)};return e.traverse(n=>{n.visible&&n.userData[Te]&&r(n)}),j.get(e)?.forEach(n=>{n.visible&&r(n)}),()=>{for(let n of t)n.visible=!0}}function ke(e){return!Number.isFinite(e)||e<=0?1:10**Math.floor(Math.log10(e/10))}import{jsx as ze}from"react/jsx-runtime";var er=`
|
|
2
|
+
varying vec3 vWorld;
|
|
3
|
+
void main() {
|
|
4
|
+
vec4 world = modelMatrix * vec4(position, 1.0);
|
|
5
|
+
vWorld = world.xyz;
|
|
6
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
7
|
+
}
|
|
8
|
+
`,tr=`
|
|
9
|
+
uniform float uCell;
|
|
10
|
+
uniform float uMajor;
|
|
11
|
+
uniform float uFade;
|
|
12
|
+
uniform vec3 uLine;
|
|
13
|
+
uniform vec3 uAxisX;
|
|
14
|
+
uniform vec3 uAxisZ;
|
|
15
|
+
uniform bool uLinearTarget;
|
|
16
|
+
varying vec3 vWorld;
|
|
17
|
+
|
|
18
|
+
float lines(vec2 position, float size, vec2 width) {
|
|
19
|
+
vec2 scaled = position / size;
|
|
20
|
+
vec2 pixels = width / size;
|
|
21
|
+
vec2 distanceToLine = abs(fract(scaled - 0.5) - 0.5) / max(pixels, vec2(1e-6));
|
|
22
|
+
return 1.0 - min(min(distanceToLine.x, distanceToLine.y), 1.0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
void main() {
|
|
26
|
+
vec2 position = vWorld.xz;
|
|
27
|
+
vec2 width = fwidth(position);
|
|
28
|
+
float minorFade = 1.0 - smoothstep(0.15, 0.45, max(width.x, width.y) / uCell);
|
|
29
|
+
float majorFade = 1.0 - smoothstep(0.15, 0.45, max(width.x, width.y) / uMajor);
|
|
30
|
+
float alpha = max(lines(position, uCell, width) * 0.11 * minorFade,
|
|
31
|
+
lines(position, uMajor, width) * 0.3 * majorFade);
|
|
32
|
+
vec3 color = uLine;
|
|
33
|
+
|
|
34
|
+
float onX = 1.0 - min(abs(position.y) / max(width.y, 1e-6), 1.0);
|
|
35
|
+
float onZ = 1.0 - min(abs(position.x) / max(width.x, 1e-6), 1.0);
|
|
36
|
+
if (onX > 0.0) { color = mix(color, uAxisX, onX); alpha = max(alpha, onX * 0.7); }
|
|
37
|
+
if (onZ > 0.0) { color = mix(color, uAxisZ, onZ); alpha = max(alpha, onZ * 0.7); }
|
|
38
|
+
|
|
39
|
+
alpha *= 1.0 - smoothstep(uFade * 0.15, uFade, distance(cameraPosition, vWorld));
|
|
40
|
+
if (alpha < 0.004) discard;
|
|
41
|
+
// Post-processing blends in linear color, where a faint line comes out far
|
|
42
|
+
// brighter than the same alpha blended on the canvas. Selecting an object
|
|
43
|
+
// turns that pipeline on, so without this the grid would jump in brightness.
|
|
44
|
+
gl_FragColor = vec4(color, uLinearTarget ? pow(alpha, 2.2) : alpha);
|
|
45
|
+
#include <colorspace_fragment>
|
|
46
|
+
}
|
|
47
|
+
`,rr=()=>{};function Hn({getTarget:e,revision:t,lineColor:r}){let n=Qt(c=>c.invalidate),[s,o]=Kt({y:0,size:10}),i=Zt(null);W(()=>{i.current&&Ce(i.current)},[]),W(()=>{let c=e();if(!c)return;let d=c instanceof Oe?c:new Oe().setFromObject(c);if(d.isEmpty())return;let p=d.getSize(new qt);o({y:d.min.y,size:Math.max(p.x,p.y,p.z)}),n()},[e,t,n]);let a=Xt(()=>new Jt({vertexShader:er,fragmentShader:tr,transparent:!0,depthWrite:!1,side:Yt,uniforms:{uCell:{value:1},uMajor:{value:5},uFade:{value:100},uLinearTarget:{value:!1},uLine:{value:new _},uAxisX:{value:new _("#e5484d")},uAxisZ:{value:new _("#3e8bff")}}}),[]);W(()=>()=>a.dispose(),[a]);let u=ke(s.size);a.uniforms.uCell.value=u,a.uniforms.uMajor.value=u*5,a.uniforms.uFade.value=s.size*12,a.uniforms.uLine.value.set(r);let l=s.size*40;return ze("mesh",{ref:i,rotation:[-Math.PI/2,0,0],position:[0,s.y-s.size*5e-4,0],raycast:rr,renderOrder:-1,frustumCulled:!1,material:a,onBeforeRender:c=>{let d=c.getRenderTarget()!==null;a.uniforms.uLinearTarget.value!==d&&(a.uniforms.uLinearTarget.value=d,a.uniformsNeedUpdate=!0)},children:ze("planeGeometry",{args:[l,l]})})}import{useThree as N}from"@react-three/fiber";import{useEffect as Ie}from"react";import{useEffect as nr,useState as sr}from"react";function R(e){return!!e?.isWebGPURenderer}var Ge;function or(){return Ge??(Ge=(async()=>{let e=typeof navigator>"u"?void 0:navigator.gpu;if(!e)return!1;try{return!!await e.requestAdapter()}catch{return!1}})()),Ge}var Ue=!1;function Yn(e){let[t,r]=sr(null);return nr(()=>{if(!e)return;let n=!1;return or().then(s=>{n||(!s&&!Ue&&(Ue=!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 Jn(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 rs({captureRef:e}){let{gl:t,scene:r,camera:n,invalidate:s,get:o}=N();return Ie(()=>{if(!e)return;let i=()=>{let a=o();a.advance(a.frameloop==="never"?a.clock.elapsedTime:performance.now())};return e.current={gl:t,scene:r,camera:n,invalidate:s,drawNow:i},()=>{e.current=null}},[e,t,r,n,s,o]),null}function ns(){let e=N(r=>r.frameloop),t=N(r=>r.invalidate);return Ie(()=>{e!=="never"&&t()},[e,t]),null}function ss(e){e.dispose(),"forceContextLoss"in e&&!R(e)&&(e.forceContextLoss(),e.forceContextLoss=()=>{})}function os(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 br,useState as hr}from"react";import{useEffect as ar,useState as Fe}from"react";var ir="200px",je=new Map;function We(e,t,r){let n=je.get(t);if(!n){let i=new Map;n={observer:new IntersectionObserver(u=>{for(let l of u)i.get(l.target)?.(l.isIntersecting)},{rootMargin:t}),watchers:i},je.set(t,n)}let{observer:s,watchers:o}=n;return o.set(e,r),s.observe(e),()=>{o.delete(e),s.unobserve(e)}}function _e(e){let t=typeof IntersectionObserver<"u",[r,n]=Fe(!t),[s,o]=Fe(!t);return ar(()=>{let i=e.current;if(!i||!t)return;let a=We(i,ir,n),u=We(i,"0px",o);return()=>{a(),u()}},[e,t]),{near:r,visible:s}}import{useEffect as Ne,useRef as Ve,useState as cr}from"react";function V(){return typeof navigator>"u"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function ur(){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 ls(){return V()||ur()}function lr(){if(typeof window>"u"||typeof navigator>"u")return!1;let e=i=>typeof window.matchMedia=="function"&&window.matchMedia(i).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=V();return t||o||n&&r||n&&s}function $(){if(!lr())return!1;if(V())return!0;let e=navigator.deviceMemory;return!(typeof e=="number"&&e>=8)}function cs(e="auto"){switch(e){case"high":return!1;case"low":return!0;default:return $()}}function dr(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 pr=12,fr=6,A=new Map,mr=1,H=!1,$e;function He(){H||(H=!0,queueMicrotask(()=>{H=!1,$e??($e=$()?fr:pr);let e=dr([...A.values()],$e);for(let t of A.values()){let r=e.has(t.id);r!==t.live&&(t.live=r,t.onLiveChange(r))}}))}function Xe({managed:e,wanted:t,visible:r,onPark:n}){let[s,o]=cr(!1),i=Ve(n);i.current=n;let a=Ve(null);return Ne(()=>{if(!e)return;let u={id:mr++,wanted:!1,visible:!1,live:!1,since:performance.now(),onLiveChange:l=>{l||i.current?.(),o(l)}};return A.set(u.id,u),a.current=u,()=>{A.delete(u.id),a.current=null,o(!1),He()}},[e]),Ne(()=>{let u=a.current;!u||u.wanted===t&&u.visible===r||(u.wanted!==t&&(u.since=performance.now()),u.wanted=t,u.visible=r,He())},[e,t,r]),e?s:t}function gs({loading:e="lazy",reveal:t="auto",rootRef:r,onPark:n}){let{near:s,visible:o}=_e(r),[i,a]=hr(t==="auto");return br(()=>{t==="auto"&&a(!0)},[t]),{live:Xe({managed:e==="lazy",wanted:i&&(e==="eager"||s),visible:o,onPark:n}),visible:o,awaitingReveal:!i,reveal:()=>a(!0)}}import{Box as vr}from"lucide-react";import{jsx as X,jsxs as Ze}from"react/jsx-runtime";function gr({src:e,hidden:t=!1}){return e?X("img",{className:`ri-poster${t?" ri-poster--hidden":""}`,src:e,alt:"","aria-hidden":"true",draggable:!1,decoding:"async"}):null}function Ps({className:e,background:t,poster:r,onReveal:n}){let s=oe();return Ze("div",{className:`${e} ri-viewerPlaceholder`,style:{background:t},children:[X(gr,{src:r}),n?Ze("button",{type:"button",className:"ri-revealButton",onClick:n,children:[X(vr,{size:16,"aria-hidden":"true"}),s("viewIn3D")]}):null]})}import{BufferGeometry as yr,Float32BufferAttribute as Mr,Group as Ye,Mesh as Z,MeshStandardMaterial as wr}from"three";import{STLLoader as xr}from"three/examples/jsm/loaders/STLLoader.js";import{PLYLoader as Sr}from"three/examples/jsm/loaders/PLYLoader.js";var Lr=12106948,Je="This PLY file is a point cloud: it has vertices but no faces.",D=class extends Error{constructor(){super(Je),this.name="PointCloudError"}};function Ts(e){return e instanceof D||e instanceof Error&&e.message.includes(Je)}function qe(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 K(e){return new wr({color:e?16777215:Lr,vertexColors:e,metalness:0,roughness:.6})}function Ke(e,t,r){let n=e.itemSize;return new Mr(e.array.slice(t*n,(t+r)*n),n)}function Qe(e,t){let r=new xr().parse(e),n=!!r.hasColors,s=new Ye;if(r.groups.length>1){let a=r.userData.groupNames??[],u=r.getAttribute("position"),l=r.getAttribute("normal");return r.groups.forEach((c,d)=>{let p=new yr;p.setAttribute("position",Ke(u,c.start,c.count)),l&&p.setAttribute("normal",Ke(l,c.start,c.count));let f=new Z(p,K(!1));f.name=a[d]?.trim()||`${t} ${d+1}`,s.add(f)}),r.dispose(),s}r.clearGroups();let o=K(n);n&&r.alpha!==void 0&&r.alpha<1&&(o.opacity=r.alpha,o.transparent=!0);let i=new Z(r,o);return i.name=t,s.add(i),s}function Pr(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 et(e,t){if(!Pr(e))throw new D;let r=new Sr().parse(e);r.getAttribute("normal")||r.computeVertexNormals();let n=new Z(r,K(!!r.getAttribute("color")));n.name=t;let s=new Ye;return s.add(n),s}import{useEffect as Rr,useState as Ar}from"react";var Y=80,Dr=99,Er=6e3,Br=200;function Tr(e,t=0){let r=Math.min(Math.max(e,0),100);return r<100?r/100*Y:Y+(Dr-Y)*(1-Math.exp(-t/Er))}function Os(e,t=!1){let r=e!==null&&e>=100&&!t,[n,s]=Ar(0);return Rr(()=>{if(!r){s(0);return}let o=performance.now(),i=setInterval(()=>s(performance.now()-o),Br);return()=>clearInterval(i)},[r]),e===null?null:t?100:Tr(e,n)}import{useFrame as S,useThree as h}from"@react-three/fiber";import{ContactShadows as Cr}from"@react-three/drei";import{useXR as tt}from"@react-three/xr";import{Color as kr,PerspectiveCamera as Or}from"three";import{useEffect as g,useLayoutEffect as nt,useRef as E}from"react";import{Fragment as Gr,jsx as rt,jsxs as Ur}from"react/jsx-runtime";function _s({renderMode:e,suspended:t=!1}){let{scene:r}=h(),n=h(a=>a.setFrameloop),s=tt(a=>a.session!=null),o=tt(a=>a.mode==="immersive-ar"),i=E(void 0);return g(()=>{n(t?"never":s?"always":e)},[s,e,t,n]),g(()=>{o?(i.current=r.background,r.background=null):i.current!==void 0&&(r.background=i.current,i.current=void 0)},[o,r]),S(()=>{o&&r.background!==null&&(r.background=null)}),null}function Ns({onPresentingChange:e}){let t=h(s=>s.gl),r=E(null);g(()=>{let s=t.xr;if(!s)return;let o=u=>{u?(r.current=t.shadowMap.enabled,t.shadowMap.enabled=!1):r.current!==null&&(t.shadowMap.enabled=r.current,r.current=null),e(u)},i=()=>o(!0),a=()=>o(!1);return s.addEventListener("sessionstart",i),s.addEventListener("sessionend",a),o(s.isPresenting),()=>{s.removeEventListener("sessionstart",i),s.removeEventListener("sessionend",a)}},[t,e]);let n=E(0);return S(()=>{if(!t.xr.isPresenting)return;let s=performance.now();if(s-n.current<1e3)return;n.current=s;let o=t.xr}),null}function Vs({active:e}){let t=h(r=>r.invalidate);return g(()=>{e&&t()},[e,t]),S(()=>{e&&t()}),null}function $s(e){let t=h(n=>n.gl),r=E(t.autoClear);return S(()=>{r.current=t.autoClear,t.autoClear=!0},-1),Ur(Gr,{children:[rt(Cr,{...e}),rt(zr,{saved:r})]})}function zr({saved:e}){let t=h(r=>r.gl);return S(()=>{t.autoClear=e.current}),null}function Hs({color:e}){let{scene:t,invalidate:r}=h();return nt(()=>(t.background=e?new kr(e):null,r(),()=>{t.background=null}),[t,e,r]),null}function Xs({rotation:e}){let{scene:t,invalidate:r}=h();return nt(()=>{let n=e*Math.PI/180;t.environmentRotation.set(0,n,0),t.backgroundRotation.set(0,n,0)}),g(()=>{r()},[e,r]),null}function Zs({cameraConfig:e}){let{camera:t,invalidate:r}=h();return g(()=>{if(!(t instanceof Or))return;let n=e?.fov;typeof n=="number"&&t.fov!==n&&(t.fov=n,t.updateProjectionMatrix(),r())},[t,e,r]),null}import{useLoader as ut,useThree as Zr}from"@react-three/fiber";import{FileLoader as lt,Loader as Kr,LoadingManager as Yr}from"three";import{FBXLoader as Jr,GLTFLoader as qr,MTLLoader as Qr,OBJLoader as en}from"three-stdlib";import{USDLoader as tn}from"three/examples/jsm/loaders/USDLoader.js";import{useGLTF as qs}from"@react-three/drei";import{useThree as eo}from"@react-three/fiber";import{useMemo as ro}from"react";import{SRGBColorSpace as Ir}from"three";import{DRACOLoader as Fr,KTX2Loader as jr,MeshoptDecoder as Wr}from"three-stdlib";function _r(e){return{name:"RI_unlit_emissive_texture",async afterRoot(t){let r=e.json.materials??[],n=new Map;if(r.forEach(o=>{let i=!!o?.extensions?.KHR_materials_unlit,a=!!o?.pbrMetallicRoughness?.baseColorTexture;i&&!a&&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,i])=>{let a=await e.getDependency("texture",i);a&&(a.colorSpace=Ir,s.set(o,a))})),t.scene.traverse(o=>{let i=Array.isArray(o.material)?o.material:o.material?[o.material]:[];for(let a of i){let u=a.name?s.get(a.name):void 0;u&&!a.map&&(a.map=u,a.needsUpdate=!0)}})}}}var Nr="https://assets.react-immersive.liveroom.dev/three-r184/draco/",Vr="https://assets.react-immersive.liveroom.dev/three-r184/basis/";function $r(e,t){if(!R(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}var st=new Map,ot=new WeakMap;function Hr(e){let t=st.get(e);return t||(t=new Fr,t.setDecoderPath(e),st.set(e,t)),t}function Xr(e,t){let r=ot.get(t);r||(r=new Map,ot.set(t,r));let n=r.get(e);return n||(n=$r(new jr().setTranscoderPath(e),t),r.set(e,n)),n}function at(e,t={},r){let{dracoDecoderPath:n=Nr,ktx2TranscoderPath:s=Vr,meshopt:o=!0}=t;n&&e.setDRACOLoader(Hr(n)),o&&e.setMeshoptDecoder(Wr),s&&r&&e.setKTX2Loader(Xr(s,r)),e.register((i=>_r(i)))}var T=class extends Kr{constructor(){super(...arguments);this.options={source:{format:"glb"}}}configure(r){return this.options=r,this}load(r,n,s,o){let i=performance.now(),a={format:this.options.source.format,name:this.options.source.entryPath??le(r),sourceBytes:this.options.source.sourceBytes??null,failedResources:[]},u=l=>{a.sourceBytes===null&&l.lengthComputable&&l.total>0&&(a.sourceBytes=l.total),s?.(l)};this.loadAsset(r,u,a).then(l=>{a.loadDurationMs=Math.max(0,performance.now()-i),z(l.scene,a),n(l)}).catch(l=>{a.loadDurationMs=Math.max(0,performance.now()-i),l&&typeof l=="object"&&z(l,a),o?.(l)})}async loadAsset(r,n,s){let o=sn(this.options.source);o.onError=l=>{let c=Object.entries(this.options.source.resourceUrls??{}).find(([,p])=>p===l)?.[0],d=ce(c??l);s.failedResources.includes(d)||s.failedResources.push(d)};let{format:i}=this.options.source;if(i==="obj")return rn(r,o,this.options.source,n);if(i==="fbx"){let l=J(this,new Jr(o)),c=un(r,this.options.source);c&&l.setResourcePath(c);let d=await l.loadAsync(r,n);return B(d,"FBXMesh",!1),{scene:d,animations:d.animations??[]}}if(i==="stl"||i==="ply"){let l=await nn(r,o,n),c=qe(this.options.source.entryPath??r,i==="stl"?"STL model":"PLY model"),d=i==="stl"?Qe(l,c):et(l,c);return B(d,i==="stl"?"STLMesh":"PLYMesh",!0),{scene:d,animations:[]}}if(i==="usdz"){let c=await J(this,new tn(o)).loadAsync(r,n);return B(c,"USDZMesh",!1),{scene:c,animations:c.animations??[]}}let a=J(this,new qr(o));at(a,this.options.decoderConfig,this.options.renderer),a.register(l=>{let c=l.json,d=p=>Array.isArray(p)?p.filter(f=>typeof f=="string"):[];return s.extensionsUsed=d(c.extensionsUsed),s.extensionsRequired=d(c.extensionsRequired),{name:"RI_asset_diagnostics",beforeRoot:()=>null}});let u=await a.loadAsync(r,n);return{scene:u.scene,animations:u.animations??[],materialVariants:ae(u)}}};me(e=>{ut.clear(T,e)});function go(e,t={},r,n){let s=Zr(a=>a.gl),o=Se(e),i=r?{...o,format:r}:o;return ut(T,e,a=>{a.configure({source:i,decoderConfig:t,renderer:s})},n)}async function rn(e,t,r,n){let s=await it(e,t,n),o=new en(t),i=on(s);if(i){let u=an(i,e,r);if(u)try{let l=await it(u.url,t),d=new Qr(t).parse(l,u.basePath);d.preload(),o.setMaterials(d)}catch(l){console.warn(`[react-immersive] Could not load OBJ material ${i}; rendering geometry with fallback materials.`,l)}}let a=o.parse(s);return B(a,"OBJMesh",!0),{scene:a,animations:[]}}function B(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 a=o.name||`${t}_${++s}`;if(!r&&o.name){n.add(o.name);return}let u=a,l=2;for(;n.has(u);)u=`${a}_${l++}`;o.name=u,n.add(u)})}function it(e,t,r){let n=new lt(t);return n.setResponseType("text"),n.loadAsync(e,r)}function nn(e,t,r){let n=new lt(t);return n.setResponseType("arraybuffer"),n.loadAsync(e,r)}function J(e,t){return t.setCrossOrigin(e.crossOrigin),t.setWithCredentials(e.withCredentials),t.setRequestHeader(e.requestHeader),t}function sn(e){let t=new Yr,r=e.resourceUrls;return r&&t.setURLModifier(n=>{if(/^(?:blob:|data:)/i.test(n))return n;let s=k(dt(n).split(/[?#]/)[0]),o=r[s];if(o)return o;let i=C(e.entryPath??""),a=k(i?`${i}/${s}`:s);return r[a]??n}),t}function on(e){return/^\s*mtllib\s+(.+?)\s*$/im.exec(e)?.[1]?.trim()||null}function an(e,t,r){if(r.resourceUrls&&r.entryPath){let n=k(`${C(r.entryPath)}/${dt(e)}`),s=r.resourceUrls[n];if(!s)return null;let o=C(n);return{url:s,basePath:o?`${o}/`:""}}try{let n=new URL(e,t).href;return{url:n,basePath:ct(n)}}catch{return null}}function un(e,t){if(t.resourceUrls&&t.entryPath){let r=C(t.entryPath);return r?`${r}/`:""}return ct(e)}function ct(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t+1)}function C(e){let t=k(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function k(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 dt(e){try{return decodeURI(e)}catch{return e}}import{Color as q,MeshPhysicalMaterial as ln,MeshStandardMaterial as cn,Texture as Q}from"three";function xo(e){if(de(e))return e;if(!e||typeof e!="object")return null;let t=e,r=new cn;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 Q?(r.emissiveMap=t.map,r.emissive.set(16777215)):t.color instanceof q&&r.emissive.copy(t.color)):(t.color instanceof q&&r.color.copy(t.color),t.map instanceof Q&&(r.map=t.map),t.emissive instanceof q&&r.emissive.copy(t.emissive),t.emissiveMap instanceof Q&&(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 So(e){if(pe(e))return e.clone();let t=new ln;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(P(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 Lo(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=P(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=P(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 ee,Matrix4 as dn,Sphere as pn,Vector3 as te}from"three";var pt=new WeakMap,ft=new te,fn=new te,mn=new te,bn=new ee,mt=new dn;function y(e){return"data"in e?e.data.version:e.version}function hn(e){var u;let{geometry:t,skeleton:r}=e,n=t.getAttribute("position"),s=t.getAttribute("skinIndex"),o=t.getAttribute("skinWeight"),i=pt.get(e);if(i?.geometry===t&&i.position===n&&i.indices===s&&i.weights===o&&i.skeleton===r&&i.bindMatrix.equals(e.bindMatrix)&&i.versions[0]===y(n)&&i.versions[1]===y(s)&&i.versions[2]===y(o)&&i.inverses.length===r.boneInverses.length&&i.inverses.every((l,c)=>l.equals(r.boneInverses[c])))return i;let a={geometry:t,position:n,indices:s,weights:o,skeleton:r,versions:[y(n),y(s),y(o)],bindMatrix:e.bindMatrix.clone(),inverses:r.boneInverses.map(l=>l.clone()),bones:[],weightDeviation:0};e:for(let l=0;l<n.count;l++){ft.fromBufferAttribute(n,l).applyMatrix4(e.bindMatrix);let c=0;for(let p=0;p<4;p++){let f=o.getComponent(l,p);if(f===0)continue;let m=s.getComponent(l,p);if(!Number.isFinite(f)||f<0||!Number.isInteger(m)||!r.bones[m]||!a.inverses[m]){a.bones=null;break e}c+=f,((u=a.bones)[m]??(u[m]=new ee)).expandByPoint(fn.copy(ft).applyMatrix4(a.inverses[m]))}let d=Math.abs(c-1);if(d>1e-4){a.bones=null;break}a.weightDeviation=Math.max(a.weightDeviation,d)}return pt.set(e,a),a}function Do(e,{precise:t=!1,updateFallbacks:r=!0}={}){e.updateMatrixWorld(!0),e.traverse(n=>{if(!ne(n))return;let s=n;if(!s.skeleton)return;let o=se(s);o&&s.bindMatrixInverse.copy(o);let a=!!s.geometry.morphAttributes.position?.length?null:hn(s);if(!t&&!a?.bones&&!r&&s.boundingBox&&s.boundingSphere)return;let u=s.boundingBox??(s.boundingBox=new ee),l=s.boundingSphere??(s.boundingSphere=new pn);if(u.makeEmpty(),t||!a?.bones){let c=s.geometry.getAttribute("position");for(let d=0;d<c.count;d++)u.expandByPoint(s.getVertexPosition(d,mn))}else{for(let c=0;c<a.bones.length;c++){let d=a.bones[c];d&&(mt.multiplyMatrices(s.bindMatrixInverse,s.skeleton.bones[c].matrixWorld),u.union(bn.copy(d).applyMatrix4(mt)))}if(!u.isEmpty()){let c=u.min,d=u.max,p=s.bindMatrixInverse.elements,f=Math.max(1,Math.abs(c.x),Math.abs(c.y),Math.abs(c.z),Math.abs(d.x),Math.abs(d.y),Math.abs(d.z)),m=Math.max(Math.abs(c.x-p[12]),Math.abs(d.x-p[12]),Math.abs(c.y-p[13]),Math.abs(d.y-p[13]),Math.abs(c.z-p[14]),Math.abs(d.z-p[14]));u.expandByScalar(a.weightDeviation*m+f*1e-10)}}u.getBoundingSphere(l)})}import{useCallback as bt,useEffect as vn,useRef as gn}from"react";import{useThree as yn}from"@react-three/fiber";function Co(){let e=yn(s=>s.gl.domElement),t=gn(void 0),r=bt(s=>{t.current===void 0&&(t.current=e.style.cursor),e.style.cursor=s},[e]),n=bt(()=>{let s=t.current;s!==void 0&&(e.style.cursor=s,t.current=void 0)},[e]);return vn(()=>()=>{n()},[n]),{setCanvasCursor:r,restoreCanvasCursor:n}}import{Box3 as Mn,Vector3 as ht}from"three";function O(e){return[e.x,e.y,e.z]}function Go(e){let t=new Mn().setFromObject(e),r=0;return e.traverse(n=>{n.isMesh&&(r+=1)}),{bounds:{min:O(t.min),max:O(t.max),center:O(t.getCenter(new ht)),size:O(t.getSize(new ht))},objectCount:r,materialVariants:ie(e),materialVariantGroups:ue(e)}}import{jsx as L,jsxs as re}from"react/jsx-runtime";function Wo({visible:e,title:t,message:r,progress:n}){if(!e)return null;let s=typeof n=="number"&&Number.isFinite(n),o=s?Math.round(Math.min(Math.max(n,0),100)):0;return L("div",{className:"bb-loadingOverlay",role:"status","aria-live":"polite",children:re("div",{className:"bb-loadingCard",children:[re("div",{className:"bb-loadingHeader",children:[L("span",{className:"bb-loadingTitle",title:t??r,children:t??r}),s?re("span",{className:"bb-loadingPercent",children:[o,"%"]}):null]}),L("div",{className:`bb-loadingProgress ${s?"":"bb-loadingProgress--unknown"}`,role:"progressbar","aria-label":t??r,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s?o:void 0,children:L("div",{className:"bb-loadingProgress__bar",style:s?{width:`${o}%`}:void 0})}),t?L("span",{className:"bb-loadingMessage",children:r}):null]})})}export{Ce as a,Gn as b,Un as c,ur as d,ls as e,$ as f,cs as g,Pn as h,U as i,Se as j,Rn as k,Be as l,Bn as m,_t as n,Tn as o,Cn as p,R as q,Yn as r,Jn as s,Hn as t,rs as u,ns as v,ss as w,os as x,gs as y,gr as z,Ps as A,Ts as B,Os as C,_s as D,Ns as E,Vs as F,$s as G,Hs as H,Xs as I,Zs as J,Nr as K,Vr as L,go as M,xo as N,So as O,Lo as P,Do as Q,Co as R,Go as S,Wo as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Color as w}from"three";var A=["position","rotation","scale","visible","baseColor","emissive","opacity","roughness","metalness","emissiveIntensity"],E=["linear","ease-in","ease-out","ease-in-out","step"],V=new Set(["position","rotation","scale"]),T=new Set(["baseColor","emissive"]),d=e=>typeof e=="string"&&e.length>0&&e.length<=256,l=e=>typeof e=="number"&&Number.isFinite(e),S=e=>Array.isArray(e)&&e.length===3&&e.every(l);function y(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function m(e){throw new Error(`Invalid sequences: ${e}`)}function I(e){return e.kind==="object"?JSON.stringify([e.kind,e.objectId,e.property]):e.kind==="clip"?JSON.stringify([e.kind,e.clip]):"camera"}function x(e,o){if(o.kind==="camera")return y(e)&&S(e.position)&&S(e.target)&&(e.fov===null||l(e.fov)&&e.fov>0&&e.fov<180)&&l(e.zoom)&&e.zoom>0;if(o.kind==="clip")return l(e)&&e>=0;let i=o.property;return V.has(i)?S(e)&&(i!=="scale"||e.every(n=>n!==0)):T.has(i)?typeof e=="string"&&/^#[\da-f]{6}$/i.test(e):i==="visible"?typeof e=="boolean":l(e)&&e>=0&&(i==="emissiveIntensity"||e<=1)}function j(e){(!Array.isArray(e)||e.length>64)&&m("expected up to 64 sequences.");let o=new Set,i=0;return e.map(n=>{(!y(n)||!d(n.id)||o.has(n.id)||!(typeof n.name=="string"&&d(n.name.trim()))||!l(n.duration)||n.duration<.1||n.duration>3600||typeof n.loop!="boolean"||typeof n.autoPlay!="boolean"||!Array.isArray(n.tracks)||n.tracks.length>128)&&m("each sequence needs a unique id, name, 0.1\u20133600 second duration, loop/autoplay flags and up to 128 tracks."),o.add(n.id);let s=new Set,u=new Set,c=n.tracks.map(t=>{(!y(t)||!d(t.id)||s.has(t.id)||!(typeof t.name=="string"&&d(t.name.trim()))||!y(t.target)||!Array.isArray(t.keyframes)||t.keyframes.length>2048||t.muted!==void 0&&typeof t.muted!="boolean")&&m("invalid or duplicate track."),s.add(t.id);let a;t.target.kind==="camera"?a={kind:"camera"}:t.target.kind==="clip"&&d(t.target.clip)?a={kind:"clip",clip:t.target.clip}:t.target.kind==="object"&&d(t.target.objectId)&&A.includes(t.target.property)?a={kind:"object",objectId:t.target.objectId,property:t.target.property}:m("unknown track target or property.");let b=I(a);u.has(b)&&m("only one track may own each target property in a sequence."),u.add(b);let q=new Set,v=new Set,h=t.keyframes.map(r=>{++i>2e4&&m("too many keyframes."),(!y(r)||!d(r.id)||q.has(r.id)||!l(r.time)||r.time<0||r.time>n.duration||v.has(r.time)||r.easing!==void 0&&!E.includes(r.easing)||!x(r.value,a))&&m("keyframes need unique ids/times, valid values and times inside the sequence."),q.add(r.id),v.add(r.time);let p=r.value,k=a.kind==="camera"?{position:[...p.position],target:[...p.target],fov:p.fov,zoom:p.zoom}:Array.isArray(r.value)?[...r.value]:r.value;return{id:r.id,time:r.time,value:k,...r.easing?{easing:r.easing}:{}}}).sort((r,p)=>r.time-p.time);return{id:t.id,name:t.name.trim(),target:a,keyframes:h,...t.muted!==void 0?{muted:t.muted}:{}}});return{id:n.id,name:n.name.trim(),duration:n.duration,loop:n.loop,autoPlay:n.autoPlay,tracks:c}})}function C(e,o="ease-in-out"){let i=Math.max(0,Math.min(1,e));return o==="step"?0:o==="ease-in"?i*i:o==="ease-out"?1-(1-i)**2:o==="ease-in-out"?i*i*(3-2*i):i}var f=(e,o,i)=>e+(o-e)*i,g=(e,o,i)=>e.map((n,s)=>f(n,o[s],i));function z(e,o){if(e.muted||!e.keyframes.length||!Number.isFinite(o))return null;let i=e.keyframes;if(o<i[0].time)return null;let n=i[0],s;for(let a of i)if(a.time<=o)n=a;else{s=a;break}if(!s||typeof n.value=="boolean")return structuredClone(n.value);let u=C((o-n.time)/(s.time-n.time),n.easing);if(typeof n.value=="number"&&typeof s.value=="number")return f(n.value,s.value,u);if(typeof n.value=="string"&&typeof s.value=="string")return`#${new w(n.value).lerp(new w(s.value),u).getHexString()}`;if(Array.isArray(n.value)&&Array.isArray(s.value))return g(n.value,s.value,u);let c=n.value,t=s.value;return{position:g(c.position,t.position,u),target:g(c.target,t.target,u),fov:c.fov!==null&&t.fov!==null?f(c.fov,t.fov,u):c.fov,zoom:f(c.zoom,t.zoom,u)}}function N(e,o){return{...e,keyframes:[...e.keyframes.filter(i=>i.id!==o.id&&Math.abs(i.time-o.time)>1e-6),o].sort((i,n)=>i.time-n.time)}}export{A as a,E as b,I as c,x as d,j as e,z as f,N as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk-DEFZEXTA.mjs";import{useSyncExternalStore as m}from"react";import{Pause as q,Play as S,Square as b}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";var y={sequenceId:null,time:0,duration:0,status:"stopped",previewing:!1,ready:!1,issues:[]},c=()=>y,g=()=>()=>{};function p(t){return m(t?.subscribe??g,t?.getState??c,c)}function P({controls:t,duration:n,showScrubber:i=!0,hasTracks:s=!0}){let e=o(),u=p(t),r=u.status==="playing";return l("div",{className:"ri-sequenceTransport",children:[a("button",{type:"button",onClick:()=>r?t?.pause():t?.play(),disabled:!u.ready||!n||!s,"aria-label":e(r?"sequencePause":"sequencePlay"),title:e(r?"sequencePause":"sequencePlay"),children:a("span",{"aria-hidden":"true",children:r?a(q,{size:15}):a(S,{size:15})})}),a("button",{type:"button",onClick:()=>t?.stop(),disabled:!u.previewing,"aria-label":e("sequenceStop"),title:e("sequenceStop"),children:a(b,{size:14,"aria-hidden":"true"})}),i&&a("input",{"aria-label":e("sequencePlayhead"),type:"range",min:0,max:n||1,step:.01,value:Math.min(u.time,n),disabled:!u.ready||!n,onChange:d=>{t?.pause(),t?.seek(Number(d.target.value))}}),l("output",{"aria-label":e("sequenceTime"),children:[u.time.toFixed(2)," / ",n.toFixed(2),"s"]})]})}function v({controls:t,sequences:n}){let i=o(),s=p(t);return n.length?l("section",{className:"ri-sequencePlayer","aria-label":i("sequencePlayer"),onPointerDown:e=>e.stopPropagation(),children:[a("select",{"aria-label":i("sequenceSelect"),value:s.sequenceId??"",onChange:e=>t.select(e.target.value),children:n.map(e=>a("option",{value:e.id,children:e.name},e.id))}),a(P,{controls:t,duration:s.duration,hasTracks:n.find(e=>e.id===s.sequenceId)?.tracks.some(e=>!e.muted&&e.keyframes.length>0)??!1}),!!s.issues.length&&l("details",{children:[a("summary",{children:i("sequenceIssues")}),s.issues.map(e=>a("p",{children:e},e))]})]}):null}export{p as a,P as b,v as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={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",sequencePlayer:"Sequence player",sequenceSelect:"Sequence",sequencePlay:"Play sequence",sequencePause:"Pause sequence",sequenceStop:"Stop and restore scene",sequencePlayhead:"Sequence playhead",sequenceTime:"Sequence time",sequenceIssues:"Unavailable sequence targets",arConfiguredButton:"AR handoff",arConfiguredTitle:"Take this configuration to AR",arConfiguredDescription:"Your current materials, visible models and placements are included.",arSnapshotStale:"Updating AR to include your latest changes\u2026",arPreparing:"Preparing your scene\u2026",arStart:"Start AR",arStarting:"Starting AR\u2026",arCheckingSupport:"Checking AR support\u2026",arUnavailable:"AR is unavailable in this browser. Open this link in an AR-capable browser on your phone.",arStartFailed:"Could not start AR. Check camera permissions and try again.",arRefresh:"Refresh AR",arRetry:"Try again",arExportDetails:"Export details",arPrepare:"Prepare AR",arPrepareAgain:"Prepare again",arDownloadUSDZ:"Download USDZ for iPhone/iPad",arScanConfigured:"Scan to open this configuration on your phone.",arOpenConfiguredLink:"Open configuration link",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:"Pointer lock",cameraController:"Camera controller",cameraControllerSettings:"Camera controller settings",downloadGLB:"Download GLB",downloadGLBDescription:"All visible models, material edits and animations in one file. No annotations or separate editor model slots. Duplicate mesh names may change on reimport.",downloadCombinedGLB:"Download as one GLB",downloadSeparateGLBs:"Download separate GLBs",downloadSeparateGLBsDescription:"One GLB file per model",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",savedMeasurements:"Saved measurements ({count})",noSavedMeasurements:"No saved measurements yet. Pick points in the preview, then save a measurement here.",measurementFiles:"Import / export",measurementSourceUnit:"Model units",measurementDisplayUnit:"Display units",measurementName:"Name",measurementNamePlaceholder:"e.g. Door width",saveMeasurement:"Save",knownMeasurementDistance:"Known length",calibrationUnit:"Calibration unit",calibrateMeasurement:"Calibrate",measurementCalibrationHint:"Pick two distance points, enter their known length, then calibrate.",measurementCalibratedScale:"Calibrated: 1 model unit = {scale} m",resetMeasurementCalibration:"Reset calibration",showSavedMeasurement:"Show {name}",renameSavedMeasurement:"Rename {name}",deleteSavedMeasurement:"Delete {name}",exportMeasurementJson:"Export JSON",exportMeasurementCsv:"Export CSV",importMeasurementJson:"Import JSON",measurementReady:"Ready",measurementApproximate:"Approximate LOD",measurementModelChanged:"Different model",measurementObjectMissing:"Object unavailable",measurementGeometryChanged:"Geometry changed \u2014 measure again",measurementPoseChanged:"Pose changed \u2014 measure again",measurementObjectHidden:"Object hidden",measurementInvalid:"Invalid measurement",measurementWaiting:"Waiting for model",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 color",addText:"Add text",image:"Image",chooseImage:"Choose image",imageToAdd:"Image to add",added:"Added",colour:"Color",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",productOptions:"Options",productOptionsFor:"{product} options",productReset:"Reset",productOptional:"optional",productNone:"None",productAlsoChanges:"Also changes: {changes}",productUnavailable:"Currently unavailable.",productQuantity:"Quantity",productCheckingPrice:"Checking price and availability\u2026",productTotal:"Total",productAddToCart:"Add to cart",productAddingToCart:"Adding\u2026",productRequestQuote:"Request quote",productRequestingQuote:"Requesting\u2026",productRefresh:"Refresh",productBuy:"Buy now",productCopyLink:"Copy link",productLinkCopied:"Link copied",productShowOptions:"Show options",productHideOptions:"Hide options",productIssues:"Configuration issues",productRequestDone:"Request completed.",productSaved:"Saved: {id}",sceneSettings:"Scene Settings",background:"Background",backgroundColor:"Background Color",showEnvironmentAsBackground:"Show as background",backgroundBlur:"Background Blur",environmentPreset:"Preset",environmentIntensity:"Intensity",toneMapping:"Tone Mapping",toneMappingAces:"ACES Filmic",toneMappingAgx:"AgX",toneMappingNeutral:"Neutral",toneMappingNone:"None",ground:"Ground",groundShadow:"Ground Shadow",groundShadowOpacity:"Shadow Opacity",floorGrid:"Floor Grid",display:"Display",wireframe:"Wireframe",autoRotateSpeed:"Rotation Speed",fieldOfView:"Field of View",modelInfo:"Model",modelInfoObjects:"Objects",modelInfoTriangles:"Triangles",modelInfoMaterials:"Materials",resetSettings:"Reset Settings",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 r(o,e,t={}){return(o?.[e]??i[e]).replace(/\{(\w+)\}/g,(a,n)=>Object.prototype.hasOwnProperty.call(t,n)?String(t[n]):a)}var s=new Map(Object.entries(i).map(([o,e])=>[e,o]));function l(o,e){let t=s.get(e);return t?r(o,t):e}export{i as a,r as b,l as c};
|