@animaapp/anima-sdk 0.6.11 → 0.6.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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var xr = Object.defineProperty, kr = Object.defineProperties;
2
2
  var Tr = Object.getOwnPropertyDescriptors;
3
3
  var Ft = Object.getOwnPropertySymbols;
4
- var Sr = Object.prototype.hasOwnProperty, Er = Object.prototype.propertyIsEnumerable;
4
+ var Sr = Object.prototype.hasOwnProperty, Ar = Object.prototype.propertyIsEnumerable;
5
5
  var Vt = (r) => {
6
6
  throw TypeError(r);
7
7
  };
@@ -10,7 +10,7 @@ var Lt = (r, e, t) => e in r ? xr(r, e, { enumerable: !0, configurable: !0, writ
10
10
  Sr.call(e, t) && Lt(r, t, e[t]);
11
11
  if (Ft)
12
12
  for (var t of Ft(e))
13
- Er.call(e, t) && Lt(r, t, e[t]);
13
+ Ar.call(e, t) && Lt(r, t, e[t]);
14
14
  return r;
15
15
  }, g = (r, e) => kr(r, Tr(e));
16
16
  var ht = (r, e, t) => e.has(r) || Vt("Cannot " + t);
@@ -42,7 +42,7 @@ class de extends Error {
42
42
  }
43
43
  }
44
44
  const Qt = "Figma Token Issue";
45
- class Ar extends Error {
45
+ class Er extends Error {
46
46
  constructor({
47
47
  fileKey: e,
48
48
  reason: t,
@@ -85,7 +85,7 @@ const Kn = (r) => r.message === sr, Rr = (r) => r.message === er, Zr = (r) => [Q
85
85
  if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
86
86
  const { err: n, status: a } = r.cause.body;
87
87
  if (a === 403)
88
- return new Ar({
88
+ return new Er({
89
89
  fileKey: e,
90
90
  reason: n,
91
91
  cause: r
@@ -108,7 +108,7 @@ var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwn
108
108
  for (var t of Dt(e))
109
109
  Vr.call(e, t) && Wt(r, t, e[t]);
110
110
  return r;
111
- }, jt = (r, e) => $r(r, Fr(e)), Rt = (r, e, t) => e.has(r) || ar("Cannot " + t), T = (r, e, t) => (Rt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), B = (r, e, t) => e.has(r) ? ar("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), R = (r, e, t, s) => (Rt(r, e, "write to private field"), e.set(r, t), t), Q = (r, e, t) => (Rt(r, e, "access private method"), t), I = (r, e, t) => new Promise((s, n) => {
111
+ }, jt = (r, e) => $r(r, Fr(e)), Rt = (r, e, t) => e.has(r) || ar("Cannot " + t), S = (r, e, t) => (Rt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), B = (r, e, t) => e.has(r) ? ar("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), R = (r, e, t, s) => (Rt(r, e, "write to private field"), e.set(r, t), t), Q = (r, e, t) => (Rt(r, e, "access private method"), t), I = (r, e, t) => new Promise((s, n) => {
112
112
  var a = (c) => {
113
113
  try {
114
114
  o(t.next(c));
@@ -134,41 +134,41 @@ function Br() {
134
134
  r.exports = s();
135
135
  })(zr, function() {
136
136
  var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", d = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", j = i && typeof Set.prototype.entries == "function", M = a && typeof Map.prototype.entries == "function", F = j && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), z = M && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), se = f && typeof Array.prototype[Symbol.iterator] == "function", ge = se && Object.getPrototypeOf([][Symbol.iterator]()), ce = f && typeof String.prototype[Symbol.iterator] == "function", V = ce && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, q = -1;
137
- function Ie(A) {
138
- var k = typeof A;
137
+ function Ie(E) {
138
+ var k = typeof E;
139
139
  if (k !== "object")
140
140
  return k;
141
- if (A === null)
141
+ if (E === null)
142
142
  return "null";
143
- if (A === s)
143
+ if (E === s)
144
144
  return "global";
145
- if (Array.isArray(A) && (v === !1 || !(Symbol.toStringTag in A)))
145
+ if (Array.isArray(E) && (v === !1 || !(Symbol.toStringTag in E)))
146
146
  return "Array";
147
147
  if (typeof window == "object" && window !== null) {
148
- if (typeof window.location == "object" && A === window.location)
148
+ if (typeof window.location == "object" && E === window.location)
149
149
  return "Location";
150
- if (typeof window.document == "object" && A === window.document)
150
+ if (typeof window.document == "object" && E === window.document)
151
151
  return "Document";
152
152
  if (typeof window.navigator == "object") {
153
- if (typeof window.navigator.mimeTypes == "object" && A === window.navigator.mimeTypes)
153
+ if (typeof window.navigator.mimeTypes == "object" && E === window.navigator.mimeTypes)
154
154
  return "MimeTypeArray";
155
- if (typeof window.navigator.plugins == "object" && A === window.navigator.plugins)
155
+ if (typeof window.navigator.plugins == "object" && E === window.navigator.plugins)
156
156
  return "PluginArray";
157
157
  }
158
- if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && A instanceof window.HTMLElement) {
159
- if (A.tagName === "BLOCKQUOTE")
158
+ if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && E instanceof window.HTMLElement) {
159
+ if (E.tagName === "BLOCKQUOTE")
160
160
  return "HTMLQuoteElement";
161
- if (A.tagName === "TD")
161
+ if (E.tagName === "TD")
162
162
  return "HTMLTableDataCellElement";
163
- if (A.tagName === "TH")
163
+ if (E.tagName === "TH")
164
164
  return "HTMLTableHeaderCellElement";
165
165
  }
166
166
  }
167
- var ft = v && A[Symbol.toStringTag];
167
+ var ft = v && E[Symbol.toStringTag];
168
168
  if (typeof ft == "string")
169
169
  return ft;
170
- var D = Object.getPrototypeOf(A);
171
- return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : d && D === DataView.prototype ? "DataView" : a && D === z ? "Map Iterator" : i && D === F ? "Set Iterator" : se && D === ge ? "Array Iterator" : ce && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(A).slice(K, q);
170
+ var D = Object.getPrototypeOf(E);
171
+ return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : d && D === DataView.prototype ? "DataView" : a && D === z ? "Map Iterator" : i && D === F ? "Set Iterator" : se && D === ge ? "Array Iterator" : ce && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(E).slice(K, q);
172
172
  }
173
173
  return Ie;
174
174
  });
@@ -231,7 +231,7 @@ const Hr = /* @__PURE__ */ Wr(qr), Zt = typeof Buffer != "undefined", Jr = Zt &&
231
231
  return r;
232
232
  }
233
233
  );
234
- function Ee(r) {
234
+ function Ae(r) {
235
235
  return Gr(r) ? "Buffer" : Hr(r);
236
236
  }
237
237
  const Xr = /* @__PURE__ */ new Set([
@@ -242,7 +242,7 @@ const Xr = /* @__PURE__ */ new Set([
242
242
  "Set"
243
243
  ]);
244
244
  function Yr(r, e, t = null) {
245
- switch (t || Ee(r)) {
245
+ switch (t || Ae(r)) {
246
246
  case "Arguments":
247
247
  case "Array":
248
248
  case "Object":
@@ -257,7 +257,7 @@ function bt(r) {
257
257
  return Xr.has(r);
258
258
  }
259
259
  function Bt(r, e, t, s = null) {
260
- switch (s || Ee(r)) {
260
+ switch (s || Ae(r)) {
261
261
  case "Arguments":
262
262
  case "Array":
263
263
  case "Object":
@@ -376,7 +376,7 @@ function ps() {
376
376
  }
377
377
  function wt(r, e = null, t = ps) {
378
378
  arguments.length === 2 && typeof e == "function" && (t = e, e = null);
379
- const s = e || Ee(r), n = hs.get(s);
379
+ const s = e || Ae(r), n = hs.get(s);
380
380
  if (s === "Object") {
381
381
  const a = t(r, s);
382
382
  if (a !== void 0)
@@ -393,14 +393,14 @@ function je(r, e = {}) {
393
393
  customizer: t
394
394
  // TODO: max depth
395
395
  // depth = Infinity,
396
- } = e, s = Ee(r);
396
+ } = e, s = Ae(r);
397
397
  if (!bt(s))
398
398
  return xt(r, null, null, null);
399
399
  const n = wt(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
400
400
  return xt(r, n, a, i);
401
401
  }
402
402
  function xt(r, e, t, s, n) {
403
- const a = Ee(r), i = wt(r, a);
403
+ const a = Ae(r), i = wt(r, a);
404
404
  if (!bt(a))
405
405
  return i;
406
406
  let o;
@@ -422,7 +422,7 @@ function xt(r, e, t, s, n) {
422
422
  if (s.has(d))
423
423
  Bt(e, c, t.get(d), a);
424
424
  else {
425
- const f = Ee(d), v = wt(d, f);
425
+ const f = Ae(d), v = wt(d, f);
426
426
  bt(f) && (t.set(d, v), s.add(d)), Bt(
427
427
  e,
428
428
  c,
@@ -447,9 +447,9 @@ class gs {
447
447
  run() {
448
448
  return I(this, null, function* () {
449
449
  try {
450
- return yield T(this, tt).call(this);
450
+ return yield S(this, tt).call(this);
451
451
  } catch (e) {
452
- if (R(this, ye, T(this, ye) + 1), T(this, ye) > T(this, et))
452
+ if (R(this, ye, S(this, ye) + 1), S(this, ye) > S(this, et))
453
453
  throw console.error("Max attempts reached"), e;
454
454
  const t = Q(this, kt, ir).call(this);
455
455
  return yield ms(t), yield this.run();
@@ -458,7 +458,7 @@ class gs {
458
458
  }
459
459
  }
460
460
  et = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakSet(), ir = function() {
461
- return T(this, ye) * 1e3 * 1.5;
461
+ return S(this, ye) * 1e3 * 1.5;
462
462
  };
463
463
  function ys() {
464
464
  return typeof CompressionStream != "undefined";
@@ -549,7 +549,7 @@ function Tt() {
549
549
  return Math.floor(Date.now() / 1e3).toString();
550
550
  }
551
551
  const xs = 5 * 60 * 1e3, ks = 1 * 1e3;
552
- var ve, L, X, St, Et, Ze;
552
+ var ve, L, X, St, At, Ze;
553
553
  class Ts {
554
554
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: t }) {
555
555
  B(this, X), B(this, ve), B(this, L), this.baseAddress = t, R(this, ve, e), R(this, L, {}), this.plugins = [];
@@ -570,31 +570,31 @@ class Ts {
570
570
  return I(this, arguments, function* (t, s = {}) {
571
571
  const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
572
572
  let o = a != null ? a : this.headers;
573
- const c = je(T(this, L));
574
- return R(this, L, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = jt(U({}, o), { "X-Request-Nonce": or(), "X-Request-Timestamp": Tt() })), c.async ? yield Q(this, X, Et).call(this, `${i}${t}`, c.async, { headers: o }) : yield Q(this, X, St).call(this, `${i}${t}`, c, { headers: o });
573
+ const c = je(S(this, L));
574
+ return R(this, L, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = jt(U({}, o), { "X-Request-Nonce": or(), "X-Request-Timestamp": Tt() })), c.async ? yield Q(this, X, At).call(this, `${i}${t}`, c.async, { headers: o }) : yield Q(this, X, St).call(this, `${i}${t}`, c, { headers: o });
575
575
  });
576
576
  }
577
577
  post(e, t) {
578
578
  return I(this, arguments, function* (s, n, a = {}) {
579
- const i = je(T(this, L));
579
+ const i = je(S(this, L));
580
580
  return R(this, L, {}), Q(this, X, Ze).call(this, s, "POST", n, a, i);
581
581
  });
582
582
  }
583
583
  put(e, t) {
584
584
  return I(this, arguments, function* (s, n, a = {}) {
585
- const i = je(T(this, L));
585
+ const i = je(S(this, L));
586
586
  return R(this, L, {}), Q(this, X, Ze).call(this, s, "PUT", n, a, i);
587
587
  });
588
588
  }
589
589
  delete(e, t) {
590
590
  return I(this, arguments, function* (s, n, a = {}) {
591
- const i = je(T(this, L));
591
+ const i = je(S(this, L));
592
592
  return R(this, L, {}), Q(this, X, Ze).call(this, s, "DELETE", n, a, i);
593
593
  });
594
594
  }
595
595
  patch(e, t) {
596
596
  return I(this, arguments, function* (s, n, a = {}) {
597
- const i = je(T(this, L));
597
+ const i = je(S(this, L));
598
598
  return R(this, L, {}), Q(this, X, Ze).call(this, s, "PATCH", n, a, i);
599
599
  });
600
600
  }
@@ -604,7 +604,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
604
604
  const s = () => I(this, null, function* () {
605
605
  var c, d;
606
606
  try {
607
- return yield T(this, ve).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
607
+ return yield S(this, ve).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
608
608
  } catch (f) {
609
609
  throw f instanceof Error && f.name === "AbortError" ? new Re({ canceled: (d = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? d : !1 }) : f;
610
610
  }
@@ -653,7 +653,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
653
653
  const o = yield s();
654
654
  return yield i(o);
655
655
  });
656
- }, Et = function(r, e, t) {
656
+ }, At = function(r, e, t) {
657
657
  return I(this, null, function* () {
658
658
  var s, n;
659
659
  const {
@@ -664,7 +664,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
664
664
  } = e, d = `${r}/async`, f = `${r}/async/job`;
665
665
  let v;
666
666
  try {
667
- v = yield T(this, ve).call(this, d, U(U({}, t), i && { signal: i }));
667
+ v = yield S(this, ve).call(this, d, U(U({}, t), i && { signal: i }));
668
668
  } catch (F) {
669
669
  throw F instanceof Error && F.name === "AbortError" ? new Re({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : F;
670
670
  }
@@ -687,7 +687,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
687
687
  z(new Error("Job timed out"));
688
688
  }, c), ge = (ce = 0) => I(this, null, function* () {
689
689
  if (i != null && i.aborted) {
690
- clearTimeout(se), T(this, ve).call(this, `${f}/${M}/cancel`, { method: "POST", headers: this.headers }).then(() => {
690
+ clearTimeout(se), S(this, ve).call(this, `${f}/${M}/cancel`, { method: "POST", headers: this.headers }).then(() => {
691
691
  z(new Re({ canceled: !0 }));
692
692
  }).catch((V) => {
693
693
  z(new Re({ canceled: !1 }));
@@ -695,7 +695,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
695
695
  return;
696
696
  }
697
697
  try {
698
- const V = yield (yield T(this, ve).call(this, `${f}/${M}`, { headers: this.headers })).json();
698
+ const V = yield (yield S(this, ve).call(this, `${f}/${M}`, { headers: this.headers })).json();
699
699
  if (V.status === "success") {
700
700
  clearTimeout(se);
701
701
  const K = V.response_json;
@@ -720,7 +720,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
720
720
  let c = i != null ? i : this.headers;
721
721
  n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = jt(U({}, c), { "X-Request-Nonce": or(), "X-Request-Timestamp": Tt() }));
722
722
  let d = t;
723
- return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Q(this, X, Et).call(this, `${o}${r}`, n.async, {
723
+ return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Q(this, X, At).call(this, `${o}${r}`, n.async, {
724
724
  method: e,
725
725
  headers: c,
726
726
  body: d
@@ -758,26 +758,26 @@ class Ss {
758
758
  const n = new URLSearchParams(U({
759
759
  plugin_data: "857346721138427857"
760
760
  }, s)).toString(), a = `v1/files/${t}?${n}`;
761
- return yield T(this, Me).get(a);
761
+ return yield S(this, Me).get(a);
762
762
  });
763
763
  }
764
764
  getImageFills(e) {
765
765
  return I(this, arguments, function* ({ fileKey: t }) {
766
766
  var s, n;
767
767
  const a = `v1/files/${t}/images`;
768
- return (n = (s = (yield T(this, Me).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
768
+ return (n = (s = (yield S(this, Me).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
769
769
  });
770
770
  }
771
771
  }
772
772
  Me = /* @__PURE__ */ new WeakMap();
773
- const Es = (r, e, t) => {
773
+ const As = (r, e, t) => {
774
774
  const s = e.sort();
775
775
  return `${r}-${s.join("-")}-${t}`;
776
- }, As = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
777
- var Y, At, cr;
776
+ }, Es = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
777
+ var Y, Et, cr;
778
778
  class Cs {
779
779
  constructor(e) {
780
- B(this, At), B(this, Y), this.resourceName = "Images", R(this, Y, e);
780
+ B(this, Et), B(this, Y), this.resourceName = "Images", R(this, Y, e);
781
781
  }
782
782
  /**
783
783
  * Return the URL for the _layer_ images for the given nodes.
@@ -785,29 +785,29 @@ class Cs {
785
785
  */
786
786
  get(e) {
787
787
  return I(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
788
- const i = Es(t, s, n), o = T(this, Y).cache.images.entries.get(i);
789
- if (As(o))
788
+ const i = As(t, s, n), o = S(this, Y).cache.images.entries.get(i);
789
+ if (Es(o))
790
790
  return o.result;
791
- o && T(this, Y).cache.images.entries.delete(i);
792
- const c = T(this, Y).cache.images.pendingRequests.get(i);
791
+ o && S(this, Y).cache.images.entries.delete(i);
792
+ const c = S(this, Y).cache.images.pendingRequests.get(i);
793
793
  if (c)
794
794
  return c;
795
- const d = Q(this, At, cr).call(this, i, t, s, n, a);
796
- T(this, Y).cache.images.pendingRequests.set(i, d);
795
+ const d = Q(this, Et, cr).call(this, i, t, s, n, a);
796
+ S(this, Y).cache.images.pendingRequests.set(i, d);
797
797
  try {
798
798
  return yield d;
799
799
  } finally {
800
- T(this, Y).cache.images.pendingRequests.delete(i);
800
+ S(this, Y).cache.images.pendingRequests.delete(i);
801
801
  }
802
802
  });
803
803
  }
804
804
  }
805
- Y = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakSet(), cr = function(r, e, t, s, n) {
805
+ Y = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), cr = function(r, e, t, s, n) {
806
806
  return I(this, null, function* () {
807
- const a = yield T(this, Y).get(
807
+ const a = yield S(this, Y).get(
808
808
  `v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
809
809
  );
810
- return T(this, Y).cache.images.entries.set(r, {
810
+ return S(this, Y).cache.images.entries.set(r, {
811
811
  result: a,
812
812
  ts: Date.now()
813
813
  }), a;
@@ -825,7 +825,7 @@ class Os {
825
825
  }), i = new URLSearchParams(U({
826
826
  plugin_data: "857346721138427857"
827
827
  }, a)).toString(), o = `v1/files/${t}/nodes?${i}`;
828
- return yield T(this, rt).get(o);
828
+ return yield S(this, rt).get(o);
829
829
  });
830
830
  }
831
831
  }
@@ -849,13 +849,13 @@ class dr extends Ts {
849
849
  R(this, ue, e);
850
850
  }
851
851
  get token() {
852
- return T(this, ue);
852
+ return S(this, ue);
853
853
  }
854
854
  get headers() {
855
855
  const e = {
856
856
  "Content-Type": "application/json"
857
857
  };
858
- return T(this, ue).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = T(this, ue) : T(this, ue).startsWith("figu_") && (e.Authorization = `Bearer ${T(this, ue)}`), e;
858
+ return S(this, ue).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = S(this, ue) : S(this, ue).startsWith("figu_") && (e.Authorization = `Bearer ${S(this, ue)}`), e;
859
859
  }
860
860
  }
861
861
  ue = /* @__PURE__ */ new WeakMap();
@@ -1068,7 +1068,7 @@ class W extends Error {
1068
1068
  }
1069
1069
  }
1070
1070
  W.create = (r) => new W(r);
1071
- const Ae = (r, e) => {
1071
+ const Ee = (r, e) => {
1072
1072
  let t;
1073
1073
  switch (r.code) {
1074
1074
  case l.invalid_type:
@@ -1124,7 +1124,7 @@ const Ae = (r, e) => {
1124
1124
  }
1125
1125
  return { message: t };
1126
1126
  };
1127
- let lr = Ae;
1127
+ let lr = Ee;
1128
1128
  function js(r) {
1129
1129
  lr = r;
1130
1130
  }
@@ -1161,7 +1161,7 @@ function h(r, e) {
1161
1161
  // then schema-bound map if available
1162
1162
  t,
1163
1163
  // then global override map
1164
- t === Ae ? void 0 : Ae
1164
+ t === Ee ? void 0 : Ee
1165
1165
  // then global default map
1166
1166
  ].filter((n) => !!n)
1167
1167
  });
@@ -2449,20 +2449,20 @@ J.create = (r, e) => new J(u({
2449
2449
  typeName: y.ZodArray
2450
2450
  }, b(e)));
2451
2451
  function ke(r) {
2452
- if (r instanceof E) {
2452
+ if (r instanceof A) {
2453
2453
  const e = {};
2454
2454
  for (const t in r.shape) {
2455
2455
  const s = r.shape[t];
2456
2456
  e[t] = ee.create(ke(s));
2457
2457
  }
2458
- return new E(g(u({}, r._def), {
2458
+ return new A(g(u({}, r._def), {
2459
2459
  shape: () => e
2460
2460
  }));
2461
2461
  } else return r instanceof J ? new J(g(u({}, r._def), {
2462
2462
  type: ke(r.element)
2463
2463
  })) : r instanceof ee ? ee.create(ke(r.unwrap())) : r instanceof me ? me.create(ke(r.unwrap())) : r instanceof re ? re.create(r.items.map((e) => ke(e))) : r;
2464
2464
  }
2465
- class E extends w {
2465
+ class A extends w {
2466
2466
  constructor() {
2467
2467
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2468
2468
  }
@@ -2539,7 +2539,7 @@ class E extends w {
2539
2539
  return this._def.shape();
2540
2540
  }
2541
2541
  strict(e) {
2542
- return m.errToObj, new E(u(g(u({}, this._def), {
2542
+ return m.errToObj, new A(u(g(u({}, this._def), {
2543
2543
  unknownKeys: "strict"
2544
2544
  }), e !== void 0 ? {
2545
2545
  errorMap: (t, s) => {
@@ -2554,12 +2554,12 @@ class E extends w {
2554
2554
  } : {}));
2555
2555
  }
2556
2556
  strip() {
2557
- return new E(g(u({}, this._def), {
2557
+ return new A(g(u({}, this._def), {
2558
2558
  unknownKeys: "strip"
2559
2559
  }));
2560
2560
  }
2561
2561
  passthrough() {
2562
- return new E(g(u({}, this._def), {
2562
+ return new A(g(u({}, this._def), {
2563
2563
  unknownKeys: "passthrough"
2564
2564
  }));
2565
2565
  }
@@ -2581,7 +2581,7 @@ class E extends w {
2581
2581
  // }) as any;
2582
2582
  // };
2583
2583
  extend(e) {
2584
- return new E(g(u({}, this._def), {
2584
+ return new A(g(u({}, this._def), {
2585
2585
  shape: () => u(u({}, this._def.shape()), e)
2586
2586
  }));
2587
2587
  }
@@ -2591,7 +2591,7 @@ class E extends w {
2591
2591
  * upgrade if you are experiencing issues.
2592
2592
  */
2593
2593
  merge(e) {
2594
- return new E({
2594
+ return new A({
2595
2595
  unknownKeys: e._def.unknownKeys,
2596
2596
  catchall: e._def.catchall,
2597
2597
  shape: () => u(u({}, this._def.shape()), e._def.shape()),
@@ -2658,7 +2658,7 @@ class E extends w {
2658
2658
  // return merged;
2659
2659
  // }
2660
2660
  catchall(e) {
2661
- return new E(g(u({}, this._def), {
2661
+ return new A(g(u({}, this._def), {
2662
2662
  catchall: e
2663
2663
  }));
2664
2664
  }
@@ -2666,7 +2666,7 @@ class E extends w {
2666
2666
  const t = {};
2667
2667
  return x.objectKeys(e).forEach((s) => {
2668
2668
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
2669
- }), new E(g(u({}, this._def), {
2669
+ }), new A(g(u({}, this._def), {
2670
2670
  shape: () => t
2671
2671
  }));
2672
2672
  }
@@ -2674,7 +2674,7 @@ class E extends w {
2674
2674
  const t = {};
2675
2675
  return x.objectKeys(this.shape).forEach((s) => {
2676
2676
  e[s] || (t[s] = this.shape[s]);
2677
- }), new E(g(u({}, this._def), {
2677
+ }), new A(g(u({}, this._def), {
2678
2678
  shape: () => t
2679
2679
  }));
2680
2680
  }
@@ -2689,7 +2689,7 @@ class E extends w {
2689
2689
  return x.objectKeys(this.shape).forEach((s) => {
2690
2690
  const n = this.shape[s];
2691
2691
  e && !e[s] ? t[s] = n : t[s] = n.optional();
2692
- }), new E(g(u({}, this._def), {
2692
+ }), new A(g(u({}, this._def), {
2693
2693
  shape: () => t
2694
2694
  }));
2695
2695
  }
@@ -2704,7 +2704,7 @@ class E extends w {
2704
2704
  a = a._def.innerType;
2705
2705
  t[s] = a;
2706
2706
  }
2707
- }), new E(g(u({}, this._def), {
2707
+ }), new A(g(u({}, this._def), {
2708
2708
  shape: () => t
2709
2709
  }));
2710
2710
  }
@@ -2712,19 +2712,19 @@ class E extends w {
2712
2712
  return gr(x.objectKeys(this.shape));
2713
2713
  }
2714
2714
  }
2715
- E.create = (r, e) => new E(u({
2715
+ A.create = (r, e) => new A(u({
2716
2716
  shape: () => r,
2717
2717
  unknownKeys: "strip",
2718
2718
  catchall: oe.create(),
2719
2719
  typeName: y.ZodObject
2720
2720
  }, b(e)));
2721
- E.strictCreate = (r, e) => new E(u({
2721
+ A.strictCreate = (r, e) => new A(u({
2722
2722
  shape: () => r,
2723
2723
  unknownKeys: "strict",
2724
2724
  catchall: oe.create(),
2725
2725
  typeName: y.ZodObject
2726
2726
  }, b(e)));
2727
- E.lazycreate = (r, e) => new E(u({
2727
+ A.lazycreate = (r, e) => new A(u({
2728
2728
  shape: r,
2729
2729
  unknownKeys: "strip",
2730
2730
  catchall: oe.create(),
@@ -3138,7 +3138,7 @@ class Se extends w {
3138
3138
  t.common.contextualErrorMap,
3139
3139
  t.schemaErrorMap,
3140
3140
  nt(),
3141
- Ae
3141
+ Ee
3142
3142
  ].filter((d) => !!d),
3143
3143
  issueData: {
3144
3144
  code: l.invalid_arguments,
@@ -3154,7 +3154,7 @@ class Se extends w {
3154
3154
  t.common.contextualErrorMap,
3155
3155
  t.schemaErrorMap,
3156
3156
  nt(),
3157
- Ae
3157
+ Ee
3158
3158
  ].filter((d) => !!d),
3159
3159
  issueData: {
3160
3160
  code: l.invalid_return_type,
@@ -3640,7 +3640,7 @@ function yr(r, e = {}, t) {
3640
3640
  }) : Ce.create();
3641
3641
  }
3642
3642
  const rn = {
3643
- object: E.lazycreate
3643
+ object: A.lazycreate
3644
3644
  };
3645
3645
  var y;
3646
3646
  (function(r) {
@@ -3648,7 +3648,7 @@ var y;
3648
3648
  })(y || (y = {}));
3649
3649
  const sn = (r, e = {
3650
3650
  message: `Input not instance of ${r.name}`
3651
- }) => yr((t) => t instanceof r, e), vr = H.create, _r = fe.create, nn = ut.create, an = he.create, br = Le.create, on = we.create, cn = ot.create, dn = Ve.create, un = De.create, ln = Ce.create, fn = _e.create, hn = oe.create, pn = ct.create, mn = J.create, gn = E.create, yn = E.strictCreate, vn = Ue.create, _n = lt.create, bn = We.create, wn = re.create, xn = ze.create, kn = dt.create, Tn = xe.create, Sn = Se.create, En = Be.create, An = qe.create, Cn = pe.create, On = He.create, In = Oe.create, Xt = G.create, Nn = ee.create, jn = me.create, Rn = G.createWithPreprocess, Zn = Ye.create, Mn = () => vr().optional(), Pn = () => _r().optional(), $n = () => br().optional(), Fn = {
3651
+ }) => yr((t) => t instanceof r, e), vr = H.create, _r = fe.create, nn = ut.create, an = he.create, br = Le.create, on = we.create, cn = ot.create, dn = Ve.create, un = De.create, ln = Ce.create, fn = _e.create, hn = oe.create, pn = ct.create, mn = J.create, gn = A.create, yn = A.strictCreate, vn = Ue.create, _n = lt.create, bn = We.create, wn = re.create, xn = ze.create, kn = dt.create, Tn = xe.create, Sn = Se.create, An = Be.create, En = qe.create, Cn = pe.create, On = He.create, In = Oe.create, Xt = G.create, Nn = ee.create, jn = me.create, Rn = G.createWithPreprocess, Zn = Ye.create, Mn = () => vr().optional(), Pn = () => _r().optional(), $n = () => br().optional(), Fn = {
3652
3652
  string: (r) => H.create(g(u({}, r), { coerce: !0 })),
3653
3653
  number: (r) => fe.create(g(u({}, r), { coerce: !0 })),
3654
3654
  boolean: (r) => Le.create(g(u({}, r), {
@@ -3657,9 +3657,9 @@ const sn = (r, e = {
3657
3657
  bigint: (r) => he.create(g(u({}, r), { coerce: !0 })),
3658
3658
  date: (r) => we.create(g(u({}, r), { coerce: !0 }))
3659
3659
  }, Ln = _;
3660
- var S = /* @__PURE__ */ Object.freeze({
3660
+ var T = /* @__PURE__ */ Object.freeze({
3661
3661
  __proto__: null,
3662
- defaultErrorMap: Ae,
3662
+ defaultErrorMap: Ee,
3663
3663
  setErrorMap: js,
3664
3664
  getErrorMap: nt,
3665
3665
  makeIssue: at,
@@ -3696,7 +3696,7 @@ var S = /* @__PURE__ */ Object.freeze({
3696
3696
  ZodNever: oe,
3697
3697
  ZodVoid: ct,
3698
3698
  ZodArray: J,
3699
- ZodObject: E,
3699
+ ZodObject: A,
3700
3700
  ZodUnion: Ue,
3701
3701
  ZodDiscriminatedUnion: lt,
3702
3702
  ZodIntersection: We,
@@ -3740,8 +3740,8 @@ var S = /* @__PURE__ */ Object.freeze({
3740
3740
  function: Sn,
3741
3741
  instanceof: sn,
3742
3742
  intersection: bn,
3743
- lazy: En,
3744
- literal: An,
3743
+ lazy: An,
3744
+ literal: En,
3745
3745
  map: kn,
3746
3746
  nan: nn,
3747
3747
  nativeEnum: On,
@@ -3773,16 +3773,16 @@ var S = /* @__PURE__ */ Object.freeze({
3773
3773
  quotelessJson: Ns,
3774
3774
  ZodError: W
3775
3775
  });
3776
- const Vn = S.object({
3777
- language: S.enum(["typescript", "javascript"]).optional(),
3778
- disableMarkedForExport: S.boolean().optional(),
3779
- allowAutoSelectFirstNode: S.boolean().optional().default(!0)
3776
+ const Vn = T.object({
3777
+ language: T.enum(["typescript", "javascript"]).optional(),
3778
+ disableMarkedForExport: T.boolean().optional(),
3779
+ allowAutoSelectFirstNode: T.boolean().optional().default(!0)
3780
3780
  }).and(
3781
- S.union([
3782
- S.object({
3783
- framework: S.literal("react"),
3784
- model: S.string().optional(),
3785
- styling: S.enum([
3781
+ T.union([
3782
+ T.object({
3783
+ framework: T.literal("react"),
3784
+ model: T.string().optional(),
3785
+ styling: T.enum([
3786
3786
  "plain_css",
3787
3787
  "css_modules",
3788
3788
  "styled_components",
@@ -3791,26 +3791,27 @@ const Vn = S.object({
3791
3791
  "scss",
3792
3792
  "inline_styles"
3793
3793
  ]),
3794
- uiLibrary: S.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
3795
- responsivePages: S.array(
3796
- S.object({
3797
- name: S.string(),
3798
- framesId: S.array(S.string())
3794
+ uiLibrary: T.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
3795
+ responsivePages: T.array(
3796
+ T.object({
3797
+ name: T.string(),
3798
+ framesId: T.array(T.string())
3799
3799
  })
3800
3800
  ).optional(),
3801
- enableUILibraryTheming: S.boolean().optional(),
3802
- enableCompactStructure: S.boolean().optional(),
3803
- enableDisplayScreenModelId: S.boolean().optional(),
3804
- enableGeneratePackageLock: S.boolean().optional(),
3805
- enableAutoSplit: S.boolean().optional(),
3806
- autoSplitThreshold: S.number().optional(),
3807
- url: S.string().url().optional(),
3808
- codegenSettings: S.record(S.unknown()).optional()
3801
+ enableUILibraryTheming: T.boolean().optional(),
3802
+ enableCompactStructure: T.boolean().optional(),
3803
+ enableDisplayScreenModelId: T.boolean().optional(),
3804
+ enableGeneratePackageLock: T.boolean().optional(),
3805
+ enableAnimationsPreset: T.boolean().optional(),
3806
+ enableAutoSplit: T.boolean().optional(),
3807
+ autoSplitThreshold: T.number().optional(),
3808
+ url: T.string().url().optional(),
3809
+ codegenSettings: T.record(T.unknown()).optional()
3809
3810
  }),
3810
- S.object({
3811
- framework: S.literal("html"),
3812
- styling: S.enum(["plain_css", "inline_styles", "tailwind"]),
3813
- enableTranslation: S.boolean().optional()
3811
+ T.object({
3812
+ framework: T.literal("html"),
3813
+ styling: T.enum(["plain_css", "inline_styles", "tailwind"]),
3814
+ enableTranslation: T.boolean().optional()
3814
3815
  })
3815
3816
  ])
3816
3817
  ), Dn = (r) => {
@@ -3908,6 +3909,7 @@ class Qn {
3908
3909
  allowAutoSelectFirstNode: a.allowAutoSelectFirstNode,
3909
3910
  enableDisplayScreenModelId: a.enableDisplayScreenModelId,
3910
3911
  enableGeneratePackageLock: a.enableGeneratePackageLock,
3912
+ enableAnimationsPreset: a.enableAnimationsPreset,
3911
3913
  codegenSettings: a.codegenSettings,
3912
3914
  webhookUrl: e.webhookUrl
3913
3915
  };
@@ -4035,11 +4037,11 @@ O = new WeakMap(), Xe = new WeakMap(), le = new WeakSet(), wr = function(e, t, s
4035
4037
  const Ie = f.split(`
4036
4038
  `);
4037
4039
  f = Ie.pop() || "";
4038
- for (const A of Ie)
4039
- if (!(!A.trim() || A.startsWith(":")) && A.startsWith("data: ")) {
4040
+ for (const E of Ie)
4041
+ if (!(!E.trim() || E.startsWith(":")) && E.startsWith("data: ")) {
4040
4042
  let k;
4041
4043
  try {
4042
- k = JSON.parse(A.slice(6));
4044
+ k = JSON.parse(E.slice(6));
4043
4045
  } catch (ft) {
4044
4046
  continue;
4045
4047
  }
@@ -4278,7 +4280,7 @@ const na = (r, e) => C(void 0, null, function* () {
4278
4280
  export {
4279
4281
  Qn as Anima,
4280
4282
  de as CodegenError,
4281
- Ar as FigmaTokenIssue,
4283
+ Er as FigmaTokenIssue,
4282
4284
  Ir as NotFound,
4283
4285
  Cr as RateLimitExceeded,
4284
4286
  Or as RequestTooLarge,