@gui-chat-plugin/present3d 0.0.1 → 0.0.2

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/dist/vue.js CHANGED
@@ -1,9 +1,7 @@
1
- import { c as N, d as Z, s as ft, p as bt } from "./toThreeJS-EXFMlO7B.js";
2
- import { a as he, e as le } from "./toThreeJS-EXFMlO7B.js";
3
- import { defineComponent as tt, ref as R, computed as et, onMounted as it, nextTick as q, onUnmounted as st, watch as O, createElementBlock as K, openBlock as H, createElementVNode as _, createCommentVNode as gt, toDisplayString as k, createTextVNode as j, withDirectives as yt, vModelText as wt } from "vue";
4
- import * as g from "three";
5
- import { Controls as Pt, Vector3 as E, MOUSE as C, TOUCH as x, Quaternion as B, Spherical as Q, Vector2 as P, Ray as Et, Plane as St, MathUtils as Dt } from "three";
6
- const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = new Et(), J = new St(), Tt = Math.cos(70 * Dt.DEG2RAD), d = new E(), f = 2 * Math.PI, l = {
1
+ import { C as Pt, V as P, M as x, T as O, Q as G, S as q, a as w, R as Et, P as St, b as Dt, c as J, d as tt, e as et, W as it, A as st, D as ot, G as Tt, p as z, f as Y, s as vt, g as Mt } from "./index-BXHIfuts.js";
2
+ import { h as ue, i as me } from "./index-BXHIfuts.js";
3
+ import { defineComponent as at, ref as M, computed as nt, onMounted as rt, nextTick as B, onUnmounted as ht, watch as R, createElementBlock as Z, openBlock as K, createElementVNode as _, createCommentVNode as Rt, toDisplayString as A, createTextVNode as k, withDirectives as Ot, vModelText as xt } from "vue";
4
+ const Q = { type: "change" }, F = { type: "start" }, lt = { type: "end" }, j = new Et(), $ = new St(), Ct = Math.cos(70 * Dt.DEG2RAD), d = new P(), f = 2 * Math.PI, l = {
7
5
  NONE: -1,
8
6
  ROTATE: 0,
9
7
  DOLLY: 1,
@@ -12,10 +10,10 @@ const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = n
12
10
  TOUCH_PAN: 4,
13
11
  TOUCH_DOLLY_PAN: 5,
14
12
  TOUCH_DOLLY_ROTATE: 6
15
- }, Y = 1e-6;
16
- class vt extends Pt {
13
+ }, U = 1e-6;
14
+ class Lt extends Pt {
17
15
  constructor(t, e = null) {
18
- super(t, e), this.state = l.NONE, this.enabled = !0, this.target = new E(), this.cursor = new E(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: C.ROTATE, MIDDLE: C.DOLLY, RIGHT: C.PAN }, this.touches = { ONE: x.ROTATE, TWO: x.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new E(), this._lastQuaternion = new B(), this._lastTargetPosition = new E(), this._quat = new B().setFromUnitVectors(t.up, new E(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Q(), this._sphericalDelta = new Q(), this._scale = 1, this._panOffset = new E(), this._rotateStart = new P(), this._rotateEnd = new P(), this._rotateDelta = new P(), this._panStart = new P(), this._panEnd = new P(), this._panDelta = new P(), this._dollyStart = new P(), this._dollyEnd = new P(), this._dollyDelta = new P(), this._dollyDirection = new E(), this._mouse = new P(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Rt.bind(this), this._onPointerDown = Mt.bind(this), this._onPointerUp = Ot.bind(this), this._onContextMenu = zt.bind(this), this._onMouseWheel = Lt.bind(this), this._onKeyDown = At.bind(this), this._onTouchStart = kt.bind(this), this._onTouchMove = jt.bind(this), this._onMouseDown = xt.bind(this), this._onMouseMove = Ct.bind(this), this._interceptControlDown = Nt.bind(this), this._interceptControlUp = It.bind(this), this.domElement !== null && this.connect(), this.update();
16
+ super(t, e), this.state = l.NONE, this.enabled = !0, this.target = new P(), this.cursor = new P(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: x.ROTATE, MIDDLE: x.DOLLY, RIGHT: x.PAN }, this.touches = { ONE: O.ROTATE, TWO: O.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new G(), this._lastTargetPosition = new P(), this._quat = new G().setFromUnitVectors(t.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new q(), this._sphericalDelta = new q(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new w(), this._rotateEnd = new w(), this._rotateDelta = new w(), this._panStart = new w(), this._panEnd = new w(), this._panDelta = new w(), this._dollyStart = new w(), this._dollyEnd = new w(), this._dollyDelta = new w(), this._dollyDirection = new P(), this._mouse = new w(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = kt.bind(this), this._onPointerDown = At.bind(this), this._onPointerUp = jt.bind(this), this._onContextMenu = Kt.bind(this), this._onMouseWheel = It.bind(this), this._onKeyDown = Ut.bind(this), this._onTouchStart = Yt.bind(this), this._onTouchMove = Zt.bind(this), this._onMouseDown = zt.bind(this), this._onMouseMove = Nt.bind(this), this._interceptControlDown = Ft.bind(this), this._interceptControlUp = Ht.bind(this), this.domElement !== null && this.connect(), this.update();
19
17
  }
20
18
  connect() {
21
19
  this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -45,7 +43,7 @@ class vt extends Pt {
45
43
  this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
46
44
  }
47
45
  reset() {
48
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent($), this.update(), this.state = l.NONE;
46
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Q), this.update(), this.state = l.NONE;
49
47
  }
50
48
  update(t = null) {
51
49
  const e = this.object.position;
@@ -67,20 +65,20 @@ class vt extends Pt {
67
65
  const u = p - c;
68
66
  this.object.position.addScaledVector(this._dollyDirection, u), this.object.updateMatrixWorld(), n = !!u;
69
67
  } else if (this.object.isOrthographicCamera) {
70
- const p = new E(this._mouse.x, this._mouse.y, 0);
68
+ const p = new P(this._mouse.x, this._mouse.y, 0);
71
69
  p.unproject(this.object);
72
70
  const u = this.object.zoom;
73
71
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = u !== this.object.zoom;
74
- const v = new E(this._mouse.x, this._mouse.y, 0);
75
- v.unproject(this.object), this.object.position.sub(v).add(p), this.object.updateMatrixWorld(), c = d.length();
72
+ const T = new P(this._mouse.x, this._mouse.y, 0);
73
+ T.unproject(this.object), this.object.position.sub(T).add(p), this.object.updateMatrixWorld(), c = d.length();
76
74
  } else
77
75
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
78
- c !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position) : (z.origin.copy(this.object.position), z.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(z.direction)) < Tt ? this.object.lookAt(this.target) : (J.setFromNormalAndCoplanarPoint(this.object.up, this.target), z.intersectPlane(J, this.target))));
76
+ c !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position) : (j.origin.copy(this.object.position), j.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(j.direction)) < Ct ? this.object.lookAt(this.target) : ($.setFromNormalAndCoplanarPoint(this.object.up, this.target), j.intersectPlane($, this.target))));
79
77
  } else if (this.object.isOrthographicCamera) {
80
78
  const c = this.object.zoom;
81
79
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), c !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
82
80
  }
83
- return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > Y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Y || this._lastTargetPosition.distanceToSquared(this.target) > Y ? (this.dispatchEvent($), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
81
+ return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > U || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > U || this._lastTargetPosition.distanceToSquared(this.target) > U ? (this.dispatchEvent(Q), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
84
82
  }
85
83
  _getAutoRotationAngle(t) {
86
84
  return t !== null ? f / 60 * this.autoRotateSpeed * t : f / 60 / 60 * this.autoRotateSpeed;
@@ -248,7 +246,7 @@ class vt extends Pt {
248
246
  }
249
247
  _trackPointer(t) {
250
248
  let e = this._pointerPositions[t.pointerId];
251
- e === void 0 && (e = new P(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
249
+ e === void 0 && (e = new w(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
252
250
  }
253
251
  _getSecondPointerPosition(t) {
254
252
  const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -272,16 +270,16 @@ class vt extends Pt {
272
270
  return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
273
271
  }
274
272
  }
275
- function Mt(i) {
273
+ function At(i) {
276
274
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
277
275
  }
278
- function Rt(i) {
276
+ function kt(i) {
279
277
  this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
280
278
  }
281
- function Ot(i) {
279
+ function jt(i) {
282
280
  switch (this._removePointer(i), this._pointers.length) {
283
281
  case 0:
284
- this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ot), this.state = l.NONE;
282
+ this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(lt), this.state = l.NONE;
285
283
  break;
286
284
  case 1:
287
285
  const t = this._pointers[0], e = this._pointerPositions[t];
@@ -289,7 +287,7 @@ function Ot(i) {
289
287
  break;
290
288
  }
291
289
  }
292
- function xt(i) {
290
+ function zt(i) {
293
291
  let t;
294
292
  switch (i.button) {
295
293
  case 0:
@@ -305,11 +303,11 @@ function xt(i) {
305
303
  t = -1;
306
304
  }
307
305
  switch (t) {
308
- case C.DOLLY:
306
+ case x.DOLLY:
309
307
  if (this.enableZoom === !1) return;
310
308
  this._handleMouseDownDolly(i), this.state = l.DOLLY;
311
309
  break;
312
- case C.ROTATE:
310
+ case x.ROTATE:
313
311
  if (i.ctrlKey || i.metaKey || i.shiftKey) {
314
312
  if (this.enablePan === !1) return;
315
313
  this._handleMouseDownPan(i), this.state = l.PAN;
@@ -318,7 +316,7 @@ function xt(i) {
318
316
  this._handleMouseDownRotate(i), this.state = l.ROTATE;
319
317
  }
320
318
  break;
321
- case C.PAN:
319
+ case x.PAN:
322
320
  if (i.ctrlKey || i.metaKey || i.shiftKey) {
323
321
  if (this.enableRotate === !1) return;
324
322
  this._handleMouseDownRotate(i), this.state = l.ROTATE;
@@ -332,7 +330,7 @@ function xt(i) {
332
330
  }
333
331
  this.state !== l.NONE && this.dispatchEvent(F);
334
332
  }
335
- function Ct(i) {
333
+ function Nt(i) {
336
334
  switch (this.state) {
337
335
  case l.ROTATE:
338
336
  if (this.enableRotate === !1) return;
@@ -348,21 +346,21 @@ function Ct(i) {
348
346
  break;
349
347
  }
350
348
  }
351
- function Lt(i) {
352
- this.enabled === !1 || this.enableZoom === !1 || this.state !== l.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ot));
349
+ function It(i) {
350
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== l.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(lt));
353
351
  }
354
- function At(i) {
352
+ function Ut(i) {
355
353
  this.enabled !== !1 && this._handleKeyDown(i);
356
354
  }
357
- function kt(i) {
355
+ function Yt(i) {
358
356
  switch (this._trackPointer(i), this._pointers.length) {
359
357
  case 1:
360
358
  switch (this.touches.ONE) {
361
- case x.ROTATE:
359
+ case O.ROTATE:
362
360
  if (this.enableRotate === !1) return;
363
361
  this._handleTouchStartRotate(i), this.state = l.TOUCH_ROTATE;
364
362
  break;
365
- case x.PAN:
363
+ case O.PAN:
366
364
  if (this.enablePan === !1) return;
367
365
  this._handleTouchStartPan(i), this.state = l.TOUCH_PAN;
368
366
  break;
@@ -372,11 +370,11 @@ function kt(i) {
372
370
  break;
373
371
  case 2:
374
372
  switch (this.touches.TWO) {
375
- case x.DOLLY_PAN:
373
+ case O.DOLLY_PAN:
376
374
  if (this.enableZoom === !1 && this.enablePan === !1) return;
377
375
  this._handleTouchStartDollyPan(i), this.state = l.TOUCH_DOLLY_PAN;
378
376
  break;
379
- case x.DOLLY_ROTATE:
377
+ case O.DOLLY_ROTATE:
380
378
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
381
379
  this._handleTouchStartDollyRotate(i), this.state = l.TOUCH_DOLLY_ROTATE;
382
380
  break;
@@ -389,7 +387,7 @@ function kt(i) {
389
387
  }
390
388
  this.state !== l.NONE && this.dispatchEvent(F);
391
389
  }
392
- function jt(i) {
390
+ function Zt(i) {
393
391
  switch (this._trackPointer(i), this.state) {
394
392
  case l.TOUCH_ROTATE:
395
393
  if (this.enableRotate === !1) return;
@@ -411,93 +409,93 @@ function jt(i) {
411
409
  this.state = l.NONE;
412
410
  }
413
411
  }
414
- function zt(i) {
412
+ function Kt(i) {
415
413
  this.enabled !== !1 && i.preventDefault();
416
414
  }
417
- function Nt(i) {
415
+ function Ft(i) {
418
416
  i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
419
417
  }
420
- function It(i) {
418
+ function Ht(i) {
421
419
  i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
422
420
  }
423
- const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { class: "controls" }, Kt = { class: "material-icons" }, Ht = { class: "material-icons" }, Ft = {
421
+ const Vt = { class: "present3d-container" }, Wt = { class: "header" }, Xt = { class: "controls" }, Gt = { class: "material-icons" }, qt = { class: "material-icons" }, Bt = {
424
422
  key: 0,
425
423
  class: "error"
426
- }, Wt = { class: "script-source" }, Vt = ["disabled"], Xt = /* @__PURE__ */ tt({
424
+ }, Qt = { class: "script-source" }, $t = ["disabled"], Jt = /* @__PURE__ */ at({
427
425
  __name: "View",
428
426
  props: {
429
427
  selectedResult: {}
430
428
  },
431
429
  emits: ["updateResult"],
432
430
  setup(i, { emit: t }) {
433
- var G;
434
- const e = i, s = t, o = R(((G = e.selectedResult.data) == null ? void 0 : G.script) ?? ""), n = R(null), c = R(null), p = R(!1), u = R(!0), v = et(() => {
431
+ var X;
432
+ const e = i, s = t, o = M(((X = e.selectedResult.data) == null ? void 0 : X.script) ?? ""), n = M(null), c = M(null), p = M(!1), u = M(!0), T = nt(() => {
435
433
  var a;
436
434
  return o.value !== ((a = e.selectedResult.data) == null ? void 0 : a.script);
437
435
  });
438
- let y, m, w, r, b, S, L = [], D = null, M = null;
439
- it(() => {
440
- nt(), U(), W(), q(() => {
436
+ let g, m, y, r, b, E, C = [], S = null, v = null;
437
+ rt(() => {
438
+ pt(), I(), H(), B(() => {
441
439
  V();
442
440
  });
443
- }), st(() => {
444
- dt();
445
- }), O(
441
+ }), ht(() => {
442
+ bt();
443
+ }), R(
446
444
  () => {
447
445
  var a;
448
446
  return (a = e.selectedResult.data) == null ? void 0 : a.script;
449
447
  },
450
448
  () => {
451
- U();
449
+ I();
452
450
  }
453
- ), O(p, () => {
454
- U();
455
- }), O(u, (a) => {
456
- S && (S.visible = a);
451
+ ), R(p, () => {
452
+ I();
453
+ }), R(u, (a) => {
454
+ E && (E.visible = a);
457
455
  });
458
- function nt() {
456
+ function pt() {
459
457
  if (!n.value) return;
460
- y = new g.Scene(), y.background = new g.Color(1710618);
458
+ g = new J(), g.background = new tt(1710618);
461
459
  const a = n.value.clientWidth, h = n.value.clientHeight;
462
- m = new g.PerspectiveCamera(50, a / h, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), w = new g.WebGLRenderer({ antialias: !0 }), w.setSize(a, h), w.setPixelRatio(window.devicePixelRatio), n.value.appendChild(w.domElement), r = new vt(m, w.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", X);
463
- const T = new g.AmbientLight(16777215, 0.6);
464
- y.add(T);
465
- const A = new g.DirectionalLight(16777215, 0.8);
466
- A.position.set(10, 10, 10), y.add(A), S = new g.GridHelper(20, 20, 4473924, 2236962), S.visible = u.value, y.add(S), window.addEventListener("resize", I), M = new ResizeObserver(() => {
467
- I();
468
- }), M.observe(n.value);
460
+ m = new et(50, a / h, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), y = new it({ antialias: !0 }), y.setSize(a, h), y.setPixelRatio(window.devicePixelRatio), n.value.appendChild(y.domElement), r = new Lt(m, y.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", W);
461
+ const D = new st(16777215, 0.6);
462
+ g.add(D);
463
+ const L = new ot(16777215, 0.8);
464
+ L.position.set(10, 10, 10), g.add(L), E = new Tt(20, 20, 4473924, 2236962), E.visible = u.value, g.add(E), window.addEventListener("resize", N), v = new ResizeObserver(() => {
465
+ N();
466
+ }), v.observe(n.value);
469
467
  }
470
- function I() {
468
+ function N() {
471
469
  if (!n.value) return;
472
470
  const a = n.value.clientWidth, h = n.value.clientHeight;
473
- m.aspect = a / h, m.updateProjectionMatrix(), w.setSize(a, h);
471
+ m.aspect = a / h, m.updateProjectionMatrix(), y.setSize(a, h);
474
472
  }
475
- function U() {
473
+ function I() {
476
474
  var a;
477
475
  try {
478
- L.forEach((_t) => y.remove(_t)), L = [];
476
+ C.forEach((wt) => g.remove(wt)), C = [];
479
477
  const h = (a = e.selectedResult.data) == null ? void 0 : a.script;
480
478
  if (!h) return;
481
- const T = N(h), A = Z(T, { wireframe: p.value });
482
- y.add(A), L.push(A), c.value = null;
479
+ const D = z(h), L = Y(D, { wireframe: p.value });
480
+ g.add(L), C.push(L), c.value = null;
483
481
  } catch (h) {
484
482
  c.value = h instanceof Error ? h.message : "Unknown error", console.error("ShapeScript parse error:", h);
485
483
  }
486
484
  }
487
- function W() {
488
- b = requestAnimationFrame(W), r.update(), w.render(y, m);
485
+ function H() {
486
+ b = requestAnimationFrame(H), r.update(), y.render(g, m);
489
487
  }
490
- function rt() {
488
+ function dt() {
491
489
  m.position.set(5, 5, 10), m.lookAt(0, 0, 0), r.reset();
492
490
  }
493
491
  function V() {
494
- var h, T;
495
- if (!m || !r || !((T = (h = e.selectedResult) == null ? void 0 : h.viewState) != null && T.cameraState))
492
+ var h, D;
493
+ if (!m || !r || !((D = (h = e.selectedResult) == null ? void 0 : h.viewState) != null && D.cameraState))
496
494
  return;
497
495
  const a = e.selectedResult.viewState.cameraState;
498
496
  a.position && m.position.set(a.position.x, a.position.y, a.position.z), a.target && r.target.set(a.target.x, a.target.y, a.target.z), m.updateProjectionMatrix(), r.update();
499
497
  }
500
- function ht() {
498
+ function ut() {
501
499
  return {
502
500
  position: {
503
501
  x: m.position.x,
@@ -511,34 +509,34 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
511
509
  }
512
510
  };
513
511
  }
514
- function X() {
515
- D !== null && clearTimeout(D), D = window.setTimeout(() => {
516
- lt();
512
+ function W() {
513
+ S !== null && clearTimeout(S), S = window.setTimeout(() => {
514
+ mt();
517
515
  }, 500);
518
516
  }
519
- function lt() {
517
+ function mt() {
520
518
  const a = {
521
519
  ...e.selectedResult,
522
520
  viewState: {
523
- cameraState: ht()
521
+ cameraState: ut()
524
522
  }
525
523
  };
526
524
  s("updateResult", a);
527
525
  }
528
- function ct() {
526
+ function _t() {
529
527
  p.value = !p.value;
530
528
  }
531
- function pt() {
529
+ function ft() {
532
530
  u.value = !u.value;
533
531
  }
534
- function dt() {
535
- D !== null && clearTimeout(D), b && cancelAnimationFrame(b), w && w.dispose(), r && (r.removeEventListener("change", X), r.dispose()), M && M.disconnect(), window.removeEventListener("resize", I);
532
+ function bt() {
533
+ S !== null && clearTimeout(S), b && cancelAnimationFrame(b), y && y.dispose(), r && (r.removeEventListener("change", W), r.dispose()), v && v.disconnect(), window.removeEventListener("resize", N);
536
534
  }
537
- function ut() {
535
+ function gt() {
538
536
  }
539
- function mt() {
537
+ function yt() {
540
538
  try {
541
- N(o.value);
539
+ z(o.value);
542
540
  const a = {
543
541
  ...e.selectedResult,
544
542
  data: {
@@ -550,7 +548,7 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
550
548
  c.value = a instanceof Error ? a.message : "Invalid ShapeScript", console.error("Script validation failed:", a);
551
549
  }
552
550
  }
553
- return O(
551
+ return R(
554
552
  () => {
555
553
  var a;
556
554
  return (a = e.selectedResult.data) == null ? void 0 : a.script;
@@ -558,85 +556,85 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
558
556
  (a) => {
559
557
  a && (o.value = a);
560
558
  }
561
- ), O(
559
+ ), R(
562
560
  () => e.selectedResult,
563
561
  () => {
564
- q(() => {
562
+ B(() => {
565
563
  V();
566
564
  });
567
565
  }
568
- ), (a, h) => (H(), K("div", Ut, [
569
- _("div", Yt, [
570
- _("h1", null, k(i.selectedResult.title || "3D Visualization"), 1),
571
- _("div", Zt, [
566
+ ), (a, h) => (K(), Z("div", Vt, [
567
+ _("div", Wt, [
568
+ _("h1", null, A(i.selectedResult.title || "3D Visualization"), 1),
569
+ _("div", Xt, [
572
570
  _("button", {
573
- onClick: rt,
571
+ onClick: dt,
574
572
  class: "control-btn"
575
573
  }, [...h[1] || (h[1] = [
576
574
  _("span", { class: "material-icons" }, "refresh", -1),
577
- j(" Reset Camera ", -1)
575
+ k(" Reset Camera ", -1)
578
576
  ])]),
579
577
  _("button", {
580
- onClick: ct,
578
+ onClick: _t,
581
579
  class: "control-btn"
582
580
  }, [
583
- _("span", Kt, k(p.value ? "grid_off" : "grid_on"), 1),
584
- h[2] || (h[2] = j(" Wireframe ", -1))
581
+ _("span", Gt, A(p.value ? "grid_off" : "grid_on"), 1),
582
+ h[2] || (h[2] = k(" Wireframe ", -1))
585
583
  ]),
586
584
  _("button", {
587
- onClick: pt,
585
+ onClick: ft,
588
586
  class: "control-btn"
589
587
  }, [
590
- _("span", Ht, k(u.value ? "visibility_off" : "visibility"), 1),
591
- h[3] || (h[3] = j(" Grid ", -1))
588
+ _("span", qt, A(u.value ? "visibility_off" : "visibility"), 1),
589
+ h[3] || (h[3] = k(" Grid ", -1))
592
590
  ])
593
591
  ])
594
592
  ]),
595
- c.value ? (H(), K("div", Ft, [
593
+ c.value ? (K(), Z("div", Bt, [
596
594
  h[4] || (h[4] = _("strong", null, "Parse Error:", -1)),
597
- j(" " + k(c.value), 1)
598
- ])) : gt("", !0),
595
+ k(" " + A(c.value), 1)
596
+ ])) : Rt("", !0),
599
597
  _("div", {
600
598
  class: "viewport",
601
599
  ref_key: "viewport",
602
600
  ref: n
603
601
  }, null, 512),
604
- _("details", Wt, [
602
+ _("details", Qt, [
605
603
  h[5] || (h[5] = _("summary", null, "Edit ShapeScript Source", -1)),
606
- yt(_("textarea", {
607
- "onUpdate:modelValue": h[0] || (h[0] = (T) => o.value = T),
608
- onInput: ut,
604
+ Ot(_("textarea", {
605
+ "onUpdate:modelValue": h[0] || (h[0] = (D) => o.value = D),
606
+ onInput: gt,
609
607
  class: "script-editor",
610
608
  spellcheck: "false"
611
609
  }, null, 544), [
612
- [wt, o.value]
610
+ [xt, o.value]
613
611
  ]),
614
612
  _("button", {
615
- onClick: mt,
613
+ onClick: yt,
616
614
  class: "apply-btn",
617
- disabled: !v.value
618
- }, " Apply Changes ", 8, Vt)
615
+ disabled: !T.value
616
+ }, " Apply Changes ", 8, $t)
619
617
  ])
620
618
  ]));
621
619
  }
622
- }), at = (i, t) => {
620
+ }), ct = (i, t) => {
623
621
  const e = i.__vccOpts || i;
624
622
  for (const [s, o] of t)
625
623
  e[s] = o;
626
624
  return e;
627
- }, Gt = /* @__PURE__ */ at(Xt, [["__scopeId", "data-v-daa337a0"]]), qt = { class: "preview-container" }, Bt = { class: "preview-title" }, Qt = /* @__PURE__ */ tt({
625
+ }, te = /* @__PURE__ */ ct(Jt, [["__scopeId", "data-v-daa337a0"]]), ee = { class: "preview-container" }, ie = { class: "preview-title" }, se = /* @__PURE__ */ at({
628
626
  __name: "Preview",
629
627
  props: {
630
628
  result: {}
631
629
  },
632
630
  setup(i) {
633
- const t = i, e = et(() => t.result.title || "3D Visualization"), s = R(null);
631
+ const t = i, e = nt(() => t.result.title || "3D Visualization"), s = M(null);
634
632
  let o, n, c, p, u = null;
635
- it(() => {
636
- v();
637
- }), st(() => {
638
- w();
639
- }), O(
633
+ rt(() => {
634
+ T();
635
+ }), ht(() => {
636
+ y();
637
+ }), R(
640
638
  () => {
641
639
  var r;
642
640
  return (r = t.result.data) == null ? void 0 : r.script;
@@ -645,25 +643,25 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
645
643
  m();
646
644
  }
647
645
  );
648
- function v() {
646
+ function T() {
649
647
  var r;
650
648
  if (s.value)
651
649
  try {
652
- o = new g.Scene(), o.background = new g.Color(2763322);
653
- const b = s.value.clientWidth || 200, S = s.value.clientHeight || 150;
654
- n = new g.PerspectiveCamera(50, b / S, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), c = new g.WebGLRenderer({ antialias: !0, alpha: !1 }), c.setSize(b, S), c.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(c.domElement);
655
- const L = new g.AmbientLight(16777215, 0.6);
656
- o.add(L);
657
- const D = new g.DirectionalLight(16777215, 0.8);
658
- if (D.position.set(5, 5, 5), o.add(D), !((r = t.result.data) != null && r.script)) return;
659
- const M = N(t.result.data.script);
660
- u = Z(M, { wireframe: !1 }), o.add(u), y();
650
+ o = new J(), o.background = new tt(2763322);
651
+ const b = s.value.clientWidth || 200, E = s.value.clientHeight || 150;
652
+ n = new et(50, b / E, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), c = new it({ antialias: !0, alpha: !1 }), c.setSize(b, E), c.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(c.domElement);
653
+ const C = new st(16777215, 0.6);
654
+ o.add(C);
655
+ const S = new ot(16777215, 0.8);
656
+ if (S.position.set(5, 5, 5), o.add(S), !((r = t.result.data) != null && r.script)) return;
657
+ const v = z(t.result.data.script);
658
+ u = Y(v, { wireframe: !1 }), o.add(u), g();
661
659
  } catch (b) {
662
660
  console.error("Preview render error:", b);
663
661
  }
664
662
  }
665
- function y() {
666
- p = requestAnimationFrame(y);
663
+ function g() {
664
+ p = requestAnimationFrame(g);
667
665
  const r = Date.now() * 5e-4;
668
666
  n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0), c.render(o, n);
669
667
  }
@@ -672,25 +670,25 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
672
670
  if (!(!o || !((r = t.result.data) != null && r.script)))
673
671
  try {
674
672
  u && o.remove(u);
675
- const b = N(t.result.data.script);
676
- u = Z(b, { wireframe: !1 }), o.add(u);
673
+ const b = z(t.result.data.script);
674
+ u = Y(b, { wireframe: !1 }), o.add(u);
677
675
  } catch (b) {
678
676
  console.error("Preview reload error:", b);
679
677
  }
680
678
  }
681
- function w() {
679
+ function y() {
682
680
  p && cancelAnimationFrame(p), c && c.dispose();
683
681
  }
684
- return (r, b) => (H(), K("div", qt, [
682
+ return (r, b) => (K(), Z("div", ee, [
685
683
  _("div", {
686
684
  ref_key: "previewViewport",
687
685
  ref: s,
688
686
  class: "preview-viewport"
689
687
  }, null, 512),
690
- _("div", Bt, k(e.value), 1)
688
+ _("div", ie, A(e.value), 1)
691
689
  ]));
692
690
  }
693
- }), $t = /* @__PURE__ */ at(Qt, [["__scopeId", "data-v-75941188"]]), Jt = "present3D", te = `Use the ${Jt} tool to create interactive 3D visualizations when the user requests:
691
+ }), oe = /* @__PURE__ */ ct(se, [["__scopeId", "data-v-75941188"]]), ae = "present3D", ne = `Use the ${ae} tool to create interactive 3D visualizations when the user requests:
694
692
  - 3D models or shapes
695
693
  - Mathematical visualizations (surfaces, functions, geometric patterns)
696
694
  - Molecular or atomic structures
@@ -771,24 +769,24 @@ Shapes: cube, sphere, cylinder, cone, torus
771
769
  CSG: union, difference, intersection, xor, stencil
772
770
  Properties: position, rotation, size, color, opacity
773
771
 
774
- Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, ee = {
775
- ...bt,
776
- viewComponent: Gt,
777
- previewComponent: $t,
778
- samples: ft,
779
- systemPrompt: te
780
- }, ae = { plugin: ee };
772
+ Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, re = {
773
+ ...Mt,
774
+ viewComponent: te,
775
+ previewComponent: oe,
776
+ samples: vt,
777
+ systemPrompt: ne
778
+ }, ce = { plugin: re };
781
779
  export {
782
- $t as Preview,
783
- te as SYSTEM_PROMPT,
784
- he as TOOL_DEFINITION,
785
- Jt as TOOL_NAME,
786
- Gt as View,
787
- Z as astToThreeJS,
788
- ae as default,
789
- le as executePresent3D,
790
- N as parseShapeScript,
791
- ee as plugin,
792
- bt as pluginCore,
793
- ft as samples
780
+ oe as Preview,
781
+ ne as SYSTEM_PROMPT,
782
+ ue as TOOL_DEFINITION,
783
+ ae as TOOL_NAME,
784
+ te as View,
785
+ Y as astToThreeJS,
786
+ ce as default,
787
+ me as executePresent3D,
788
+ z as parseShapeScript,
789
+ re as plugin,
790
+ Mt as pluginCore,
791
+ vt as samples
794
792
  };