@fps-games/editor-deployment 0.2.3-beta.14 → 0.2.3-beta.16
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/bin/fps-editor-prepare.mjs +1 -1
- package/bin/fps-editor-project.mjs +1 -1
- package/licenses/THIRD_PARTY_NOTICES.txt +2 -2
- package/manifest.json +50 -50
- package/npm-shrinkwrap.json +2 -2
- package/package.json +6 -6
- package/public/assets/index-Cv7z0zVA.js +1 -0
- package/public/assets/index-Cv7z0zVA.js.br +0 -0
- package/public/assets/index-Cv7z0zVA.js.gz +0 -0
- package/public/assets/playable-sdk-DO95mXOf.js +4 -0
- package/public/assets/playable-sdk-DO95mXOf.js.br +0 -0
- package/public/assets/playable-sdk-DO95mXOf.js.gz +0 -0
- package/public/assets/playable-standard-project-Do0uyGjy.js +5250 -0
- package/public/assets/playable-standard-project-Do0uyGjy.js.br +0 -0
- package/public/assets/playable-standard-project-Do0uyGjy.js.gz +0 -0
- package/public/index.html +3 -3
- package/public/index.html.br +0 -0
- package/public/index.html.gz +0 -0
- package/runtime/editor-control-plane.mjs +4 -96
- package/worker/editor-service-worker.mjs +16 -16
- package/public/assets/index-CToRH9gy.js +0 -1
- package/public/assets/index-CToRH9gy.js.br +0 -0
- package/public/assets/index-CToRH9gy.js.gz +0 -0
- package/public/assets/playable-sdk-CrrQJDf4.js +0 -4
- package/public/assets/playable-sdk-CrrQJDf4.js.br +0 -0
- package/public/assets/playable-sdk-CrrQJDf4.js.gz +0 -0
- package/public/assets/playable-standard-project-DkUozryX.js +0 -5249
- package/public/assets/playable-standard-project-DkUozryX.js.br +0 -0
- package/public/assets/playable-standard-project-DkUozryX.js.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
FPS Game Editor deployment npm package
|
|
2
|
-
Version: 0.2.3-beta.
|
|
3
|
-
Commit:
|
|
2
|
+
Version: 0.2.3-beta.16
|
|
3
|
+
Commit: 17e03e1197f5c45694b60088447dfd660421761f
|
|
4
4
|
|
|
5
5
|
This package contains compiled third-party dependencies declared by the source repository.
|
|
6
6
|
The authoritative dependency names, versions, notices, and license metadata are recorded in
|
package/manifest.json
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"schemaVersion": 3,
|
|
3
3
|
"artifactKind": "fps-editor-deployment-package",
|
|
4
4
|
"packageName": "@fps-games/editor-deployment",
|
|
5
|
-
"version": "0.2.3-beta.
|
|
6
|
-
"commitSha": "
|
|
5
|
+
"version": "0.2.3-beta.16",
|
|
6
|
+
"commitSha": "17e03e1197f5c45694b60088447dfd660421761f",
|
|
7
7
|
"node": {
|
|
8
8
|
"range": ">=24 <27",
|
|
9
9
|
"bundled": false
|
|
10
10
|
},
|
|
11
11
|
"build": {
|
|
12
12
|
"packageName": "@fps-games/editor",
|
|
13
|
-
"version": "0.2.3-beta.
|
|
14
|
-
"buildId": "0.2.3-beta.
|
|
15
|
-
"distHash": "
|
|
13
|
+
"version": "0.2.3-beta.16",
|
|
14
|
+
"buildId": "0.2.3-beta.16-0e1f90ca07b8",
|
|
15
|
+
"distHash": "0e1f90ca07b8347387d4f230f60607a73af89724718106e229409aba66639aa8"
|
|
16
16
|
},
|
|
17
17
|
"binaries": {
|
|
18
18
|
"prepare": "bin/fps-editor-prepare.mjs",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
{
|
|
31
31
|
"path": "bin/fps-editor-prepare.mjs",
|
|
32
|
-
"size":
|
|
33
|
-
"sha256": "
|
|
32
|
+
"size": 32233,
|
|
33
|
+
"sha256": "dd80e8b15ec3390a2a4b4e7e166f3e63449dcf2203920c3999eb02e3d1cd6c7a"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"path": "bin/fps-editor-project.mjs",
|
|
37
|
-
"size":
|
|
38
|
-
"sha256": "
|
|
37
|
+
"size": 220039,
|
|
38
|
+
"sha256": "19c5cac5eb680f54e9abb654c5fa796f9947670dc0cc2cf40bb9811b098eb9ab"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "bin/fps-editor-server.mjs",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
{
|
|
46
46
|
"path": "licenses/THIRD_PARTY_NOTICES.txt",
|
|
47
47
|
"size": 361,
|
|
48
|
-
"sha256": "
|
|
48
|
+
"sha256": "df5cbed256db2ffda49d897ffe7e48d6058272609472f0e484773509a38aa2f6"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"path": "public/assets/abstractAudioBus-B_nOEXGJ.js",
|
|
@@ -1628,19 +1628,19 @@
|
|
|
1628
1628
|
"sha256": "90aa7a97454a456b51041d0ffd95e58764299fd83075d786b81634c31514f6c1"
|
|
1629
1629
|
},
|
|
1630
1630
|
{
|
|
1631
|
-
"path": "public/assets/index-
|
|
1632
|
-
"size":
|
|
1633
|
-
"sha256": "
|
|
1631
|
+
"path": "public/assets/index-Cv7z0zVA.js",
|
|
1632
|
+
"size": 31877,
|
|
1633
|
+
"sha256": "7b847b3710dc1d1050de6530fbe44b1027e1b6ca5d7f14f166379dc933e6531d"
|
|
1634
1634
|
},
|
|
1635
1635
|
{
|
|
1636
|
-
"path": "public/assets/index-
|
|
1637
|
-
"size":
|
|
1638
|
-
"sha256": "
|
|
1636
|
+
"path": "public/assets/index-Cv7z0zVA.js.br",
|
|
1637
|
+
"size": 9244,
|
|
1638
|
+
"sha256": "04ea3cf8c77e1649cf792695515d4270fcf2b7f3921978b2b7bd2190708bd3e7"
|
|
1639
1639
|
},
|
|
1640
1640
|
{
|
|
1641
|
-
"path": "public/assets/index-
|
|
1642
|
-
"size":
|
|
1643
|
-
"sha256": "
|
|
1641
|
+
"path": "public/assets/index-Cv7z0zVA.js.gz",
|
|
1642
|
+
"size": 10564,
|
|
1643
|
+
"sha256": "2e9c29c013e4046523d5f7d31eb614e2beb4b59972929b46d64b89d7b825261f"
|
|
1644
1644
|
},
|
|
1645
1645
|
{
|
|
1646
1646
|
"path": "public/assets/index-Xd6hsly2.js",
|
|
@@ -2118,34 +2118,34 @@
|
|
|
2118
2118
|
"sha256": "c98a82244f857667386c5836c68291e4d1264538921d2dfbf71128a4d9bc9e53"
|
|
2119
2119
|
},
|
|
2120
2120
|
{
|
|
2121
|
-
"path": "public/assets/playable-sdk-
|
|
2122
|
-
"size":
|
|
2123
|
-
"sha256": "
|
|
2121
|
+
"path": "public/assets/playable-sdk-DO95mXOf.js",
|
|
2122
|
+
"size": 144789,
|
|
2123
|
+
"sha256": "0a90f9e3e19042063856e61a09e098fd8bd7358fa47ba3f859ef601906f3cc6e"
|
|
2124
2124
|
},
|
|
2125
2125
|
{
|
|
2126
|
-
"path": "public/assets/playable-sdk-
|
|
2127
|
-
"size":
|
|
2128
|
-
"sha256": "
|
|
2126
|
+
"path": "public/assets/playable-sdk-DO95mXOf.js.br",
|
|
2127
|
+
"size": 34644,
|
|
2128
|
+
"sha256": "752eb9bde8a6b30a6852432cffc630b6eddfaae5e549c878bdf6d9630c60b655"
|
|
2129
2129
|
},
|
|
2130
2130
|
{
|
|
2131
|
-
"path": "public/assets/playable-sdk-
|
|
2132
|
-
"size":
|
|
2133
|
-
"sha256": "
|
|
2131
|
+
"path": "public/assets/playable-sdk-DO95mXOf.js.gz",
|
|
2132
|
+
"size": 41985,
|
|
2133
|
+
"sha256": "f02d2627125a0a7dbfffc7ab0ac08704ba41a73d2f3da5cefd4caf081b2baaf1"
|
|
2134
2134
|
},
|
|
2135
2135
|
{
|
|
2136
|
-
"path": "public/assets/playable-standard-project-
|
|
2137
|
-
"size":
|
|
2138
|
-
"sha256": "
|
|
2136
|
+
"path": "public/assets/playable-standard-project-Do0uyGjy.js",
|
|
2137
|
+
"size": 3597913,
|
|
2138
|
+
"sha256": "afba3b4584375c35c06b4abec09023bb819a2e187e11b3110dfff8bfa986eefd"
|
|
2139
2139
|
},
|
|
2140
2140
|
{
|
|
2141
|
-
"path": "public/assets/playable-standard-project-
|
|
2142
|
-
"size":
|
|
2143
|
-
"sha256": "
|
|
2141
|
+
"path": "public/assets/playable-standard-project-Do0uyGjy.js.br",
|
|
2142
|
+
"size": 746628,
|
|
2143
|
+
"sha256": "bdc5ec2e27ae8b892996e8416137b580f567ebc4a466cdabdfedd025738f14b5"
|
|
2144
2144
|
},
|
|
2145
2145
|
{
|
|
2146
|
-
"path": "public/assets/playable-standard-project-
|
|
2147
|
-
"size":
|
|
2148
|
-
"sha256": "
|
|
2146
|
+
"path": "public/assets/playable-standard-project-Do0uyGjy.js.gz",
|
|
2147
|
+
"size": 963457,
|
|
2148
|
+
"sha256": "b72f71a0d6b28361a78e109a5d57b2acc23a4f8f2b30d3c9cec323d89b7912e9"
|
|
2149
2149
|
},
|
|
2150
2150
|
{
|
|
2151
2151
|
"path": "public/assets/rgbdDecode.fragment-Cf7NitgJ.js",
|
|
@@ -2645,33 +2645,33 @@
|
|
|
2645
2645
|
{
|
|
2646
2646
|
"path": "public/index.html",
|
|
2647
2647
|
"size": 1027,
|
|
2648
|
-
"sha256": "
|
|
2648
|
+
"sha256": "e79be89c3d499dfa8dd3b1bf646d395f40407752747132c5f88bcf8d936ca1d2"
|
|
2649
2649
|
},
|
|
2650
2650
|
{
|
|
2651
2651
|
"path": "public/index.html.br",
|
|
2652
|
-
"size":
|
|
2653
|
-
"sha256": "
|
|
2652
|
+
"size": 394,
|
|
2653
|
+
"sha256": "ab3ba9654d0f49ebd8b5d71472a877d700070e09e773b526005ac68d714813be"
|
|
2654
2654
|
},
|
|
2655
2655
|
{
|
|
2656
2656
|
"path": "public/index.html.gz",
|
|
2657
|
-
"size":
|
|
2658
|
-
"sha256": "
|
|
2657
|
+
"size": 558,
|
|
2658
|
+
"sha256": "c11411cb1e9808a8c8095f297503709e6c1cc239c35f4b463130893681171be4"
|
|
2659
2659
|
},
|
|
2660
2660
|
{
|
|
2661
2661
|
"path": "runtime/editor-control-plane.mjs",
|
|
2662
|
-
"size":
|
|
2663
|
-
"sha256": "
|
|
2662
|
+
"size": 19897,
|
|
2663
|
+
"sha256": "fca765de6ac4b71ae0d8409f9e074e70941db4916dca56597d5df9a1c1e8ade5"
|
|
2664
2664
|
},
|
|
2665
2665
|
{
|
|
2666
2666
|
"path": "worker/editor-service-worker.mjs",
|
|
2667
|
-
"size":
|
|
2668
|
-
"sha256": "
|
|
2667
|
+
"size": 621334,
|
|
2668
|
+
"sha256": "b36a6b8dd71c1545c6918f481a817025ad7aa92726fb3e878e4d587aa3825e63"
|
|
2669
2669
|
}
|
|
2670
2670
|
],
|
|
2671
2671
|
"sizes": {
|
|
2672
|
-
"packagePayloadBytes":
|
|
2673
|
-
"browserRawBytes":
|
|
2674
|
-
"browserGzipBytes":
|
|
2675
|
-
"browserBrotliBytes":
|
|
2672
|
+
"packagePayloadBytes": 16799340,
|
|
2673
|
+
"browserRawBytes": 11093102,
|
|
2674
|
+
"browserGzipBytes": 2702652,
|
|
2675
|
+
"browserBrotliBytes": 2108188
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/editor-deployment",
|
|
3
|
-
"version": "0.2.3-beta.
|
|
3
|
+
"version": "0.2.3-beta.16",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@fps-games/editor-deployment",
|
|
9
|
-
"version": "0.2.3-beta.
|
|
9
|
+
"version": "0.2.3-beta.16",
|
|
10
10
|
"bin": {
|
|
11
11
|
"fps-editor-prepare": "bin/fps-editor-prepare.mjs",
|
|
12
12
|
"fps-editor-server": "bin/fps-editor-server.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fps-games/editor-deployment",
|
|
3
|
-
"version": "0.2.3-beta.
|
|
3
|
+
"version": "0.2.3-beta.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prebuilt FPS Game Editor control plane, browser client, and project preparation tools.",
|
|
6
6
|
"repository": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"node": ">=24 <27"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@fps-games/editor": "0.2.3-beta.
|
|
34
|
-
"@fps-games/editor-core": "0.2.3-beta.
|
|
35
|
-
"@fps-games/editor-playable-sdk": "0.2.3-beta.
|
|
36
|
-
"@fps-games/editor-protocol": "0.2.3-beta.
|
|
33
|
+
"@fps-games/editor": "0.2.3-beta.16",
|
|
34
|
+
"@fps-games/editor-core": "0.2.3-beta.16",
|
|
35
|
+
"@fps-games/editor-playable-sdk": "0.2.3-beta.16",
|
|
36
|
+
"@fps-games/editor-protocol": "0.2.3-beta.16",
|
|
37
37
|
"@fps-games/engine": "0.0.1-beta.21",
|
|
38
|
-
"@fps-games/plugin-hierarchy": "0.2.3-beta.
|
|
38
|
+
"@fps-games/plugin-hierarchy": "0.2.3-beta.16",
|
|
39
39
|
"@fps-games/plugin-sdk": "0.1.0-beta.2"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fD as se,fC as le,a4 as ce,eu as de,mt as ue,iV as pe,fu as fe,ca as he,jM as me,hW as be}from"./playable-standard-project-Do0uyGjy.js";import{registerFpsEditorContribution as ge}from"@fps-games/editor-core/plugin-host";import"./hemisphericLight-C4swwL68.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function a(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(o){if(o.ep)return;o.ep=!0;const r=a(o);fetch(o.href,r)}})();const ye="0.2.3-beta.16",J="fps.plugin.hierarchy";function we(){return se({id:J,version:ye,apiVersion:1,requires:{},provides:{features:["fps.editor.hierarchy"]},entries:{editor:"./editor"},environmentContracts:{editor:{requires:{services:["fps.editor.contributions"]},provides:{}}},deploymentConstraints:{allowedTargets:["editor"]}})}const Se=le({pluginId:J,environment:"editor",register(e){ge(e,{id:ce,kind:"hierarchy",value:de()})}}),Me=1e3,Ie=5e3,Ee="Project I/O health request failed.";function je(e){const t=Ae(e.endpointBase),a=U(e.pollIntervalMs,Me),n=U(e.requestTimeoutMs,Ie);let o=_e(e.initial),r=!1,s=null,i=null;const f=new Set,m=l=>{if(!xe(o,l)){o=l;for(const y of f)y(l)}},u=()=>{r||(s=e.ownerWindow.setTimeout(p,a))},p=async()=>{if(s=null,r)return;const l=new AbortController;i=l;const y=e.ownerWindow.setTimeout(()=>l.abort(),n);try{const M=await e.fetchJson(`${t}/health`,{cache:"no-store",signal:l.signal});m(Pe(M))}catch{r||m(Object.freeze({ready:!1,generation:o.generation,reason:Ee}))}finally{e.ownerWindow.clearTimeout(y),i===l&&(i=null),u()}};return u(),Object.freeze({availability:Object.freeze({getAvailability:()=>o,subscribeAvailability(l){return r?()=>{}:(f.add(l),()=>f.delete(l))}}),stop(){r||(r=!0,s!==null&&e.ownerWindow.clearTimeout(s),s=null,i?.abort(),i=null,f.clear())}})}function Pe(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Project I/O health response must be an object.");const t=e;if(t.schemaVersion!==1||t.kind!=="project-io"||typeof t.ready!="boolean"||!Number.isSafeInteger(t.generation)||t.status!=="ready"&&t.status!=="unavailable")throw new Error("Project I/O health response is invalid.");const a=String(t.generation);return t.ready&&t.status==="ready"?Object.freeze({ready:!0,generation:a}):Object.freeze({ready:!1,generation:a,reason:typeof t.reason=="string"&&t.reason.trim()?t.reason:"Project I/O is unavailable."})}function _e(e){const t=e.generation?.trim();if(!t)throw new Error("Project I/O initial generation is required.");return e.ready?Object.freeze({ready:!0,generation:t}):Object.freeze({ready:!1,generation:t,reason:e.reason?.trim()||"Project I/O is unavailable."})}function xe(e,t){return e.ready===t.ready&&e.generation===t.generation&&(e.ready||t.ready||e.reason===t.reason)}function Ae(e){const t=typeof e=="string"?e.trim().replace(/\/$/,""):"";if(!t)throw new Error("Project I/O endpoint is required.");return t}function U(e,t){return Number.isSafeInteger(e)&&e>0?e:t}async function ve(e){let t=null,a=!1,n=Promise.resolve(),o=null;const r=e.container.ownerDocument,s=r.defaultView??window;let i=null;if(!e.projectIOAvailability&&e.projectIOInitialAvailability&&e.authoringEndpointBase){const c=e.authoringFetchJson??(async(d,h)=>{const b=await s.fetch(d,h),w=await b.json().catch(()=>null);if(!b.ok)throw new Error(`Project I/O health request failed (${b.status}).`);return w});i=je({endpointBase:e.authoringEndpointBase,initial:e.projectIOInitialAvailability,ownerWindow:s,fetchJson:c})}const f=e.projectIOAvailability??i?.availability,m=r.createElement("canvas");m.id="renderCanvas",m.style.cssText="display:block;width:100%;height:100%;touch-action:none;outline:none";const u=()=>{o?.(),o=null,m.remove()},p=c=>{const d=n.then(c,c);return n=d.catch(()=>{}),d},l=()=>{const c=t?.getHost()?.harness.getBrowserAuthoringApi();if(!c)throw new Error("Browser Editor API is unavailable.");return c},y=async(c,d)=>{const h=t?.getHost();if(!h)throw new Error("Editor host is unavailable for asset import.");const b=d?h.harness.projectAssetDropPoint({space:"scene-view-normalized",x:d.x,y:d.y}):null,w=c.objectId??fe([],`${c.assetName??c.projectAssetId??"asset"}_${he()}`),g=await h.harness.executeBrowserAuthoringCapability({capabilityId:"asset.importAndPlace",input:{...c,objectId:w,...b?{position:b}:{}}});if(g.outcome!=="applied"&&g.outcome!=="no-op")throw new Error(g.diagnostics[0]?.message??"Browser asset import and placement failed.")};async function M(){if(a)return;let c=null;try{const d=ue(e.projectDefinition);o?.(),o=Oe(s,e.runtimeAssetBaseUrl),m.parentNode!==e.container&&e.container.appendChild(m);const h=we(),b=Object.freeze({environment:"editor",buildTarget:"editor",manifests:Object.freeze([h]),entries:Object.freeze([{pluginId:h.id,config:null,load:async()=>Se}]),pluginConfigs:Object.freeze({...Object.fromEntries(d.plugins.map(g=>[g.pluginId,g.config])),[h.id]:null})});if(c=await pe(d.project,{root:e.container,window:s,authoringEndpointBase:e.authoringEndpointBase,authoringFetchJson:e.authoringFetchJson,projectIOAvailability:f,...e.agentDocumentSave?{agentDocumentSave:e.agentDocumentSave}:{},onExternalAssetDrop:e.onExternalAssetDrop?async g=>{const P=await e.onExternalAssetDrop?.(g);P&&await y(P,{x:g.point.sceneX,y:g.point.sceneY})}:void 0,projectMode:{async enterEditorMode(){},...e.onEnterPlayMode?{enterPlayMode:e.onEnterPlayMode}:{}},pluginModule:b,getCanvas:()=>m,...e.materialShaderDefinitions?{materialShaderDefinitions:e.materialShaderDefinitions}:{},...e.materialProjectionAdapters?{materialProjectionAdapters:e.materialProjectionAdapters}:{}}),a){await c.dispose(),u();return}t=c,await c.enterEditor();const w=s.__FPS_EDITOR_SYSTEM_FUNCTIONAL_REGISTER__;typeof w=="function"&&w(Object.freeze({readDraft(){const g=t?.getHost()?.harness,P=g?.getWorkingDocument(),N=g?.getPersistedDocument(),k=g?.getDocumentState();return P&&N&&k?Object.freeze({summary:k,workingDocument:P,persistedDocument:N}):null}}))}catch(d){t===c&&(t=null);let h=null;try{await c?.dispose()}catch(b){h=b}finally{u()}if(h){const b=h instanceof Error?h.message:String(h),w=new Error(`Editor mount failed and cleanup also failed: ${b}`);throw Object.assign(w,{cause:d,cleanupError:h}),w}throw d}}try{await p(M)}catch(c){throw i?.stop(),i=null,c}return{getApi:l,async save(){const c=t?.getHost();if(!c)return!1;const d=await c.harness.executeBrowserAuthoringCapability({capabilityId:"document.save",input:{}});return d.outcome==="applied"||d.outcome==="no-op"},reload(){return p(async()=>{const c=t;t=null;try{await c?.dispose()}finally{u()}await M()})},async importAsset({point:c,...d}){await y(d,c)},dispose(){return a=!0,i?.stop(),i=null,p(async()=>{s.__FPS_EDITOR_SYSTEM_FUNCTIONAL_REGISTER__?.(null);const c=t;t=null;try{await c?.dispose()}finally{u()}})}}}function Oe(e,t){const a=e,n=Object.getOwnPropertyDescriptor(a,"__FPS_EDITOR_RUNTIME_URL__");t&&(a.__FPS_EDITOR_RUNTIME_URL__=t);let o=!1;return()=>{o||(o=!0,t&&a.__FPS_EDITOR_RUNTIME_URL__===t&&(n?Object.defineProperty(a,"__FPS_EDITOR_RUNTIME_URL__",n):delete a.__FPS_EDITOR_RUNTIME_URL__))}}const I=(e,t)=>({kind:"number",...e!=null?{min:e}:{},...t!=null?{max:t}:{}}),_={kind:"texture"},L={kind:"color"},$e={kind:"enum",values:["lit","unlit"]},Ce={kind:"enum",values:["opaque","mask","blend"]},Y={lightingModel:$e,baseColor:{kind:"object",properties:{color:L,texture:_,brightness:I(0),saturation:I(0),contrast:I(0),hue:I(-180,180)}},normal:{kind:"object",properties:{texture:_,strength:I(0)}},emission:{kind:"object",properties:{color:L,intensity:I(0),texture:_,maskTexture:_}},alpha:{kind:"object",properties:{mode:Ce,opacity:I(0,1),cutoff:I(0,1),texture:_}}},Fe={kind:"object",properties:{...Y,metallic:I(0,1),roughness:I(0,1),metallicRoughness:{kind:"object",properties:{texture:_}},occlusion:{kind:"object",properties:{texture:_,strength:I(0)}}}},Te={kind:"object",properties:Y},Re={lightingModel:"lit",baseColor:{color:{r:1,g:1,b:1},brightness:1,saturation:1,contrast:1,hue:0},metallic:0,roughness:1,emission:{color:{r:0,g:0,b:0},intensity:0}},De={lightingModel:"lit",baseColor:{color:{r:1,g:1,b:1},brightness:1,saturation:1,contrast:1,hue:0},emission:{color:{r:0,g:0,b:0},intensity:0}},z=[{id:"surface",title:"Surface",order:40},{id:"geometry",title:"Geometry",order:50},{id:"emission",title:"Emission",order:60},{id:"alpha",title:"Alpha",order:70}],x={path:"properties.lightingModel",operator:"equals",value:"lit",inactiveReasonKey:"litMaterial"},Z=[O("properties.lightingModel","surface",1,"enum","assetLightingModel","lightingModel","lit",{options:[{value:"lit",labelKey:"assetLightingModelLit"},{value:"unlit",labelKey:"assetLightingModelUnlit"}],binding:"lightingModel",updateClass:"define"}),O("properties.baseColor.color","surface",2,"color","assetBaseColor","baseColor",{r:1,g:1,b:1},{binding:"baseColor.color"}),$("properties.baseColor.texture.textureAssetId","properties.baseColor.texture","surface",3,"assetBaseTexture","baseTexture","baseColor.texture"),E("properties.baseColor.brightness","surface",4,"assetBrightness","brightness",1,{softMin:0,softMax:4,step:.05,conditions:[A("properties.baseColor.texture.textureAssetId","baseTexture")]}),E("properties.baseColor.saturation","surface",5,"assetSaturation","saturation",1,{softMin:0,softMax:2,step:.05,conditions:[A("properties.baseColor.texture.textureAssetId","baseTexture")]}),E("properties.baseColor.contrast","surface",6,"assetContrast","contrast",1,{softMin:0,softMax:2,step:.05,conditions:[A("properties.baseColor.texture.textureAssetId","baseTexture")]}),E("properties.baseColor.hue","surface",7,"assetHue","hue",0,{step:1,conditions:[A("properties.baseColor.texture.textureAssetId","baseTexture")]}),$("properties.normal.texture.textureAssetId","properties.normal.texture","geometry",10,"assetNormalTexture","normalTexture","normal.texture",[x]),E("properties.normal.strength","geometry",11,"assetNormalStrength","normalStrength",1,{softMin:0,softMax:4,step:.05,conditions:[x,A("properties.normal.texture.textureAssetId","normalTexture")]}),O("properties.emission.color","emission",50,"color","assetEmissionColor","emissionColor",{r:0,g:0,b:0},{binding:"emission.color"}),E("properties.emission.intensity","emission",51,"assetEmissionIntensity","emissionIntensity",0,{softMin:0,softMax:8,step:.05}),$("properties.emission.texture.textureAssetId","properties.emission.texture","emission",52,"assetEmissionTexture","emissionTexture","emission.texture"),O("properties.alpha.mode","alpha",60,"enum","assetAlphaMode","alphaMode","opaque",{options:[{value:"opaque",labelKey:"assetAlphaModeOpaque"},{value:"mask",labelKey:"assetAlphaModeMask"},{value:"blend",labelKey:"assetAlphaModeBlend"}],binding:"alpha.mode",updateClass:"pipeline"}),E("properties.alpha.opacity","alpha",61,"assetAlphaOpacity","alphaOpacity",1,{step:.05,conditions:[{path:"properties.alpha.mode",operator:"equals",value:"blend",inactiveReasonKey:"alphaBlend"}]}),E("properties.alpha.cutoff","alpha",62,"assetAlphaCutoff","alphaCutoff",.5,{step:.01,conditions:[{path:"properties.alpha.mode",operator:"equals",value:"mask",inactiveReasonKey:"alphaMask"}]}),$("properties.alpha.texture.textureAssetId","properties.alpha.texture","alpha",63,"assetAlphaTexture","alphaTexture","alpha.texture",[{path:"properties.alpha.mode",operator:"not-equals",value:"opaque",inactiveReasonKey:"alphaTransparency"}])],Ne=[...Z,E("properties.metallic","geometry",20,"assetMetallic","metallic",0,{step:.05,conditions:[x]}),E("properties.roughness","geometry",21,"assetRoughness","roughness",1,{step:.05,conditions:[x]}),$("properties.metallicRoughness.texture.textureAssetId","properties.metallicRoughness.texture","geometry",22,"assetMetallicRoughnessTexture","metallicRoughnessTexture","metallicRoughness.texture",[x]),$("properties.occlusion.texture.textureAssetId","properties.occlusion.texture","geometry",23,"assetOcclusionTexture","occlusionTexture","occlusion.texture",[x]),E("properties.occlusion.strength","geometry",24,"assetOcclusionStrength","occlusionStrength",1,{softMin:0,softMax:4,step:.05,conditions:[x,A("properties.occlusion.texture.textureAssetId","occlusionTexture")]})],Q=[{shaderId:"fps.builtin.pbr",version:1,runtimeKind:"pbr",displayName:"PBR",propertiesSchema:Fe,defaultProperties:Re,inspector:{sections:z,fields:Ne}},{shaderId:"fps.builtin.standard",version:1,runtimeKind:"standard",displayName:"Standard",propertiesSchema:Te,defaultProperties:De,inspector:{sections:z,fields:Z}}];X(Q);function X(e){const t=new Map;for(const n of e){ke(n,t);const o=Ue(n);t.set(n.shaderId,oe(o))}const a=Object.freeze([...t.values()]);return Object.freeze({get(n){return typeof n=="string"?t.get(n)??null:null},list(){return a}})}function O(e,t,a,n,o,r,s,i){return{path:e,sectionId:t,order:a,control:n,labelKey:o,tooltipKey:r,defaultValue:s,updateClass:"uniform",...i}}function E(e,t,a,n,o,r,s={}){return O(e,t,a,"number",n,o,r,{binding:e.replace(/^properties\./,""),step:s.step??.05,displayPrecision:2,precision:2,...s})}function $(e,t,a,n,o,r,s,i){return O(e,a,n,"texture",o,r,"",{schemaPath:t,binding:s,updateClass:"texture",...i?{conditions:i}:{}})}function A(e,t){return{path:e,operator:"truthy",inactiveReasonKey:t}}function ke(e,t){if(!me(e.shaderId)&&!be(e.shaderId))throw new Error("Material Shader Definition shaderId must be a supported built-in id or a lowercase namespaced project id.");if(!Number.isInteger(e.version)||e.version<=0)throw new Error(`Material Shader Definition ${e.shaderId} must use a positive integer version.`);if(t.has(e.shaderId))throw new Error(`Duplicate Material Shader Definition: ${e.shaderId}`);if(e.sourceFile!=null&&!ze(e.sourceFile))throw new Error(`Material Shader Definition ${e.shaderId} sourceFile must be a safe project-relative path.`);ee(e.shaderId,e.propertiesSchema,"properties");const a=[];if(re(e.propertiesSchema,e.defaultProperties,"properties",a),a.length>0){const r=a[0];throw new Error(`Material Shader Definition ${e.shaderId} default ${r.path} ${r.message}.`)}const n=new Set;for(const r of e.inspector.sections){if(!r.id.trim()||n.has(r.id))throw new Error(`Material Shader Definition ${e.shaderId} contains an invalid or duplicate section: ${r.id}`);n.add(r.id)}const o=new Set;for(const r of e.inspector.fields){if(!r.path.startsWith("properties.")||o.has(r.path))throw new Error(`Material Shader Definition ${e.shaderId} contains an invalid or duplicate field: ${r.path}`);if(!n.has(r.sectionId))throw new Error(`Material Shader Definition ${e.shaderId} field ${r.path} references an unknown section.`);Le(e,r),o.add(r.path)}}function Ue(e){const t=structuredClone(e);return{...t,inspector:{...t.inspector,fields:t.inspector.fields.map(a=>{if(a.control!=="number")return a;const n=te(t.propertiesSchema,a.schemaPath??a.path);return n?.kind!=="number"?a:{...a,...n.min!=null?{min:n.min}:{},...n.max!=null?{max:n.max}:{}}})}}}function Le(e,t){const a=[["min",t.min],["max",t.max],["softMin",t.softMin],["softMax",t.softMax]];for(const[o,r]of a)if(r!=null&&!Number.isFinite(r))throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} ${o} must be finite.`);if(t.control!=="number"){if(a.some(([,o])=>o!=null))throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} uses numeric ranges with a non-number control.`);return}const n=te(e.propertiesSchema,t.schemaPath??t.path);if(n?.kind!=="number")throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} must reference a number schema.`);for(const[o,r,s]of[["min",t.min,n.min],["max",t.max,n.max]])if(r!=null&&r!==s)throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} ${o} must match propertiesSchema.`);if(t.softMin!=null&&t.softMax!=null&&t.softMin>t.softMax)throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} softMin must not exceed softMax.`);if(n.min!=null&&t.softMin!=null&&t.softMin<n.min)throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} softMin must not be below the schema minimum.`);if(n.max!=null&&t.softMax!=null&&t.softMax>n.max)throw new Error(`Material Shader Definition ${e.shaderId} field ${t.path} softMax must not exceed the schema maximum.`)}function ee(e,t,a){if(t.kind==="object"){for(const[n,o]of Object.entries(t.properties))ee(e,o,`${a}.${n}`);return}if(t.kind==="number"){if(t.min!=null&&!Number.isFinite(t.min))throw new Error(`Material Shader Definition ${e} number field ${a} min must be finite.`);if(t.max!=null&&!Number.isFinite(t.max))throw new Error(`Material Shader Definition ${e} number field ${a} max must be finite.`);if(t.min!=null&&t.max!=null&&t.min>t.max)throw new Error(`Material Shader Definition ${e} number field ${a} min must not exceed max.`);return}if(t.kind==="color"&&t.channels!=null&&t.channels!==3&&t.channels!==4)throw new Error(`Material Shader Definition ${e} color field ${a} channels must be 3 or 4.`)}function ze(e){const t=e.trim();return!t||t.startsWith("/")||t.includes("\\")||t.includes(":")?!1:!t.split("/").includes("..")}function Be(e){const t=e.trim();return t.startsWith("properties.")?t:`properties.${t}`}function te(e,t){const a=Be(t).replace(/^properties\./,"").split(".").filter(Boolean);if(a.length===0)return null;let n=e;for(const o of a){if(n.kind!=="object")return null;const r=n.properties[o];if(!r)return null;n=r}return n}function re(e,t,a,n){if(e.kind==="object"){if(!T(t)){n.push({path:a,message:"must be an object"});return}for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(e.properties,r)||n.push({path:`${a}.${r}`,message:"is not supported by the selected shader"});for(const[r,s]of Object.entries(e.properties))t[r]!==void 0&&re(s,t[r],`${a}.${r}`,n);return}if(e.kind==="number"){if(typeof t!="number"||!Number.isFinite(t)){n.push({path:a,message:"must be a finite number"});return}e.min!=null&&t<e.min&&n.push({path:a,message:`must be greater than or equal to ${e.min}`}),e.max!=null&&t>e.max&&n.push({path:a,message:`must be less than or equal to ${e.max}`});return}if(e.kind==="boolean"){typeof t!="boolean"&&n.push({path:a,message:"must be a boolean"});return}if(e.kind==="string"){t!==null&&typeof t!="string"?n.push({path:a,message:"must be a string"}):t===null&&!e.nullable&&n.push({path:a,message:"must not be null"});return}if(e.kind==="enum"){(typeof t!="string"||!e.values.includes(t))&&n.push({path:a,message:`must be one of: ${e.values.join(", ")}`});return}if(e.kind==="color"){const r=e.channels===4?["r","g","b","a"]:["r","g","b"];B(t,a,r,n,e.channels===4?"an RGBA object":"an RGB object");return}if(e.kind==="vec2"||e.kind==="vec3"){B(t,a,e.kind==="vec2"?["x","y"]:["x","y","z"],n,`a ${e.kind} object`);return}if(t===null)return;if(!T(t)){n.push({path:a,message:"must be a texture reference object or null"});return}Object.keys(t).some(r=>r!=="url"&&r!=="textureAssetId")&&n.push({path:a,message:"must contain only url or textureAssetId"});for(const r of["url","textureAssetId"]){const s=t[r];s!==void 0&&(typeof s!="string"||!s.trim())&&n.push({path:`${a}.${r}`,message:"must be a non-empty string"})}}function B(e,t,a,n,o){if(!T(e)){n.push({path:t,message:`must be ${o}`});return}Object.keys(e).some(r=>!a.includes(r))&&n.push({path:t,message:`must contain only ${a.join(", ")}`});for(const r of a)(typeof e[r]!="number"||!Number.isFinite(e[r]))&&n.push({path:`${t}.${r}`,message:"must be a finite number"})}function oe(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(const t of Object.values(e))oe(t)}return e}function T(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}const Ve=Object.freeze([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qe=Object.freeze([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function R(e){return Ge(new TextEncoder().encode(e))}function He(e){return`sha256:${R(JSON.stringify(e))}`}function Ge(e){const t=Math.ceil((e.length+9)/64)*64,a=new Uint8Array(t);a.set(e),a[e.length]=128;const n=new DataView(a.buffer);n.setUint32(t-8,Math.floor(e.length/536870912),!1),n.setUint32(t-4,e.length*8>>>0,!1);const o=[...Ve],r=new Uint32Array(64);for(let s=0;s<a.length;s+=64){for(let c=0;c<16;c+=1)r[c]=n.getUint32(s+c*4,!1);for(let c=16;c<64;c+=1){const d=r[c-15],h=r[c-2],b=j(d,7)^j(d,18)^d>>>3,w=j(h,17)^j(h,19)^h>>>10;r[c]=r[c-16]+b+r[c-7]+w>>>0}let[i,f,m,u,p,l,y,M]=o;for(let c=0;c<64;c+=1){const d=j(p,6)^j(p,11)^j(p,25),h=p&l^~p&y,b=M+d+h+qe[c]+r[c]>>>0,w=j(i,2)^j(i,13)^j(i,22),g=i&f^i&m^f&m,P=w+g>>>0;M=y,y=l,l=p,p=u+b>>>0,u=m,m=f,f=i,i=b+P>>>0}o[0]=o[0]+i>>>0,o[1]=o[1]+f>>>0,o[2]=o[2]+m>>>0,o[3]=o[3]+u>>>0,o[4]=o[4]+p>>>0,o[5]=o[5]+l>>>0,o[6]=o[6]+y>>>0,o[7]=o[7]+M>>>0}return o.map(s=>s.toString(16).padStart(8,"0")).join("")}function j(e,t){return e>>>t|e<<32-t}const We="fps.plugin.materials";function Ke(e){const t=e?.[We];if(t==null)return null;if(!v(t)||t.schemaVersion!==1||typeof t.snapshotId!="string"||!Array.isArray(t.shaders))throw new Error("Materials Plugin snapshot is invalid. Run fps-editor-prepare again.");const a=structuredClone(t);return Je(a),ae(a)}function ne(e){return X([...Q,...e?.shaders.map(t=>t.definition)??[]])}function Je(e){if(!/^sha256:[a-f0-9]{64}$/.test(e.snapshotId)||e.shaders.length===0)throw new Error("Materials Plugin snapshot identity is invalid. Run fps-editor-prepare again.");for(const a of e.shaders)if(!v(a)||!v(a.definition)||!v(a.program))throw new Error("Materials Plugin Shader snapshot is invalid. Run fps-editor-prepare again.");ne(e);for(const a of e.shaders){const{definition:n,program:o}=a;if(o.shaderId!==n.shaderId||o.definitionVersion!==n.version)throw new Error(`Material snapshot Definition identity does not match its program: ${n.shaderId}`);if(o.language!=="glsl"||!V(o.vertexSourcePath)||!V(o.fragmentSourcePath)||!/^[a-f0-9]{64}$/.test(o.vertexSourceHash)||!/^[a-f0-9]{64}$/.test(o.fragmentSourceHash)||typeof o.vertexSource!="string"||!o.vertexSource.trim()||typeof o.fragmentSource!="string"||!o.fragmentSource.trim())throw new Error(`Material snapshot program is invalid: ${n.shaderId}`);if(R(o.vertexSource)!==o.vertexSourceHash||R(o.fragmentSource)!==o.fragmentSourceHash)throw new Error(`Material snapshot source hash does not match its GLSL content: ${n.shaderId}`);if(!Array.isArray(o.attributes)||o.attributes.length===0||o.attributes.some(r=>!/^[A-Za-z_][A-Za-z0-9_]*$/.test(r))||new Set(o.attributes).size!==o.attributes.length)throw new Error(`Material snapshot attributes are invalid: ${n.shaderId}`);if(!["opaque","combine","add"].includes(o.alphaMode)||!v(o.enumUniformValues)||!v(o.frame)||!["on-demand","continuous"].includes(o.frame.mode))throw new Error(`Material snapshot rendering policy is invalid: ${n.shaderId}`)}const t={schemaVersion:e.schemaVersion,shaders:e.shaders};if(He(t)!==e.snapshotId)throw new Error("Materials Plugin snapshot payload does not match its identity. Run fps-editor-prepare again.")}function V(e){return typeof e=="string"&&!!e&&!e.startsWith("/")&&!e.includes("\\")&&!e.includes(":")&&e.split("/").every(t=>!!t&&t!=="."&&t!=="..")}function ae(e){if(!e||typeof e!="object"||Object.isFrozen(e))return e;for(const t of Object.values(e))ae(t);return Object.freeze(e)}function v(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ye(e){let t=0;const a=new WeakMap;return Object.freeze(e.shaders.map(({definition:n,program:o})=>Object.freeze({shaderId:n.shaderId,definitionVersion:n.version,snapshotId:e.snapshotId,createMaterial(r){const s=r.babylon,i=`${rt(n.shaderId)}-${t+=1}`;if(!s.Effect?.ShadersStore||!s.ShaderMaterial||!s.StandardMaterial||!s.Color3)throw new Error(`Babylon ShaderMaterial is unavailable for ${n.shaderId}.`);q(n,r.definitionVersion),s.Effect.ShadersStore[`${i}VertexShader`]=o.vertexSource,s.Effect.ShadersStore[`${i}FragmentShader`]=o.fragmentSource;const f=n.inspector.fields.filter(d=>d.updateClass==="uniform").map(d=>d.binding),m=[...new Set(["world","worldViewProjection",...o.frame.timeUniform?[o.frame.timeUniform]:[],...o.frame.cameraPositionUniform?[o.frame.cameraPositionUniform]:[],...f])];let u;try{u=new s.ShaderMaterial(i,r.scene,{vertex:i,fragment:i},{attributes:o.attributes,uniforms:m,needAlphaBlending:o.alphaMode!=="opaque"}),u.backFaceCulling=o.alphaMode==="opaque",u.alphaMode=o.alphaMode==="add"?s.Constants.ALPHA_ADD:o.alphaMode==="combine"?s.Constants.ALPHA_COMBINE:s.Constants.ALPHA_DISABLE,H(s,u,n,o,r.properties)}catch(d){throw delete s.Effect.ShadersStore[`${i}VertexShader`],delete s.Effect.ShadersStore[`${i}FragmentShader`],u?.dispose?.(),d}const p=Ze(s,r.scene,i),l={material:u,mesh:r.mesh,setMaterial:r.setMaterial,placeholder:p,compiled:!1,disposed:!1,failed:!1,failure:null,compilation:null,invalidateFrameParticipant:null,shaderName:i,shadersStore:s.Effect.ShadersStore};a.set(p,l),a.set(u,l);const y=()=>{l.disposed||l.failed||l.compiled||(l.compiled=!0,l.setMaterial(l.material),Xe(l.mesh))},M=d=>{l.disposed||l.failed||(l.failed=!0,l.failure=d,l.invalidateFrameParticipant?.(),l.setMaterial(l.placeholder),Qe(l.mesh,{code:"material.shaderCompilationFailed",severity:"error",shaderId:n.shaderId,definitionVersion:n.version,snapshotId:e.snapshotId,message:String(d??"Shader compilation failed.").slice(0,2048)}))};u.onCompiled=()=>{queueMicrotask(()=>{y()})},u.onError=(d,h)=>{M(h)};try{if(typeof u.forceCompilationAsync!="function")throw new Error("Babylon ShaderMaterial.forceCompilationAsync() is unavailable.");l.compilation=Promise.resolve(u.forceCompilationAsync(l.mesh)).then(()=>{if(l.failed)throw l.failure;y()}).catch(d=>{throw M(d),d})}catch(d){M(d),l.compilation=Promise.reject(d)}l.compilation.catch(()=>{}),p.forceCompilationAsync=()=>l.compilation;const c=p.dispose.bind(p);return p.dispose=(...d)=>{l.disposed||(l.disposed=!0,l.invalidateFrameParticipant?.(),delete l.shadersStore[`${l.shaderName}VertexShader`],delete l.shadersStore[`${l.shaderName}FragmentShader`],l.material.dispose?.(),c(...d))},p},updateMaterial(r){const s=r.babylon,i=G(r.material)?a.get(r.material):void 0;return!i||i.disposed||i.failed?!1:(q(n,r.definitionVersion),H(s,i.material,n,o,r.properties),!0)},...o.frame.mode==="continuous"?{createFrameParticipant(r){const s=r.babylon,i=G(r.material)?a.get(r.material):void 0;if(!i)throw new Error(`ShaderMaterial state is unavailable for ${n.shaderId}.`);let f=!1;const m=new Set;return i.invalidateFrameParticipant=()=>{for(const u of[...m])u()},{frameMode:"continuous",resolveFrameMode(){return i.failed||i.disposed||f?"on-demand":"continuous"},isActive(){return!i.failed&&!i.disposed&&!f},onFrameModeChanged(u){return m.add(u),()=>m.delete(u)},updateFrame(u){if(!(i.failed||i.disposed||f)&&(o.frame.timeUniform&&i.material.setFloat(o.frame.timeUniform,u.elapsedSeconds),o.frame.cameraPositionUniform)){const p=r.scene.activeCamera;i.material.setVector3(o.frame.cameraPositionUniform,p?.globalPosition??p?.position??s.Vector3.Zero())}},dispose(){f||(f=!0,m.clear(),i.invalidateFrameParticipant&&(i.invalidateFrameParticipant=null))}}}}:{}})))}function q(e,t){if(t!==e.version)throw Object.assign(new Error(`Material Definition version mismatch for ${e.shaderId}: expected ${e.version}, received ${String(t)}.`),{code:"material.shaderDefinitionVersionMismatch",shaderId:e.shaderId,expectedVersion:e.version,actualVersion:t})}function Ze(e,t,a){const n=new e.StandardMaterial(`${a}.diagnostic`,t);return n.diffuseColor=new e.Color3(.8,.02,.45),n.emissiveColor=new e.Color3(.35,0,.12),n.specularColor=new e.Color3(0,0,0),n.backFaceCulling=!1,n}function Qe(e,t){const a=C(e.metadata)?e.metadata:{},n=C(a.editorProjection)?a.editorProjection:{};e.metadata={...a,editorProjection:{...n,materialDiagnostic:Object.freeze({...t})}}}function Xe(e){if(!C(e.metadata)||!C(e.metadata.editorProjection)||!Object.prototype.hasOwnProperty.call(e.metadata.editorProjection,"materialDiagnostic"))return;const t={...e.metadata.editorProjection};delete t.materialDiagnostic,e.metadata={...e.metadata,editorProjection:t}}function H(e,t,a,n,o){for(const r of a.inspector.fields){if(r.updateClass!=="uniform")continue;const s=tt(o,r.path.replace(/^properties\./,""));if(r.control==="number")t.setFloat(r.binding,S(s,r.path));else if(r.control==="boolean")t.setFloat(r.binding,s===!0?1:0);else if(r.control==="enum"){const i=n.enumUniformValues[r.path],f=typeof s=="string"?i?.[s]:void 0;if(!Number.isFinite(f))throw new Error(`Enum uniform value is not mapped: ${r.path}=${String(s)}`);t.setFloat(r.binding,f)}else if(r.control==="color"){const i=F(s,r.path);et(a,r.path)===4?t.setColor4(r.binding,new e.Color4(S(i.r,`${r.path}.r`),S(i.g,`${r.path}.g`),S(i.b,`${r.path}.b`),S(i.a,`${r.path}.a`))):t.setColor3(r.binding,new e.Color3(S(i.r,`${r.path}.r`),S(i.g,`${r.path}.g`),S(i.b,`${r.path}.b`)))}else if(r.control==="vec2"){const i=F(s,r.path);t.setVector2(r.binding,new e.Vector2(S(i.x,`${r.path}.x`),S(i.y,`${r.path}.y`)))}else if(r.control==="vec3"){const i=F(s,r.path);t.setVector3(r.binding,new e.Vector3(S(i.x,`${r.path}.x`),S(i.y,`${r.path}.y`),S(i.z,`${r.path}.z`)))}else throw new Error(`Unsupported ShaderMaterial uniform control: ${r.path} (${r.control})`)}}function et(e,t){let a=e.propertiesSchema;for(const n of t.replace(/^properties\./,"").split(".")){if(a.kind!=="object"||!a.properties[n])return 3;a=a.properties[n]}return a.kind==="color"&&a.channels===4?4:3}function tt(e,t){let a=e;for(const n of t.split(".").filter(Boolean)){if(!C(a))return;a=a[n]}return a}function F(e,t){if(!C(e))throw new Error(`Material property must be an object: ${t}`);return e}function S(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Error(`Material property must be a finite number: ${t}`);return e}function rt(e){return e.replace(/[^a-z0-9_-]/gi,"_")}function G(e){return!!e&&typeof e=="object"}function C(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}const ie=window.__FPS_EDITOR_PROJECT_DEFINITION__;if(!ie)throw new Error("Editor Project definition was not provided by the control plane.");const D=Ke(window.__FPS_EDITOR_PLUGIN_SNAPSHOTS__),ot=ne(D),W=D?Ye(D):void 0,K=()=>{const e=window.__FPS_EDITOR_PROJECT_IO__,t=String(e?.generation??0);return e?.status==="ready"?{ready:!0,generation:t}:{ready:!1,generation:t,reason:e?.reason??"Project I/O is unavailable."}},nt=await ve({container:document.body,projectDefinition:ie,agentDocumentSave:window.__FPS_EDITOR_CONFIG__?.agentDocumentSave,runtimeAssetBaseUrl:window.location.origin,projectIOAvailability:{getAvailability:K,subscribeAvailability(e){const t=()=>e(K());return window.addEventListener("fps-editor:project-io-availability-changed",t),()=>window.removeEventListener("fps-editor:project-io-availability-changed",t)}},async onEnterPlayMode(){const e=window.__FPS_EDITOR_RUNTIME_URL__;if(!e)throw new Error("Editor Runtime URL was not provided by the control plane.");window.location.assign(e)},materialShaderDefinitions:ot,...W?{materialProjectionAdapters:W}:{}});window.addEventListener("pagehide",()=>void nt.dispose(),{once:!0});
|
|
Binary file
|
|
Binary file
|