@needle-tools/engine 6.0.0-alpha.5 → 6.0.0-alpha.6

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 (57) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{materialx-B3qY8vPU.js → materialx-Bd9BE6LR.js} +1 -1
  3. package/dist/{materialx-BwYvA-4x.umd.cjs → materialx-CzRx9AGf.umd.cjs} +2 -2
  4. package/dist/{materialx-CTPhpPxI.min.js → materialx-x1m4IJd1.min.js} +1 -1
  5. package/dist/{needle-engine.bundle-_kAszB-k.min.js → needle-engine.bundle-D6mZl1dR.min.js} +9 -9
  6. package/dist/{needle-engine.bundle-D3nBMgfk.umd.cjs → needle-engine.bundle-DOHf03pR.umd.cjs} +9 -9
  7. package/dist/{needle-engine.bundle-4xlWxOTF.js → needle-engine.bundle-Hu7ZAxEI.js} +550 -555
  8. package/dist/needle-engine.d.ts +14 -14
  9. package/dist/needle-engine.js +562 -562
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/dist/{vendor-BQUQwut5.js → vendor-BatPc34p.js} +50 -41
  13. package/dist/{vendor-BJviq-Oq.umd.cjs → vendor-CDN1hirK.umd.cjs} +1 -1
  14. package/dist/{vendor-CdNldo8c.min.js → vendor-T07c_9f_.min.js} +1 -1
  15. package/lib/engine/api.d.ts +1 -1
  16. package/lib/engine/api.js +1 -1
  17. package/lib/engine/api.js.map +1 -1
  18. package/lib/engine/engine_init.js +2 -2
  19. package/lib/engine/engine_init.js.map +1 -1
  20. package/lib/engine/engine_license.d.ts +7 -7
  21. package/lib/engine/engine_license.js +73 -73
  22. package/lib/engine/engine_license.js.map +1 -1
  23. package/lib/engine/engine_networking_blob.js +3 -3
  24. package/lib/engine/engine_networking_blob.js.map +1 -1
  25. package/lib/engine/engine_utils_qrcode.js +2 -2
  26. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  27. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  28. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  29. package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
  30. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  31. package/lib/engine/webcomponents/needle-engine.js +2 -2
  32. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  33. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  34. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  35. package/lib/engine/xr/TempXRContext.js +2 -2
  36. package/lib/engine/xr/TempXRContext.js.map +1 -1
  37. package/lib/engine-components/Renderer.d.ts +1 -1
  38. package/lib/engine-components/Renderer.js +2 -11
  39. package/lib/engine-components/Renderer.js.map +1 -1
  40. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  41. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  42. package/package.json +2 -2
  43. package/plugins/common/license.js +4 -4
  44. package/plugins/license/cli.js +7 -4
  45. package/plugins/vite/license.js +4 -4
  46. package/src/engine/api.ts +1 -1
  47. package/src/engine/engine_init.ts +2 -2
  48. package/src/engine/engine_license.ts +70 -70
  49. package/src/engine/engine_networking_blob.ts +3 -3
  50. package/src/engine/engine_utils_qrcode.ts +2 -2
  51. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  52. package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
  53. package/src/engine/webcomponents/needle-engine.loading.ts +2 -2
  54. package/src/engine/webcomponents/needle-engine.ts +2 -2
  55. package/src/engine/xr/TempXRContext.ts +2 -2
  56. package/src/engine-components/Renderer.ts +4 -13
  57. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
@@ -42,19 +42,19 @@ function setLicenseTimeout(ctx: IContext, callback: () => void, delay: number) {
42
42
  return timer;
43
43
  }
44
44
 
45
- const $SzX: ((result: boolean) => void)[] = [];
45
+ const _$hziI: ((result: boolean) => void)[] = [];
46
46
 
47
47
  // DO NOT EDIT MANUALLY
48
- let __yPOBaOUW: string = "";
48
+ let __deG: string = "";
49
49
  // eslint-disable-next-line prefer-const
50
- let __WafDZgBF: string = "";
50
+ let yDKPfo: string = "";
51
51
 
52
52
  if (debug) {
53
- console.log("License Type: " + __yPOBaOUW);
54
- if (__WafDZgBF) {
55
- console.log("License JWT: " + __WafDZgBF);
53
+ console.log("License Type: " + __deG);
54
+ if (yDKPfo) {
55
+ console.log("License JWT: " + yDKPfo);
56
56
  try {
57
- const payload = JSON.parse(atob(__WafDZgBF.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
57
+ const payload = JSON.parse(atob(yDKPfo.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
58
58
  console.log("License JWT payload:", payload);
59
59
  }
60
60
  catch { console.log("License JWT payload: (failed to decode)"); }
@@ -65,8 +65,8 @@ if (debug) {
65
65
  }
66
66
 
67
67
  /** @internal */
68
- export function _fncZ() {
69
- switch (__yPOBaOUW) {
68
+ export function $jVksoCHS() {
69
+ switch (__deG) {
70
70
  case "pro":
71
71
  case "enterprise":
72
72
  return true;
@@ -75,8 +75,8 @@ export function _fncZ() {
75
75
  }
76
76
 
77
77
  /** @internal */
78
- export function sUknx() {
79
- switch (__yPOBaOUW) {
78
+ export function _$sHuA() {
79
+ switch (__deG) {
80
80
  case "indie":
81
81
  return true;
82
82
  }
@@ -84,8 +84,8 @@ export function sUknx() {
84
84
  }
85
85
 
86
86
  /** @internal */
87
- export function $QiwPI() {
88
- switch (__yPOBaOUW) {
87
+ export function $BZiUJx() {
88
+ switch (__deG) {
89
89
  case "edu":
90
90
  return true;
91
91
  }
@@ -93,26 +93,26 @@ export function $QiwPI() {
93
93
  }
94
94
 
95
95
  /** @internal */
96
- export function __Pekxq() {
97
- return _fncZ() || sUknx() || $QiwPI();
96
+ export function KLnyx() {
97
+ return $jVksoCHS() || _$sHuA() || $BZiUJx();
98
98
  }
99
99
 
100
100
 
101
101
  /** @internal */
102
- export function _$uqE(cb: (result: boolean) => void) {
103
- if (_fncZ() || sUknx() || $QiwPI()) {
102
+ export function _$jODX(cb: (result: boolean) => void) {
103
+ if ($jVksoCHS() || _$sHuA() || $BZiUJx()) {
104
104
  cb(true);
105
105
  return () => {};
106
106
  }
107
- $SzX.push(cb);
107
+ _$hziI.push(cb);
108
108
  return () => {
109
- const index = $SzX.indexOf(cb);
110
- if (index >= 0) $SzX.splice(index, 1);
109
+ const index = _$hziI.indexOf(cb);
110
+ if (index >= 0) _$hziI.splice(index, 1);
111
111
  };
112
112
  }
113
113
 
114
- function _VnbrRHk(result: boolean) {
115
- for (const cb of $SzX) {
114
+ function __QVQhCm(result: boolean) {
115
+ for (const cb of _$hziI) {
116
116
  try {
117
117
  cb(result);
118
118
  }
@@ -127,7 +127,7 @@ function _VnbrRHk(result: boolean) {
127
127
 
128
128
  // ECDSA P-256 public key for verifying license JWTs (verification-only, safe to ship)
129
129
  /* eslint-disable no-secrets/no-secrets -- public key, not a secret */
130
- const _TkYHC = {
130
+ const _UHT = {
131
131
  kty: "EC",
132
132
  crv: "P-256",
133
133
  x: "A34nyKMjhQYVgzeE4tyLUYdx34TAKogDa7v7PRaO9Lg",
@@ -151,7 +151,7 @@ function base64urlDecode(str: string): Uint8Array {
151
151
  * Verify a JWT license token and return the `type` claim if valid.
152
152
  * Returns null if the JWT is missing, malformed, or has an invalid signature.
153
153
  */
154
- async function $DgqUv(jwt: string): Promise<string | null> {
154
+ async function _$IUNmiHVF(jwt: string): Promise<string | null> {
155
155
  if (!jwt) return null;
156
156
  try {
157
157
  const parts = jwt.split(".");
@@ -161,7 +161,7 @@ async function $DgqUv(jwt: string): Promise<string | null> {
161
161
 
162
162
  const key = await crypto.subtle.importKey(
163
163
  "jwk",
164
- _TkYHC,
164
+ _UHT,
165
165
  { name: "ECDSA", namedCurve: "P-256" },
166
166
  false,
167
167
  ["verify"]
@@ -221,16 +221,16 @@ async function $DgqUv(jwt: string): Promise<string | null> {
221
221
  }
222
222
 
223
223
  /** Verify the injected JWT and update the license type if valid.
224
- * The engine ONLY trusts the JWT — the plain __yPOBaOUW string is ignored. */
224
+ * The engine ONLY trusts the JWT — the plain __deG string is ignored. */
225
225
  let _jwtVerificationPromise: Promise<void> | undefined = undefined;
226
- async function __sXiZ(): Promise<void> {
226
+ async function wJwFeUbX(): Promise<void> {
227
227
  // The bundled JWT may be empty when a build supplies a signed license file.
228
228
  // Do not return early: the meta tag below may provide the JWT instead.
229
229
  // Keep the bundled binding mutable so Vite's esbuild pre-bundling does not
230
230
  // treat its initial empty value as constant and remove JWT verification.
231
- let jwt = __WafDZgBF;
231
+ let jwt = yDKPfo;
232
232
  // Clear the bundled JWT after reading it; this assignment keeps the binding mutable.
233
- __WafDZgBF = "";
233
+ yDKPfo = "";
234
234
  if (!jwt && typeof document !== "undefined") {
235
235
  const licenseFile = document.querySelector('meta[name="needle-license"]')?.getAttribute("content");
236
236
  if (licenseFile) {
@@ -247,14 +247,14 @@ async function __sXiZ(): Promise<void> {
247
247
  }
248
248
  }
249
249
  }
250
- const verifiedType = await $DgqUv(jwt);
250
+ const verifiedType = await _$IUNmiHVF(jwt);
251
251
  if (verifiedType) {
252
- __yPOBaOUW = verifiedType;
252
+ __deG = verifiedType;
253
253
  if (debug) console.log("License type set from verified JWT: " + verifiedType);
254
- _VnbrRHk(__Pekxq());
254
+ __QVQhCm(KLnyx());
255
255
  }
256
256
  else {
257
- __yPOBaOUW = "basic";
257
+ __deG = "basic";
258
258
  if (debug && jwt) console.warn("JWT verification failed — license reset to basic");
259
259
  }
260
260
  }
@@ -377,7 +377,7 @@ export namespace Telemetry {
377
377
  // NOTE: this does NOT affect license enforcement — the /check call, the "forbidden"
378
378
  // overlay and the watermark/logo run on separate, ungated code paths.
379
379
  const attribute = domElement?.getAttribute("no-telemetry");
380
- if (_fncZ() && (attribute === "" || attribute === "true" || attribute === "1")) {
380
+ if ($jVksoCHS() && (attribute === "" || attribute === "true" || attribute === "1")) {
381
381
  if (debug) console.debug("Telemetry is disabled via no-telemetry attribute");
382
382
  return false;
383
383
  }
@@ -705,21 +705,21 @@ export namespace Telemetry {
705
705
  }
706
706
 
707
707
 
708
- export function _BQhd() {
708
+ export function $bqSkkSKJ() {
709
709
 
710
- if(__yPOBaOUW === "") __yPOBaOUW = "basic";
710
+ if(__deG === "") __deG = "basic";
711
711
 
712
712
  // Start JWT verification — must be here (not top-level) to avoid tree-shaking
713
- _jwtVerificationPromise = __sXiZ();
713
+ _jwtVerificationPromise = wJwFeUbX();
714
714
  // Start after setting the initial type. At module scope the type was still "",
715
715
  // so Basic builds skipped the runtime check entirely.
716
- $SIQKzPW = __IdN();
716
+ _$cThps = __zwPG();
717
717
 
718
718
  Telemetry.init();
719
719
  ContextRegistry.registerCallback(ContextEvent.ContextRegistered, evt => {
720
- __NkAi(evt.context);
721
- gpJbHEa(evt.context);
722
- setLicenseTimeout(evt.context, () => _$qviwgZA(evt.context), 2000);
720
+ pTWobY(evt.context);
721
+ _$XfWxk(evt.context);
722
+ setLicenseTimeout(evt.context, () => _YuMDhu(evt.context), 2000);
723
723
  });
724
724
  // ContextCreated fires after the renderer exists, so the canvas is available for context-loss monitoring
725
725
  ContextRegistry.registerCallback(ContextEvent.ContextCreated, evt => {
@@ -728,17 +728,17 @@ export function _BQhd() {
728
728
  });
729
729
  }
730
730
 
731
- export let $SIQKzPW: Promise<void> | undefined = undefined;
731
+ export let _$cThps: Promise<void> | undefined = undefined;
732
732
  let applicationIsForbidden = false;
733
733
  let applicationForbiddenText = "";
734
- async function __IdN() {
734
+ async function __zwPG() {
735
735
  // Only perform the runtime license check once
736
- if ($SIQKzPW) return $SIQKzPW;
736
+ if (_$cThps) return _$cThps;
737
737
  // Wait for JWT verification to complete first (if running)
738
738
  if (_jwtVerificationPromise) {
739
739
  await _jwtVerificationPromise;
740
740
  }
741
- if (__yPOBaOUW === "basic") {
741
+ if (__deG === "basic") {
742
742
  try {
743
743
  const licenseUrl = "https://needle.tools/api/v1/needle-engine/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
744
744
  const res = await fetch(licenseUrl, {
@@ -750,27 +750,27 @@ async function __IdN() {
750
750
  if (res?.status === 200) {
751
751
  applicationIsForbidden = false;
752
752
  if (debug) console.log("License check succeeded");
753
- __yPOBaOUW = "pro";
754
- _VnbrRHk(true);
753
+ __deG = "pro";
754
+ __QVQhCm(true);
755
755
  }
756
756
  else if (res?.status === 403) {
757
- _VnbrRHk(false);
757
+ __QVQhCm(false);
758
758
  applicationIsForbidden = true;
759
759
  applicationForbiddenText = await res.text();
760
760
  }
761
761
  else {
762
- _VnbrRHk(false);
762
+ __QVQhCm(false);
763
763
  if (debug) console.log("License check failed with status " + res?.status);
764
764
  }
765
765
  }
766
766
  catch (err) {
767
- _VnbrRHk(false);
767
+ __QVQhCm(false);
768
768
  if (debug) console.error("License check failed", err);
769
769
  }
770
770
  }
771
- else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + __yPOBaOUW + "\"");
771
+ else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + __deG + "\"");
772
772
  }
773
- async function gpJbHEa(ctx: IContext) {
773
+ async function _$XfWxk(ctx: IContext) {
774
774
  function createForbiddenElement() {
775
775
  const div = document.createElement("div");
776
776
  div.className = "needle-forbidden";
@@ -835,40 +835,40 @@ async function gpJbHEa(ctx: IContext) {
835
835
  }, 500)
836
836
  }
837
837
 
838
- async function __NkAi(ctx: IContext) {
838
+ async function pTWobY(ctx: IContext) {
839
839
  try {
840
- if (!_fncZ() && !sUknx()) {
841
- return _$SggUg(ctx);
840
+ if (!$jVksoCHS() && !_$sHuA()) {
841
+ return $KXTmgnjE(ctx);
842
842
  }
843
843
  }
844
844
  catch (err) {
845
845
  if (debug) console.log("License check failed", err)
846
- return _$SggUg(ctx)
846
+ return $KXTmgnjE(ctx)
847
847
  }
848
- if (debug) _$SggUg(ctx)
848
+ if (debug) $KXTmgnjE(ctx)
849
849
  }
850
850
 
851
851
 
852
852
 
853
- async function _$SggUg(ctx: IContext) {
853
+ async function $KXTmgnjE(ctx: IContext) {
854
854
 
855
855
  // if the engine loads faster than the license check, we need to capture the ready event here
856
856
  let isReady = false;
857
857
  ctx.domElement.addEventListener("ready", () => isReady = true);
858
858
 
859
- await $SIQKzPW?.catch(() => { });
859
+ await _$cThps?.catch(() => { });
860
860
 
861
861
 
862
- if (_fncZ() || sUknx()) return;
863
- if (__Pekxq() === false) __cOTtAEOb();
862
+ if ($jVksoCHS() || _$sHuA()) return;
863
+ if (KLnyx() === false) $vKd();
864
864
 
865
865
  // check if the engine is already ready (meaning has finished loading)
866
866
  if (isReady) {
867
- _pphXrOg(ctx);
867
+ __OzoZ(ctx);
868
868
  }
869
869
  else {
870
870
  ctx.domElement.addEventListener("ready", () => {
871
- _pphXrOg(ctx);
871
+ __OzoZ(ctx);
872
872
  });
873
873
  }
874
874
  }
@@ -876,7 +876,7 @@ async function _$SggUg(ctx: IContext) {
876
876
  // const licenseElementIdentifier = "needle-license-element";
877
877
  // const licenseDuration = 10000;
878
878
  // const licenseDelay = 1200;
879
- function _pphXrOg(ctx: IContext) {
879
+ function __OzoZ(ctx: IContext) {
880
880
 
881
881
  const style = `
882
882
  position: relative;
@@ -889,7 +889,7 @@ function _pphXrOg(ctx: IContext) {
889
889
  padding: 10px;
890
890
  padding-left: 30px;
891
891
  `;
892
- if (__yPOBaOUW === "edu") {
892
+ if (__deG === "edu") {
893
893
  if (navigator.webdriver) {
894
894
  console.log("This project is supported by Needle for Education – https://needle.tools");
895
895
  }
@@ -946,7 +946,7 @@ function _pphXrOg(ctx: IContext) {
946
946
  }
947
947
  }, 1000);
948
948
 
949
- if ($QiwPI()) {
949
+ if ($BZiUJx()) {
950
950
  const removeDelay = 20_000;
951
951
  setLicenseTimeout(ctx, () => {
952
952
  clearInterval(interval);
@@ -955,7 +955,7 @@ function _pphXrOg(ctx: IContext) {
955
955
  const intervalInMinutes = 5;
956
956
  setLicenseTimeout(ctx, () => {
957
957
  if (ctx.domElement.parentNode)
958
- _pphXrOg(ctx);
958
+ __OzoZ(ctx);
959
959
  }, 1000 * 60 * intervalInMinutes)
960
960
  }, removeDelay);
961
961
  }
@@ -966,7 +966,7 @@ function _pphXrOg(ctx: IContext) {
966
966
  const base64Logo = "data:image/webp;base64,UklGRrABAABXRUJQVlA4WAoAAAAQAAAAHwAAHwAAQUxQSKEAAAARN6CmbSM4WR7vdARON11EBDq3fLiNbVtVzpMCPlKAEzsx0Y/x+Ovuv4dn0EFE/ydAvz6YggXzgh5sVgXM/zOC/4sii7qgGvB5N7hmuQYwkvazWAu1JPW41FXSHq6pnaQWvqYH18Fc0j1hO/BFTtIeSBlJi5w6qIIO7IOrwhFsB2Yxukif0FTRLpXswHR8MxbslKe9VZsn/Ub5C7YFOpqSTABWUDgg6AAAAFAGAJ0BKiAAIAA+7VyoTqmkpCI3+qgBMB2JbACdMt69DwMIQBLhkTO6XwY00UEDK6cNIDnuNibPf0EgAP7Y1myuiQHLDsF/0h5unrGh6WAbv7aegg2ZMd3uRKfT/3SJztcaujYfTvMXspfCTmYcoO6a+vhC3ss4M8uM58t4siiu59I4aOl59e9Sr6xoxYlHf2v+NnBNpJYeJf8jABQAId/PXuBkLEFkiCucgSGEcfhvajql/j3reCGl0M5/9gQWy7ayNPs+wlvIxFnNfSlfuND4CZOCyxOHhRqOmHN4ULHo3tCSrUNvgAA=";
967
967
 
968
968
  let lastLogTime = 0;
969
- async function __cOTtAEOb(_logo?: string) {
969
+ async function $vKd(_logo?: string) {
970
970
  const now = Date.now();
971
971
  if (now - lastLogTime < 2000) return;
972
972
  lastLogTime = now;
@@ -999,7 +999,7 @@ async function __cOTtAEOb(_logo?: string) {
999
999
  }
1000
1000
 
1001
1001
 
1002
- async function _$qviwgZA(context: IContext) {
1002
+ async function _YuMDhu(context: IContext) {
1003
1003
  // isAllowed() now also covers cross-origin-isolated pages (where beacons can't be sent)
1004
1004
  // and Do Not Track / GPC.
1005
1005
  if (!Telemetry.isAllowed(context)) {
@@ -1013,7 +1013,7 @@ async function _$qviwgZA(context: IContext) {
1013
1013
 
1014
1014
  // current url without query parameters
1015
1015
  const currentUrl = window.location.href.split("?")[0];
1016
- const license = __yPOBaOUW;
1016
+ const license = __deG;
1017
1017
 
1018
1018
  const beaconData = {
1019
1019
  license,
@@ -1,7 +1,7 @@
1
1
  import { FileLoader } from "three";
2
2
 
3
3
  import { showBalloonWarning } from "./debug/index.js";
4
- import { __Pekxq } from "./engine_license.js";
4
+ import { KLnyx } from "./engine_license.js";
5
5
  import { delay } from "./engine_utils.js";
6
6
  import { md5AsBytes, md5Hex, sha256Base64 } from "./engine_utils_hash.js";
7
7
 
@@ -45,7 +45,7 @@ export namespace BlobStorage {
45
45
  */
46
46
  export function canUpload(info: { filesize: number }) {
47
47
  const sizeInMB = info.filesize / 1024 / 1024;
48
- if (__Pekxq()) {
48
+ if (KLnyx()) {
49
49
  return sizeInMB < maxSizeInMB;
50
50
  }
51
51
  return sizeInMB < maxFreeSizeInMB;
@@ -100,7 +100,7 @@ export namespace BlobStorage {
100
100
  console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max allowed size is ${maxSizeInMB}MB`);
101
101
  return null;
102
102
  }
103
- else if (!__Pekxq() && filesizeInMB > maxFreeSizeInMB) {
103
+ else if (!KLnyx() && filesizeInMB > maxFreeSizeInMB) {
104
104
  if (opts?.silent !== true) showBalloonWarning(`File is too large for uploading. Please get a <a href=\"https://needle.tools/pricing\" target=\"_blank\">commercial license</a> to upload files larger than 5MB`);
105
105
  console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max size is 5MB for non-commercial users. Please get a commercial license at https://needle.tools/pricing for larger files (up to 50MB)`);
106
106
  return null;
@@ -4,7 +4,7 @@ import { Quaternion, Vector2, Vector3, Vector4 } from "three";
4
4
 
5
5
  import { needleLogoOnlySVG } from "./assets/index.js";
6
6
  import { isDevEnvironment } from "./debug/debug.js";
7
- import { __Pekxq } from "./engine_license.js";
7
+ import { KLnyx } from "./engine_license.js";
8
8
  import { InternalAttributeUtils } from "./engine_utils_attributes.js";
9
9
  import type { NeedleEngineWebComponent } from "./webcomponents/needle-engine.js";
10
10
 
@@ -135,7 +135,7 @@ async function internalRenderQRCodeOverlays(canvas: HTMLCanvasElement, args: { s
135
135
  console.debug("[QR Code] No web component found")
136
136
  }
137
137
 
138
- const canUseCustomLogo = __Pekxq();
138
+ const canUseCustomLogo = KLnyx();
139
139
 
140
140
  // Query logo src from needle-engine attribute.
141
141
  // For any supported attribute it's possible to use "falsey" values (e.g. "0" or "false" to disable the logo in the QR code)
@@ -2,7 +2,7 @@ import { Mesh, Object3D, TextureLoader, Vector4 } from "three";
2
2
  import ThreeMeshUI from "three-mesh-ui";
3
3
 
4
4
  import { addNewComponent } from "../../engine_components.js";
5
- import { __Pekxq } from "../../engine_license.js";
5
+ import { KLnyx } from "../../engine_license.js";
6
6
  import { OneEuroFilterXYZ } from "../../engine_math.js";
7
7
  import type { Context } from "../../engine_setup.js";
8
8
  import { lookAtObject } from "../../engine_three_utils.js";
@@ -321,7 +321,7 @@ export class NeedleSpatialMenu {
321
321
  }
322
322
  if (this.menu) {
323
323
  const index = this.menu.children.indexOf(this._poweredByNeedleElement as any);
324
- if (!this._showNeedleLogo && __Pekxq()) {
324
+ if (!this._showNeedleLogo && KLnyx()) {
325
325
  if (index >= 0) {
326
326
  this._poweredByNeedleElement.removeFromParent();
327
327
  this.markDirty();
@@ -1,6 +1,6 @@
1
1
  import { showBalloonMessage } from "../../debug/debug.js";
2
2
  import type { Context } from "../../engine_context.js";
3
- import { __Pekxq, _$uqE, Telemetry } from "../../engine_license.js";
3
+ import { KLnyx, _$jODX, Telemetry } from "../../engine_license.js";
4
4
  import { isLocalNetwork } from "../../engine_networking_utils.js";
5
5
  import { HTMLElementBase } from "../../engine_ssr.js";
6
6
  import { DeviceUtilities, getParam } from "../../engine_utils.js";
@@ -801,8 +801,8 @@ export class NeedleMenuElement extends HTMLElementBase {
801
801
  // calling this method immediately will cause an issue with vite bundling tho
802
802
  this._licenseFrame = window.requestAnimationFrame(() => {
803
803
  this._licenseFrame = undefined;
804
- this._unsubscribeLicense = _$uqE(res => {
805
- if (res == true && __Pekxq() && !debugNonCommercial) {
804
+ this._unsubscribeLicense = _$jODX(res => {
805
+ if (res == true && KLnyx() && !debugNonCommercial) {
806
806
  let visible = this._userRequestedLogoVisible;
807
807
  if (visible === undefined) visible = false;
808
808
  this.___onSetLogoVisible(visible);
@@ -854,7 +854,7 @@ export class NeedleMenuElement extends HTMLElementBase {
854
854
  // ensure the menu is not hidden or removed
855
855
  const requiredParent = this?.parentNode;
856
856
  if (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || requiredParent != this._domElement?.shadowRoot) {
857
- if (!__Pekxq()) {
857
+ if (!KLnyx()) {
858
858
  const change = changeEventCounter++;
859
859
  // if a user doesn't have a local pro license *but* for development the menu is hidden then we show a warning
860
860
  if (isLocalNetwork() && this._userRequestedMenuVisible === false) {
@@ -950,7 +950,7 @@ export class NeedleMenuElement extends HTMLElementBase {
950
950
  showNeedleLogo(visible: boolean) {
951
951
  this._userRequestedLogoVisible = visible;
952
952
  if (!visible) {
953
- if (!__Pekxq() || debugNonCommercial) {
953
+ if (!KLnyx() || debugNonCommercial) {
954
954
  console.warn("[Needle Engine] You need a commercial license to hide the Needle Engine logo in production.");
955
955
  const localNetwork = isLocalNetwork()
956
956
  if (!localNetwork) return;
@@ -1,6 +1,6 @@
1
1
  import { needleLogoOnlySVG } from "../assets/index.js"
2
2
  import { showBalloonWarning } from "../debug/index.js";
3
- import { _fncZ } from "../engine_license.js";
3
+ import { $jVksoCHS } from "../engine_license.js";
4
4
  import { Mathf } from "../engine_math.js";
5
5
  import { LoadingProgressArgs } from "../engine_setup.js";
6
6
  import { getParam } from "../engine_utils.js";
@@ -402,7 +402,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
402
402
  const logoToggle = InternalAttributeUtils.getAttributeAndCheckFalsey(this._element, "loading-logo");
403
403
  const showLogo = logoToggle !== null && logoToggle !== false;
404
404
 
405
- const hasLicense = _fncZ();
405
+ const hasLicense = $jVksoCHS();
406
406
 
407
407
  const className = this._loadingElementOptions?.className ?? EngineLoadingView.LoadingContainerClassName;
408
408
  el.classList.add(className);
@@ -3,7 +3,7 @@ import type { Texture } from "three";
3
3
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
4
4
  import { PUBLIC_KEY, VERSION } from "../engine_constants.js";
5
5
  import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
6
- import { __Pekxq, Telemetry } from "../engine_license.js";
6
+ import { KLnyx, Telemetry } from "../engine_license.js";
7
7
  import { onStart } from "../engine_lifecycle_api.js";
8
8
  import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "../engine_loaders.gltf.js";
9
9
  import { Context, ContextCreateArgs } from "../engine_setup.js";
@@ -617,7 +617,7 @@ export class NeedleEngineWebComponent extends HTMLElementBase implements INeedle
617
617
 
618
618
 
619
619
  // Loading start events
620
- const allowOverridingDefaultLoading = __Pekxq();
620
+ const allowOverridingDefaultLoading = KLnyx();
621
621
  // default loading can be overriden by calling preventDefault in the onload start event
622
622
  this.ensureLoadStartIsRegistered();
623
623
  let useDefaultLoading = this.dispatchEvent(new CustomEvent("loadstart", {
@@ -3,7 +3,7 @@ import { ArrayCamera, AxesHelper, Camera, Color, DirectionalLight, Fog, GridHelp
3
3
  import { needleLogoOnlySVG } from "../assets/index.js";
4
4
  import { isDevEnvironment } from "../debug/index.js";
5
5
  import { ObjectUtils, PrimitiveType } from "../engine_create_objects.js";
6
- import { __Pekxq } from "../engine_license.js";
6
+ import { KLnyx } from "../engine_license.js";
7
7
  import { Mathf } from "../engine_math.js";
8
8
  import { delay, DeviceUtilities } from "../engine_utils.js";
9
9
 
@@ -215,7 +215,7 @@ export class TemporaryXRContext {
215
215
  this._scene.background = new Color(0x000000);
216
216
 
217
217
  let logoSrc = needleLogoOnlySVG;
218
- if (__Pekxq()) {
218
+ if (KLnyx()) {
219
219
  const htmlComponent = document.querySelector("needle-engine");
220
220
  if (htmlComponent) {
221
221
  const licenseLogo = htmlComponent.getAttribute("logo-src");
@@ -1,5 +1,5 @@
1
1
  import { getRaycastMesh } from "@needle-tools/gltf-progressive";
2
- import { AxesHelper, Material, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, MeshStandardMaterial, Object3D, RawShaderMaterial, ShaderMaterial, SkinnedMesh, Texture, Vector4 } from "three";
2
+ import { AxesHelper, Material, Mesh, MeshPhysicalMaterial, MeshStandardMaterial, Object3D, RawShaderMaterial, ShaderMaterial, SkinnedMesh, Texture, Vector4 } from "three";
3
3
 
4
4
  import { showBalloonWarning } from "../engine/debug/index.js";
5
5
  import { getComponent, getOrAddComponent } from "../engine/engine_components.js";
@@ -305,21 +305,12 @@ export class Renderer extends Behaviour implements IRenderer {
305
305
  // private _materialProperties: Array<MaterialProperties> | undefined = undefined;
306
306
  private _lightmaps?: RendererLightmap[];
307
307
 
308
- /** Get the mesh Object3D for this renderer
309
- * Warn: if this is a multimaterial object it will return the first mesh only
308
+ /** Get the mesh Object3D for this renderer
309
+ * Warn: if this is a multimaterial object it will return the first submesh only (same as `sharedMeshes[0]`), use {@link sharedMeshes} to get all of them
310
310
  * @returns a mesh object3D.
311
311
  * */
312
312
  get sharedMesh(): Mesh | SkinnedMesh | undefined {
313
- if (this.gameObject.type === "Mesh") {
314
- return this.gameObject as unknown as Mesh
315
- }
316
- else if (this.gameObject.type === "SkinnesMesh") {
317
- return this.gameObject as unknown as SkinnedMesh;
318
- }
319
- else if (this.gameObject.type === "Group") {
320
- return this.gameObject.children[0] as unknown as Mesh;
321
- }
322
- return undefined;
313
+ return this.sharedMeshes[0];
323
314
  }
324
315
 
325
316
  private readonly _sharedMeshes: Mesh[] = [];
@@ -3,7 +3,7 @@ import { Euler, Material, Matrix4, Mesh, Object3D, Quaternion, Vector3 } from "t
3
3
 
4
4
  import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../../../engine/debug/index.js";
5
5
  import { findObjectOfType } from "../../../engine/engine_components.js";
6
- import { _fncZ } from "../../../engine/engine_license.js";
6
+ import { $jVksoCHS } from "../../../engine/engine_license.js";
7
7
  import { serializable } from "../../../engine/engine_serialization.js";
8
8
  import { getFormattedDate, Progress } from "../../../engine/engine_time_utils.js";
9
9
  import { DeviceUtilities, getParam } from "../../../engine/engine_utils.js";
@@ -277,7 +277,7 @@ export class USDZExporter extends Behaviour {
277
277
  let name = this.exportFileName ?? this.objectToExport?.name ?? this.name;
278
278
  name += "-" + getFormattedDate(); // seems iOS caches the file in some cases, this ensures we always have a fresh file
279
279
 
280
- if (!_fncZ()) {
280
+ if (!$jVksoCHS()) {
281
281
  if (name !== "") name += "-";
282
282
  name += "MadeWithNeedle";
283
283
  }
@@ -682,7 +682,7 @@ export class USDZExporter extends Behaviour {
682
682
  if (debug)
683
683
  showBalloonMessage("Quicklook url: " + callToActionURL);
684
684
  if (callToActionURL) {
685
- if (!_fncZ()) {
685
+ if (!$jVksoCHS()) {
686
686
  console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", callToActionURL)
687
687
  }
688
688
  else {
@@ -697,7 +697,7 @@ export class USDZExporter extends Behaviour {
697
697
  private buildQuicklookOverlay(): CustomBranding {
698
698
  const obj: CustomBranding = {};
699
699
  if (this.customBranding) Object.assign(obj, this.customBranding);
700
- if (!_fncZ()) {
700
+ if (!$jVksoCHS()) {
701
701
  console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing");
702
702
  obj.callToAction = "Close";
703
703
  obj.checkoutTitle = "🌵 Made with Needle";