@volter/editor 0.5.57 → 0.5.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/BUNDLED_NOTICES +6 -6
  2. package/dist/.vite/manifest.json +275 -275
  3. package/dist/assets/{AudioViewer-DILwc7Pt.js → AudioViewer-C5C4xeUl.js} +1 -1
  4. package/dist/assets/{EntityModelDocument-DVlDQ_IJ.js → EntityModelDocument-DyhU8umO.js} +1 -1
  5. package/dist/assets/{EnvironmentAssetDocument-BVGDJjW4.js → EnvironmentAssetDocument-D_VZ2iFj.js} +1 -1
  6. package/dist/assets/{GameplaySessionTimeline-X_nMT8Sa.js → GameplaySessionTimeline-kIIuhFBI.js} +1 -1
  7. package/dist/assets/{ImageViewer-D-aZoyr1.js → ImageViewer-Crv-yzT_.js} +1 -1
  8. package/dist/assets/{InspectorObjectPreview-CpHEw6QH.js → InspectorObjectPreview-CO-GVXfu.js} +1 -1
  9. package/dist/assets/{JsonAssetDocument-CLVN1V9Z.js → JsonAssetDocument-Dtg2QwPN.js} +1 -1
  10. package/dist/assets/{ModelAssetDocument-C60lQ11c.js → ModelAssetDocument-BpZ8SZXe.js} +1 -1
  11. package/dist/assets/{NonThreeAuthoringBootstrap-D8oHDftw.js → NonThreeAuthoringBootstrap-0nm5Hl3v.js} +2 -2
  12. package/dist/assets/{Object3DPreview-CSmLPKkk.js → Object3DPreview-dHzSO5Ym.js} +2 -2
  13. package/dist/assets/{OnlineAssetDetail-D8wVVoay.js → OnlineAssetDetail-DAdWXnmZ.js} +2 -2
  14. package/dist/assets/{SourceAssetViewer-BcOCJ2ye.js → SourceAssetViewer-D3m0wF8T.js} +2 -2
  15. package/dist/assets/{StageHost-B_YrFNiC.js → StageHost-DD_m8W0k.js} +4 -4
  16. package/dist/assets/{ToolObject3DPreview-Crowr7IN.js → ToolObject3DPreview-CWdklUZ1.js} +1 -1
  17. package/dist/assets/{TransientHint-GNwuzA4c.js → TransientHint-aFFUtbSY.js} +1 -1
  18. package/dist/assets/{VideoViewer-CjQ4P9AJ.js → VideoViewer-BhH8aSzx.js} +1 -1
  19. package/dist/assets/{asset-editor-persistence-D3Yy77wZ.js → asset-editor-persistence-D5wYXQEL.js} +1 -1
  20. package/dist/assets/blender-emscripten-engine-BhbEQhcb.js +2 -0
  21. package/dist/assets/{blender-node-editor.document-BfvoBocD.js → blender-node-editor.document-D-hrVHmR.js} +1 -1
  22. package/dist/assets/{blender-outliner-model-B8b00oxr.js → blender-outliner-model-FscHWpfW.js} +1 -1
  23. package/dist/assets/{blender-properties-tab-0M780SHF.js → blender-properties-tab-Czi3_yYZ.js} +3 -3
  24. package/dist/assets/blender-runtime-host-C3rVDyG8.js +4 -0
  25. package/dist/assets/{blender-runtime-skin-DcwXD-m8.js → blender-runtime-skin-AJdtKKnf.js} +3 -3
  26. package/dist/assets/blender-runtime.document-JlYY0bb7.js +8 -0
  27. package/dist/assets/{blender-timeline.document-RtHIpbT1.js → blender-timeline.document-5UN8V20F.js} +1 -1
  28. package/dist/assets/{blender-uv-editor.document-ChwaS3BG.js → blender-uv-editor.document-maFJQzgA.js} +1 -1
  29. package/dist/assets/{blender-version.status-Bnhf8h1I.js → blender-version.status-CukRH8K3.js} +1 -1
  30. package/dist/assets/{blender-wali-engine-C7bet0ss.js → blender-wali-engine-B0Q2w2Be.js} +1 -1
  31. package/dist/assets/blender.command-CY6QiXxp.js +1 -0
  32. package/dist/assets/{browserAll-Do0ehj3Q.js → browserAll-BQIn-DRw.js} +1 -1
  33. package/dist/assets/{edit-mode-authoring-BX4IRQq9.js → edit-mode-authoring-CWTeROGv.js} +1 -1
  34. package/dist/assets/{hosted-asset-materialization-BK7DHisS.js → hosted-asset-materialization-DcthzsYS.js} +1 -1
  35. package/dist/assets/{index-5av5LJja.js → index-DmtPt6RQ.js} +348 -348
  36. package/dist/assets/{models.finder-Bm1YfG95.js → models.finder-CrDJ41Cp.js} +1 -1
  37. package/dist/assets/{product-Ywxte8eQ.js → product-CqAh01LU.js} +1 -1
  38. package/dist/assets/{properties-bone-constraints.inspector-Ck0Hzlvr.js → properties-bone-constraints.inspector-BPN6BRJV.js} +1 -1
  39. package/dist/assets/{properties-bone.inspector-B8M42o0V.js → properties-bone.inspector-C4xD61mX.js} +1 -1
  40. package/dist/assets/{properties-collection.inspector-D-RSO5zy.js → properties-collection.inspector-BTps8t6G.js} +1 -1
  41. package/dist/assets/{properties-constraints.inspector-DbJa57oa.js → properties-constraints.inspector-BVvP6esW.js} +1 -1
  42. package/dist/assets/{properties-data.inspector-DLgjbRW6.js → properties-data.inspector-CKKO8DVT.js} +1 -1
  43. package/dist/assets/{properties-material.inspector-B11LZYDW.js → properties-material.inspector-BGfT8kHT.js} +1 -1
  44. package/dist/assets/{properties-modifiers.inspector-BCWwuA26.js → properties-modifiers.inspector-DJRANpOY.js} +1 -1
  45. package/dist/assets/{properties-object.inspector-UZVJG49S.js → properties-object.inspector-CgVfWmw2.js} +1 -1
  46. package/dist/assets/{properties-output.inspector-XOwcBits.js → properties-output.inspector-CBl5xEMZ.js} +1 -1
  47. package/dist/assets/{properties-particles.inspector-By04vT7R.js → properties-particles.inspector-CxVZ09ZY.js} +1 -1
  48. package/dist/assets/{properties-physics.inspector-D3T7FLdg.js → properties-physics.inspector-DmG3i3vY.js} +1 -1
  49. package/dist/assets/{properties-render.inspector-Y0Rjr9gZ.js → properties-render.inspector-TCoPfEn0.js} +1 -1
  50. package/dist/assets/{properties-scene.inspector-CfyDWB4W.js → properties-scene.inspector-BjsTOBiY.js} +1 -1
  51. package/dist/assets/{properties-texture.inspector-AFRsJx6-.js → properties-texture.inspector-D1X9iyVV.js} +1 -1
  52. package/dist/assets/{properties-view-layer.inspector-Co07LAmQ.js → properties-view-layer.inspector-dXTVxzzk.js} +1 -1
  53. package/dist/assets/{properties-world.inspector-C7T4JocI.js → properties-world.inspector-CRxJK930.js} +1 -1
  54. package/dist/assets/{react-story-board-vrmj74Ng.js → react-story-board-CnCZAhn6.js} +1 -1
  55. package/dist/assets/{react-three-rapier.esm-D874pLFD.js → react-three-rapier.esm-DsJqtzy_.js} +1 -1
  56. package/dist/assets/{session-1bPxsLdy.js → session-Dv4dTRLk.js} +180 -22
  57. package/dist/assets/{spark.module-D1CUMLYS.js → spark.module-uQlq--TY.js} +1 -1
  58. package/dist/assets/{stage-keyboard-Cx90EYIT.js → stage-keyboard-DzZMNYAr.js} +1 -1
  59. package/dist/assets/{stage-overlay-set-duu3P0mZ.js → stage-overlay-set-D6OOz1L9.js} +1 -1
  60. package/dist/assets/{stage-presence-markers-DKH3p_ao.js → stage-presence-markers-BUaSzKCv.js} +1 -1
  61. package/dist/assets/{story-capture-Dqurwlhr.js → story-capture-C2ExQiuI.js} +1 -1
  62. package/dist/assets/{story-pixi-preview-c78Aygdi.js → story-pixi-preview-C6n-a2_M.js} +1 -1
  63. package/dist/assets/{story-three-preview-CbZo5B3D.js → story-three-preview-BazrPMDu.js} +2 -2
  64. package/dist/assets/{webworkerAll-iMzrvNir.js → webworkerAll-FJN9IDir.js} +1 -1
  65. package/dist/assets/worker-CBvBkaXr.js +2 -0
  66. package/dist/assets/{world-documents-CGbrcsYk.js → world-documents-B6usBw3s.js} +1 -1
  67. package/dist-node/cli.js +15 -9
  68. package/package.json +9 -9
  69. package/dist/assets/blender-emscripten-engine-C_uFxIuO.js +0 -2
  70. package/dist/assets/blender-runtime-host-D8NHsAfD.js +0 -4
  71. package/dist/assets/blender-runtime.document-BixTvrw8.js +0 -7
  72. package/dist/assets/blender.command-BCCEp0kb.js +0 -1
  73. package/dist/assets/worker-DTgfRRas.js +0 -1
@@ -1,2 +1,2 @@
1
- import{S,P as B,a as E,b as h,s as T,A as g,o as I}from"./worker-DTgfRRas.js";import{s as O}from"./session-1bPxsLdy.js";const d="/bw",p=`${S}/frame.bin`;async function R(e){const r=h(`wali/${e}`);try{return await import(r)}catch(n){throw new Error(`The substrate skew needs ${e}, which this editor serves from the WALI pack directory beside blender.wasm (${r}): ${n instanceof Error?n.message:String(n)}`)}}async function P(e,r){const n=performance.now(),y=await fetch(h("runtime.idx"));if(!y.ok)throw new Error(`${g}/runtime.idx answered ${y.status}`);const m=await y.json(),w=await fetch(h("runtime.bin"));if(!w.ok)throw new Error(`${g}/runtime.bin answered ${w.status}`);const s=new Uint8Array(await w.arrayBuffer());let t=0;for(const i of m.files){if(t+i.size>s.byteLength)throw new Error(`Blender runtime ${i.path}: bytes ${t}..${t+i.size} lie outside the ${s.byteLength}-byte runtime blob`);const l=`${d}/${i.path}`;e.mkdirSync(l.slice(0,l.lastIndexOf("/")),{recursive:!0}),e.writeFileSync(l,s.subarray(t,t+i.size)),t+=i.size}if(t!==s.byteLength)throw new Error(`Blender runtime index accounts for ${t} of the ${s.byteLength} bytes served`);const a=Math.round(performance.now()-n);return r("log",`blender: staged Blender's ${m.files.length}-file runtime tree in ${a} ms`),{files:m.files.length,bytes:s.byteLength,ms:a}}function _(e){return{readFile:r=>e.readFile(r),writeFile:async(r,n)=>e.writeFileSync(r,n),mkdirTree:async r=>e.mkdirSync(r,{recursive:!0}),readdir:async r=>e.readdirSync(r),stat:async r=>{if(!e.existsSync(r))return null;const n=e.statSync(r);return{size:n.size,mode:n.mode&4095|(n.isDirectory()?16384:32768),mtimeMs:n.mtimeMs}},unlink:async r=>e.unlinkSync(r)}}async function N(e,r){const n=performance.now(),[y,m]=await Promise.all([R("browser-wali/worker-program.js"),R("browser-runtime/browser-memory-filesystem.js")]),w=y.BrowserWaliWorkerProgram,s=m.BrowserMemoryFileSystem;if(!w||!s)throw new Error("The substrate modules this editor served do not export BrowserWaliWorkerProgram and BrowserMemoryFileSystem; the WALI pack directory holds a browser-substrate this engine does not know.");const t=new s;for(const o of["/tmp","/root","/work",S,...B,e.project])t.mkdirSync(o,{recursive:!0});await P(t,e.log),t.writeFileSync(E,O);const a=r.workers??{pool:16,blender:4},i=new w(t,{url:h("blender.wasm"),...r.integrity?{integrity:r.integrity}:{},cwd:"/work",env:{HOME:"/root",TMPDIR:"/tmp",PATH:"/usr/bin:/bin",BLENDER_SYSTEM_RESOURCES:d,BLENDER_SYSTEM_SCRIPTS:`${d}/scripts`,BLENDER_SYSTEM_DATAFILES:`${d}/datafiles`,BLENDER_SYSTEM_PYTHON:`${d}/python`,PYTHONPATH:`${d}/python/lib/numpy313.zip:${d}/python/lib/wheels313.zip`,VGAI_SESSION_ROOT:S,VGAI_EXPORT_BUFFER_PATH:p},threadPoolSize:a.pool,network:{allowedHosts:[],maxConnections:0,maxBytes:0}});let l=null,c=null;const b=o=>{for(const u of o.split(`
1
+ import{S,P as B,a as E,b as h,s as T,A as g,o as I}from"./worker-CBvBkaXr.js";import{s as O}from"./session-Dv4dTRLk.js";const d="/bw",p=`${S}/frame.bin`;async function R(e){const r=h(`wali/${e}`);try{return await import(r)}catch(n){throw new Error(`The substrate skew needs ${e}, which this editor serves from the WALI pack directory beside blender.wasm (${r}): ${n instanceof Error?n.message:String(n)}`)}}async function P(e,r){const n=performance.now(),y=await fetch(h("runtime.idx"));if(!y.ok)throw new Error(`${g}/runtime.idx answered ${y.status}`);const m=await y.json(),w=await fetch(h("runtime.bin"));if(!w.ok)throw new Error(`${g}/runtime.bin answered ${w.status}`);const s=new Uint8Array(await w.arrayBuffer());let t=0;for(const i of m.files){if(t+i.size>s.byteLength)throw new Error(`Blender runtime ${i.path}: bytes ${t}..${t+i.size} lie outside the ${s.byteLength}-byte runtime blob`);const l=`${d}/${i.path}`;e.mkdirSync(l.slice(0,l.lastIndexOf("/")),{recursive:!0}),e.writeFileSync(l,s.subarray(t,t+i.size)),t+=i.size}if(t!==s.byteLength)throw new Error(`Blender runtime index accounts for ${t} of the ${s.byteLength} bytes served`);const a=Math.round(performance.now()-n);return r("log",`blender: staged Blender's ${m.files.length}-file runtime tree in ${a} ms`),{files:m.files.length,bytes:s.byteLength,ms:a}}function _(e){return{readFile:r=>e.readFile(r),writeFile:async(r,n)=>e.writeFileSync(r,n),mkdirTree:async r=>e.mkdirSync(r,{recursive:!0}),readdir:async r=>e.readdirSync(r),stat:async r=>{if(!e.existsSync(r))return null;const n=e.statSync(r);return{size:n.size,mode:n.mode&4095|(n.isDirectory()?16384:32768),mtimeMs:n.mtimeMs}},unlink:async r=>e.unlinkSync(r)}}async function N(e,r){const n=performance.now(),[y,m]=await Promise.all([R("browser-wali/worker-program.js"),R("browser-runtime/browser-memory-filesystem.js")]),w=y.BrowserWaliWorkerProgram,s=m.BrowserMemoryFileSystem;if(!w||!s)throw new Error("The substrate modules this editor served do not export BrowserWaliWorkerProgram and BrowserMemoryFileSystem; the WALI pack directory holds a browser-substrate this engine does not know.");const t=new s;for(const o of["/tmp","/root","/work",S,...B,e.project])t.mkdirSync(o,{recursive:!0});await P(t,e.log),t.writeFileSync(E,O);const a=r.workers??{pool:16,blender:4},i=new w(t,{url:h("blender.wasm"),...r.integrity?{integrity:r.integrity}:{},cwd:"/work",env:{HOME:"/root",TMPDIR:"/tmp",PATH:"/usr/bin:/bin",BLENDER_SYSTEM_RESOURCES:d,BLENDER_SYSTEM_SCRIPTS:`${d}/scripts`,BLENDER_SYSTEM_DATAFILES:`${d}/datafiles`,BLENDER_SYSTEM_PYTHON:`${d}/python`,PYTHONPATH:`${d}/python/lib/numpy313.zip:${d}/python/lib/wheels313.zip`,VGAI_SESSION_ROOT:S,VGAI_EXPORT_BUFFER_PATH:p},threadPoolSize:a.pool,network:{allowedHosts:[],maxConnections:0,maxBytes:0}});let l=null,c=null;const b=o=>{for(const u of o.split(`
2
2
  `))u!==""&&(u.startsWith("@@VGAI-READY ")&&(l=u.slice(13)),e.log(u.startsWith("@@VGAI-WARN")||u.startsWith("@@VGAI-ERROR")?"error":"log",u))};for(i.run(["/blender","-b","--factory-startup","-noaudio","--python-use-system-env","-t",String(a.blender),"--python",E],{onStdout:b,onStderr:b,onDiagnostic:o=>e.log("error",`@@VGAI-ERROR ${o}`)}).then(o=>{c=`Blender exited ${o.exitCode}`},o=>{c=o instanceof Error?o.message:String(o)}).finally(()=>{c!==null&&e.log("error",`@@VGAI-ERROR the Blender program ended: ${c}`)});l===null;){if(c!==null)throw new Error(`Blender never reached its session: ${c}`);await T(5)}const A=performance.now()-n,$=JSON.parse(l);e.log("log",`blender: the substrate skew is up (${a.blender} Blender threads in a pool of ${a.pool}; Blender is SERIAL without -t N and says so)`);const f=_(t),{request:k}=I(f,e,()=>c);return{skew:"wali",banner:$,files:f,request:k,readArena:()=>t.readFile(p),bootMs:A,memoryBytes:()=>null,releasedPayloadBytes:null}}export{N as startWaliBlenderEngine};
@@ -0,0 +1 @@
1
+ import{h as l}from"./blender-runtime-host-C3rVDyG8.js";import"./index-DmtPt6RQ.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D2LwEE0L.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";import"./clip-planes-CnAI6DZn.js";const v="workspace.command",e=(o,n)=>({...n===void 0?{}:{timeoutMs:n},derivedRefresh:o,handle:r=>l(r)}),y={"blender-start":e("none",12e4),"blender-stop":e("none",30*6e4),"blender-execute":e("always",30*6e4),"blender-scene-info":e("none",6e4),"blender-object-info":e("none",6e4),"blender-screenshot-view":e("always",6e4),"blender-read-file":e("none",6e4),"blender-write-file":e("none",6e4),"blender-list-files":e("none"),"blender-rna":e("none",6e4),"blender-rna-context":e("none",6e4),"blender-rna-set":e("always",6e4),"blender-outliner":e("none",6e4),"blender-node-tree":e("none",6e4),"blender-uv-layout":e("none",6e4),"blender-rig":e("none",6e4),"blender-action-clip":e("none",12e4),"blender-node-view":e("none"),"blender-outliner-set":e("always",6e4),"blender-status":e("none")};export{y as commands,v as point};
@@ -1,4 +1,4 @@
1
- import{bV as M,bW as Z,bX as m,bY as te,bZ as y,b_ as ie,b$ as g,c0 as P,c1 as V}from"./index-5av5LJja.js";import"./webworkerAll-iMzrvNir.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D2LwEE0L.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,N=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function W(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||N(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||N(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n($),chrome:n(F),device:n(K)||n(Y)||n(H)||n($)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=W.default??W,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,j=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=j.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
1
+ import{bV as M,bW as Z,bX as m,bY as te,bZ as y,b_ as ie,b$ as g,c0 as P,c1 as V}from"./index-DmtPt6RQ.js";import"./webworkerAll-FJN9IDir.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D2LwEE0L.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";class q{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,n=this._canvas.height,s=t.width/i*this._renderer.resolution,o=t.height/n*this._renderer.resolution,r=t.left,l=t.top,d=`translate(${r}px, ${l}px) scale(${s}, ${o})`;d!==this._lastTransform&&(this._domElement.style.transform=d,this._lastTransform=d)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const i=this.canvas.width,n=this.canvas.height,s=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||M.shared.add(this.updateTranslation,this,Z.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&M.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class w{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=w.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,B=/iPod/i,C=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,v=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,K=/BlackBerry/i,Y=/BB10/i,H=/Opera Mini/i,F=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,N=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ne(a){return function(e){return e.test(a)}}function W(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ne(t),s={apple:{phone:n(I)&&!n(v),ipod:n(B),tablet:!n(I)&&(n(C)||N(e))&&!n(v),universal:n(U),device:(n(I)||n(B)||n(C)||n(U)||N(e))&&!n(v)},amazon:{phone:n(b),tablet:!n(b)&&n(O),device:n(b)||n(O)},android:{phone:!n(v)&&n(b)||!n(v)&&n(k),tablet:!n(v)&&!n(b)&&!n(k)&&(n(O)||n(R)),device:!n(v)&&(n(b)||n(O)||n(k)||n(R))||n(/\bokhttp\b/i)},windows:{phone:n(v),tablet:n(X),device:n(v)||n(X)},other:{blackberry:n(K),blackberry10:n(Y),opera:n(H),firefox:n($),chrome:n(F),device:n(K)||n(Y)||n(H)||n($)||n(F)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const se=W.default??W,oe=se(globalThis.navigator),re=9,G=100,ae=0,le=0,j=2,z=1,he=-1e3,ce=-1e3,de=2,L=class J{constructor(e,t=oe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${he}px`,e.style.left=`${ce}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${ae}px`,this._div.style.left=`${le}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=j.toString(),this._canvasObserver=new q({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){const i={accessibilityOptions:{...J.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i))}for(let i=this._children.length-1;i>=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,te(this._children,i,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){const n=this._children[i];if(!n._accessibleActive||!n._accessibleDiv)continue;const s=n._accessibleDiv,o=n.hitArea||n.getBounds().rectangle;if(n.hitArea){const r=n.worldTransform;s.style.left=`${r.tx+o.x*r.a}px`,s.style.top=`${r.ty+o.y*r.d}px`,s.style.width=`${o.width*r.a}px`,s.style.height=`${o.height*r.d}px`}else this._capHitArea(o),s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,s.style.width=`${o.width}px`,s.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
2
2
  color: transparent;
3
3
  pointer-events: none;
4
4
  padding: 0;
@@ -1 +1 @@
1
- import{ao as M,Z as h,ap as S,aq as z,ar as k,as as I,at as P,au as A,h as H,av as y,aw as C,ax as N,ay as F,az as _,aA as B,aB as W,aC as $}from"./index-5av5LJja.js";const x={transform:!1,inspectorFields:!1,persist:!1};class D{capabilities=x;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,t,i,n){this.store=e,this.world=t,this.reason=i??null,n&&(this.pickable={pick:n})}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const t=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&t.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&t.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),t.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&t.push({path:"reason",label:"Reason",type:"string",readonly:!0}),t},get:(e,t)=>{if(e===this.world.id)switch(t){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,t,i)=>{}}}const u=new WeakMap,T=new Set;function j(){for(const r of T)r()}function q(r){const e=(u.get(r)?.generation??0)+1;return u.set(r,{generation:e,settled:!1}),j(),()=>{const t=u.get(r);!t||t.generation!==e||t.settled||(u.set(r,{generation:e,settled:!0}),j())}}const G="(invalid manifest)";let w=!1,g=!1,b=!1,l=null;function f(){if(g||b||!w||!l)return;g=!0;const r=l;queueMicrotask(()=>{if(g=!1,l!==r){f();return}w=!1,b=!0,Promise.resolve().then(r).catch(e=>{h.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{b=!1,f()})})}function Y(r){return l=r,f(),()=>{l===r&&(l=null)}}function ee(){w=!0,f()}const V=new Set(["three","canvas","dom"]);function d(r){return typeof r=="string"?r:void 0}function J(r){const e=r.world;if(!e||typeof e!="object")return;const t=d(e.entry);if(t)return{entry:t,export:d(e.export)}}function L(r){if(r!=null){if(typeof r=="string")return r;if(typeof r=="object"){const e=r;if(typeof e.module=="string")return`module:${e.module}`;const t=e.ingest;if(t&&typeof t=="object")return"ingest"}}}function Z(r){if(!r||typeof r!="object")return null;const e=r.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((i,n)=>{const s=i&&typeof i=="object"?i:{},a=s.zOrder,o=s.pausable;return{id:d(s.id)??`(world ${n})`,surface:(typeof s.adapter=="string"?d(s.adapter):void 0)??d(s.adapter&&typeof s.adapter=="object"?s.adapter.surface:void 0)??"(missing adapter surface)",adapter:L(s.adapter),scene:d(s.scene),entry:d(s.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:s.dev===!0,world:J(s)}})}}function K(r){return V.has(r.surface)?!r.scene&&!r.entry?`World "${r.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${r.surface}" — expected one of: three, canvas, react.`}function c(r,e){const t=r.roots;if(Array.isArray(t))return t.find(i=>!!i&&typeof i=="object"&&i.id===e)}function O(r,e){return c(r,e)}class U{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,t,i){this.raw=e,this.synthesizedValue=t,this.store=i;const n=i.projectHistory;this.fileHistory=n?H(n,y(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(s=>{s==="vgai.project.json"&&y().readBytes(s).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const t=c(this.raw,e);if(!t)return;const i=t.scene;if(typeof i=="string")return`Scene · ${i}`;const n=t.entry;return typeof n=="string"?`Entry · ${n}`:"Adapter-owned runtime content"}getRootZOrder(e){const t=c(this.raw,e)?.zOrder;return typeof t=="number"?t:0}setRootZOrder(e,t){const i=O(this.raw,e);i&&(i.zOrder=t,this.persist("Change World Order"))}getRootPausable(e){const t=c(this.raw,e)?.pausable;return typeof t=="boolean"?t:!0}setRootPausable(e,t){const i=O(this.raw,e);i&&(i.pausable=t,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const t=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("vgai.project.json",t,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const i=async()=>{const n=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"vgai.project.json",content:t,...C()})});N(n,"Write vgai.project.json failed"),n.ok||await F(n,{label:"Write vgai.project.json",attempted:{"vgai.project.json":t},reapply:i})};return await i(),this.store.notifyIngestEdit(),!0}catch(i){return this.fileHistory&&y().readBytes("vgai.project.json").then(n=>JSON.parse(new TextDecoder().decode(n))).then(n=>{for(const s of Object.keys(this.raw))delete this.raw[s];Object.assign(this.raw,n),this.store.notifyIngestEdit()}).catch(()=>{}),h.error(`Failed to write vgai.project.json: ${i}`,"project"),!1}}}let v=null;function Q(r,e,t){const i=S(e).map(o=>{const p=o.zOrder??0,m=z(o.surface);if(m)return{worldId:o.id,kind:o.surface,adapter:m(r,o.id),zOrder:p};const R=K(o),E={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:p,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new D(r,E,R??void 0),zOrder:p}}),n=t&&i.length>=1?new U(t.raw,t.synthesized,r):void 0;v=n??null;const s=k(_()?.config),a=new I(i,n,s);if(i.length>=1){if(B()&&!W())return h.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;P(a),A(a),r.notifyIngestEdit()}return a}function te(r){r&&$()===r&&A(null),v?.dispose(),v=null}async function re(r){const e=q(r);let t,i;try{const n=await M(),s=n!==null&&Z(n);if(s)t=s,i={raw:n,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(n){const s=n instanceof Error?n.message:String(n);h.error(`Failed to load vgai.project.json: ${s}`,"project"),t={roots:[{id:"manifest",surface:G,adapter:s}]}}try{return Q(r,t,i)}finally{e()}}export{D as B,G as I,Y as b,te as e,re as i,ee as q};
1
+ import{ao as M,Z as h,ap as S,aq as z,ar as k,as as I,at as P,au as A,h as H,av as y,aw as C,ax as N,ay as F,az as _,aA as B,aB as W,aC as $}from"./index-DmtPt6RQ.js";const x={transform:!1,inspectorFields:!1,persist:!1};class D{capabilities=x;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,t,i,n){this.store=e,this.world=t,this.reason=i??null,n&&(this.pickable={pick:n})}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const t=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&t.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&t.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),t.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&t.push({path:"reason",label:"Reason",type:"string",readonly:!0}),t},get:(e,t)=>{if(e===this.world.id)switch(t){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,t,i)=>{}}}const u=new WeakMap,T=new Set;function j(){for(const r of T)r()}function q(r){const e=(u.get(r)?.generation??0)+1;return u.set(r,{generation:e,settled:!1}),j(),()=>{const t=u.get(r);!t||t.generation!==e||t.settled||(u.set(r,{generation:e,settled:!0}),j())}}const G="(invalid manifest)";let w=!1,g=!1,b=!1,l=null;function f(){if(g||b||!w||!l)return;g=!0;const r=l;queueMicrotask(()=>{if(g=!1,l!==r){f();return}w=!1,b=!0,Promise.resolve().then(r).catch(e=>{h.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{b=!1,f()})})}function Y(r){return l=r,f(),()=>{l===r&&(l=null)}}function ee(){w=!0,f()}const V=new Set(["three","canvas","dom"]);function d(r){return typeof r=="string"?r:void 0}function J(r){const e=r.world;if(!e||typeof e!="object")return;const t=d(e.entry);if(t)return{entry:t,export:d(e.export)}}function L(r){if(r!=null){if(typeof r=="string")return r;if(typeof r=="object"){const e=r;if(typeof e.module=="string")return`module:${e.module}`;const t=e.ingest;if(t&&typeof t=="object")return"ingest"}}}function Z(r){if(!r||typeof r!="object")return null;const e=r.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((i,n)=>{const s=i&&typeof i=="object"?i:{},a=s.zOrder,o=s.pausable;return{id:d(s.id)??`(world ${n})`,surface:(typeof s.adapter=="string"?d(s.adapter):void 0)??d(s.adapter&&typeof s.adapter=="object"?s.adapter.surface:void 0)??"(missing adapter surface)",adapter:L(s.adapter),scene:d(s.scene),entry:d(s.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:s.dev===!0,world:J(s)}})}}function K(r){return V.has(r.surface)?!r.scene&&!r.entry?`World "${r.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${r.surface}" — expected one of: three, canvas, react.`}function c(r,e){const t=r.roots;if(Array.isArray(t))return t.find(i=>!!i&&typeof i=="object"&&i.id===e)}function O(r,e){return c(r,e)}class U{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,t,i){this.raw=e,this.synthesizedValue=t,this.store=i;const n=i.projectHistory;this.fileHistory=n?H(n,y(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(s=>{s==="vgai.project.json"&&y().readBytes(s).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const t=c(this.raw,e);if(!t)return;const i=t.scene;if(typeof i=="string")return`Scene · ${i}`;const n=t.entry;return typeof n=="string"?`Entry · ${n}`:"Adapter-owned runtime content"}getRootZOrder(e){const t=c(this.raw,e)?.zOrder;return typeof t=="number"?t:0}setRootZOrder(e,t){const i=O(this.raw,e);i&&(i.zOrder=t,this.persist("Change World Order"))}getRootPausable(e){const t=c(this.raw,e)?.pausable;return typeof t=="boolean"?t:!0}setRootPausable(e,t){const i=O(this.raw,e);i&&(i.pausable=t,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const t=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("vgai.project.json",t,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const i=async()=>{const n=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"vgai.project.json",content:t,...C()})});N(n,"Write vgai.project.json failed"),n.ok||await F(n,{label:"Write vgai.project.json",attempted:{"vgai.project.json":t},reapply:i})};return await i(),this.store.notifyIngestEdit(),!0}catch(i){return this.fileHistory&&y().readBytes("vgai.project.json").then(n=>JSON.parse(new TextDecoder().decode(n))).then(n=>{for(const s of Object.keys(this.raw))delete this.raw[s];Object.assign(this.raw,n),this.store.notifyIngestEdit()}).catch(()=>{}),h.error(`Failed to write vgai.project.json: ${i}`,"project"),!1}}}let v=null;function Q(r,e,t){const i=S(e).map(o=>{const p=o.zOrder??0,m=z(o.surface);if(m)return{worldId:o.id,kind:o.surface,adapter:m(r,o.id),zOrder:p};const R=K(o),E={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:p,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new D(r,E,R??void 0),zOrder:p}}),n=t&&i.length>=1?new U(t.raw,t.synthesized,r):void 0;v=n??null;const s=k(_()?.config),a=new I(i,n,s);if(i.length>=1){if(B()&&!W())return h.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;P(a),A(a),r.notifyIngestEdit()}return a}function te(r){r&&$()===r&&A(null),v?.dispose(),v=null}async function re(r){const e=q(r);let t,i;try{const n=await M(),s=n!==null&&Z(n);if(s)t=s,i={raw:n,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(n){const s=n instanceof Error?n.message:String(n);h.error(`Failed to load vgai.project.json: ${s}`,"project"),t={roots:[{id:"manifest",surface:G,adapter:s}]}}try{return Q(r,t,i)}finally{e()}}export{D as B,G as I,Y as b,te as e,re as i,ee as q};
@@ -1,2 +1,2 @@
1
- import{bA as E,s as l,o as y,bB as b,a as L,j as T}from"./index-5av5LJja.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D2LwEE0L.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";function x(e){return!e||e.trim()===""?"empty":e.includes("\0")?"nul":e.startsWith("/")||e.startsWith("\\")||/^[a-zA-Z]:[\\/]/.test(e)?"absolute":e.split(/[\\/]/).includes("..")?"traversal":null}function O(e){return x(e)===null}const d=".vgai/assets.json",k=y({key:l().min(1),license:l().min(1).optional(),sourceHash:l().regex(/^sha256-[a-f0-9]{64}$/,'sourceHash must be "sha256-<64 hex>"').optional(),materializedAt:l().datetime()}).strict(),z=E(l().min(1),k);function _(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error(`Not a sha256 digest, refusing to record it as a sourceHash: ${e}`);return`sha256-${e}`}function m(e){const t=e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"");if(!t)throw new Error("An asset ledger path cannot be empty.");if(!O(t))throw new Error(`An asset ledger path cannot escape the project: ${e}`);return t}function D(e){return z.parse(e)}function I(e){if(e==null||e.trim()==="")return{};let t;try{t=JSON.parse(e)}catch(s){throw new Error(`${d} is not valid JSON: ${String(s)}`)}return D(t)}function M(e,t,s){const r=m(t),a=k.parse(s),n={...e,[r]:a},i={};for(const u of Object.keys(n).sort())i[u]=n[u];return i}function U(e){const t={};for(const s of Object.keys(e).sort())t[s]=e[s];return`${JSON.stringify(t,null,2)}
1
+ import{bA as E,s as l,o as y,bB as b,a as L,j as T}from"./index-DmtPt6RQ.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D2LwEE0L.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";function x(e){return!e||e.trim()===""?"empty":e.includes("\0")?"nul":e.startsWith("/")||e.startsWith("\\")||/^[a-zA-Z]:[\\/]/.test(e)?"absolute":e.split(/[\\/]/).includes("..")?"traversal":null}function O(e){return x(e)===null}const d=".vgai/assets.json",k=y({key:l().min(1),license:l().min(1).optional(),sourceHash:l().regex(/^sha256-[a-f0-9]{64}$/,'sourceHash must be "sha256-<64 hex>"').optional(),materializedAt:l().datetime()}).strict(),z=E(l().min(1),k);function _(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error(`Not a sha256 digest, refusing to record it as a sourceHash: ${e}`);return`sha256-${e}`}function m(e){const t=e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"");if(!t)throw new Error("An asset ledger path cannot be empty.");if(!O(t))throw new Error(`An asset ledger path cannot escape the project: ${e}`);return t}function D(e){return z.parse(e)}function I(e){if(e==null||e.trim()==="")return{};let t;try{t=JSON.parse(e)}catch(s){throw new Error(`${d} is not valid JSON: ${String(s)}`)}return D(t)}function M(e,t,s){const r=m(t),a=k.parse(s),n={...e,[r]:a},i={};for(const u of Object.keys(n).sort())i[u]=n[u];return i}function U(e){const t={};for(const s of Object.keys(e).sort())t[s]=e[s];return`${JSON.stringify(t,null,2)}
2
2
  `}function H(e,t,s){const r=globalThis.navigator?.locks;return r?r.request(`vgai:${e}:${b(t)}`,s):s()}const j=1e4,N=15;function R(){return globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`}async function B(e,t,s={}){const r=s.staleAfterMs??j,a=s.retryDelayMs??N,n=s.now??Date.now,i=s.sleep??(o=>new Promise(c=>setTimeout(c,o))),u=s.token??R;for(;;){const o=JSON.stringify({at:n(),owner:s.owner??"unknown",token:u()});if(await e.createIfAbsent(o))try{return await t()}finally{await e.removeIfHeldBy(o)}const c=await e.read();if(c!==null){if(n()-J(c)>r){await e.removeIfHeldBy(c);continue}await i(a)}}}function J(e){try{const t=JSON.parse(e);return typeof t.at=="number"?t.at:0}catch{return 0}}function F(){const e=new Map;return(t,s)=>{const a=(e.get(t)??Promise.resolve()).then(s,s),n=a.then(()=>{},()=>{});return e.set(t,n),n.then(()=>{e.get(t)===n&&e.delete(t)}),a}}async function S(e){return await e.exists(d)?I(await e.read(d)):{}}async function C(e,t){await e.write(d,U(t))}const f=`${d}.lock`,W=F(),A=new WeakMap;let $=0;function K(e){const t=A.get(e);if(t!==void 0)return t;$+=1;const s=`${e.id}#${$}`;return A.set(e,s),s}async function G(e,t){const s={key:t.key,...t.license?{license:t.license}:{},...t.sourceSha256?{sourceHash:_(t.sourceSha256)}:{},materializedAt:t.materializedAt??new Date().toISOString()};await W(K(e),()=>B({createIfAbsent:r=>e.writeIfAbsent(f,r),read:async()=>await e.exists(f)?e.read(f):null,removeIfHeldBy:r=>H(e.id,f,async()=>{await e.exists(f)&&await e.read(f)===r&&await e.remove(f)})},async()=>{const r=await S(e);await C(e,M(r,m(t.destPath),s))},{owner:e.id}))}const Y=y({key:l().regex(/^[^:]+:.+$/,'An asset key must be "source:id"'),dest:l().min(1),sha256:l().regex(/^[a-f0-9]{64}$/,"A pack entry must pin the sha256 of its bytes as 64 lowercase hex digits")}).strict(),q=y({packs:E(l().min(1),L(Y))}).strict();function V(e){return q.parse(e)}function Z(e){const t=[],s=new Map;for(const[r,a]of Object.entries(e.packs))for(const n of a){const i=s.get(n.dest);if(i!==void 0)throw new Error(`Two packs declare the same destination "${n.dest}": "${i}" and "${r}".`);s.set(n.dest,r),t.push({...n,pack:r})}return t}const w="asset-manifest.json",v="https://vgai-asset-library.aaron-0ed.workers.dev";function P(e){return(e.baseUrl??v).replace(/\/+$/,"")}function Q(e){return e.signal?{signal:e.signal}:{}}async function X(e,t={}){const s=P(t),r=await fetch(`${s}/v1/assets/${encodeURIComponent(e)}`,Q(t));if(!r.ok)return null;const a=await r.json();return!a||typeof a!="object"||!Array.isArray(a.files)?null:a}function ee(e,t,s,r){return`${P(e?{baseUrl:e}:{})}/v1/assets/${encodeURIComponent(t)}/files/${s}`}async function we(e,t={}){const s=await te(e),r={declared:s.length,materialized:[],alreadyPresent:[],failed:[]};if(s.length===0)return r;const a=await S(e);for(const n of s){if(t.signal?.aborted)break;if(a[m(n.dest)]&&await e.exists(n.dest)){r.alreadyPresent.push(n),t.onProgress?.(n,"already-present");continue}try{await se(e,n,t),r.materialized.push(n),t.onProgress?.(n,"materialized")}catch(i){r.failed.push({entry:n,reason:i instanceof Error?i.message:String(i)}),t.onProgress?.(n,"failed")}}return r}async function te(e){if(!await e.exists(w))return[];const t=await e.read(w);let s;try{s=JSON.parse(t)}catch(r){throw new Error(`${w} is not valid JSON: ${r instanceof Error?r.message:String(r)}`)}return Z(V(s))}async function se(e,t,s){const r=await re(t,s);await e.write(t.dest,r.bytes),await G(e,{destPath:t.dest,key:t.key,license:r.license,sourceSha256:t.sha256})}async function re(e,t={}){const s=e.key.indexOf(":");if(s<0)throw new Error(`Malformed asset key "${e.key}" (expected "source:id").`);const r=e.key.slice(0,s),a=e.key.slice(s+1);if(r!=="local")throw new Error(`Asset key "${e.key}": only the "local" (cloud-hosted) source can be materialized from the cloud worker.`);const n=t.baseUrl??v,i=t.signal?{baseUrl:n,signal:t.signal}:{baseUrl:n},u=await X(a,i);if(!u)throw new Error(`"${e.key}" is not hosted by the cloud asset library.`);const o=u.files[0];if(!o)throw new Error(`"${e.key}" has no files in the cloud library.`);if(o.dependencies.length>0)throw new Error(`"${e.key}" has ${o.dependencies.length} dependency file(s) — a pack entry names exactly one destination file.`);if(o.main.sha256!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: the cloud library reports sha256:${o.main.sha256} but ${w} pins sha256:${e.sha256}. Nothing was fetched or written; the pin is only re-cut by a reviewed change to the declaration.`);const c=ee(n,a,0),h=await fetch(c,t.signal?{signal:t.signal}:{});if(!h.ok)throw new Error(`${c} returned ${h.status} ${h.statusText}.`);const g=new Uint8Array(await h.arrayBuffer()),p=await T(g);if(p!==e.sha256)throw new Error(`"${e.key}" → ${e.dest}: ${c} delivered sha256:${p} but the declaration pins sha256:${e.sha256}. Nothing was written.`);return{bytes:g,license:u.license}}export{w as ASSET_MANIFEST_PATH,re as fetchVerifiedPackEntry,we as materializeDeclaredAssetPacks};