@innovastudio/contentbuilder-blocks-runtime 1.0.27 → 1.0.29

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.
@@ -13,7 +13,7 @@ function fe() {
13
13
  return c;
14
14
  }
15
15
  function X(c, e) {
16
- if ((ge(c) || c === window || c === document) && (c = [c]), !$t(c) && !Ce(c) && (c = [c]), si(c) != 0) {
16
+ if ((me(c) || c === window || c === document) && (c = [c]), !$t(c) && !Ce(c) && (c = [c]), si(c) != 0) {
17
17
  if ($t(c) && !Ce(c)) {
18
18
  let i = c.length, t = 0;
19
19
  for (; t < i && e.call(c[t], c[t], t, c) !== !1; t++)
@@ -35,17 +35,17 @@ function qt(c, e = null, i = null) {
35
35
  function oe(c, { onElement: e, withCallback: i, avoidDuplicate: t = !0, once: n = !1, useCapture: s = !1 } = {}, r) {
36
36
  let o = e || [];
37
37
  Pe(o) && (o = document.querySelectorAll(o));
38
- function a(d) {
39
- G(i) && i.call(r, d, this), n && a.destroy();
38
+ function a(u) {
39
+ G(i) && i.call(r, u, this), n && a.destroy();
40
40
  }
41
41
  return a.destroy = function() {
42
- X(o, (d) => {
43
- const u = qt(d, c, a);
44
- u.found && u.all.splice(u.evt, 1), d.removeEventListener && d.removeEventListener(c, a, s);
42
+ X(o, (u) => {
43
+ const d = qt(u, c, a);
44
+ d.found && d.all.splice(d.evt, 1), u.removeEventListener && u.removeEventListener(c, a, s);
45
45
  });
46
- }, X(o, (d) => {
47
- const u = qt(d, c, a);
48
- (d.addEventListener && t && !u.found || !t) && (d.addEventListener(c, a, s), u.all.push({ eventName: c, fn: a }));
46
+ }, X(o, (u) => {
47
+ const d = qt(u, c, a);
48
+ (u.addEventListener && t && !d.found || !t) && (u.addEventListener(c, a, s), d.all.push({ eventName: c, fn: a }));
49
49
  }), a;
50
50
  }
51
51
  function H(c, e) {
@@ -204,7 +204,7 @@ function G(c) {
204
204
  function Pe(c) {
205
205
  return typeof c == "string";
206
206
  }
207
- function ge(c) {
207
+ function me(c) {
208
208
  return !!(c && c.nodeType && c.nodeType == 1);
209
209
  }
210
210
  function ii(c) {
@@ -365,8 +365,8 @@ class Ai {
365
365
  } else {
366
366
  if (this.x2 !== null) {
367
367
  e.deltaX = n - this.x2, e.deltaY = s - this.y2;
368
- var d = Math.abs(this.x1 - this.x2), u = Math.abs(this.y1 - this.y2);
369
- (d > 10 || u > 10) && (this._preventTap = !0);
368
+ var u = Math.abs(this.x1 - this.x2), d = Math.abs(this.y1 - this.y2);
369
+ (u > 10 || d > 10) && (this._preventTap = !0);
370
370
  } else
371
371
  e.deltaX = 0, e.deltaY = 0;
372
372
  this.pressMove.dispatch(e, this.element);
@@ -426,7 +426,7 @@ function lt(c) {
426
426
  function Mi(c) {
427
427
  if (c.events.hasOwnProperty("touch"))
428
428
  return !1;
429
- let e = ti(), i = e.width, t = e.height, n = !1, s = null, r = null, o = null, a = !1, d = 1, u = 4.5, l = 1, h = !1, p = !1, b = null, w = null, _ = null, g = null, v, f, m = 0, y = 0, k = !1, x = !1, S = {}, E = {}, L = 0, M = 0, C;
429
+ let e = ti(), i = e.width, t = e.height, n = !1, s = null, r = null, o = null, a = !1, u = 1, d = 4.5, l = 1, h = !1, p = !1, b = null, w = null, _ = null, m = null, v, f, g = 0, y = 0, k = !1, x = !1, S = {}, E = {}, L = 0, M = 0, C;
430
430
  const D = document.getElementById("glightbox-slider"), O = document.querySelector(".goverlay"), $ = new Ai(D, {
431
431
  touchStart: (R) => {
432
432
  if (n = !0, (te(R.targetTouches[0].target, "ginner-container") || ue(R.targetTouches[0].target, ".gslide-desc") || R.targetTouches[0].target.nodeName.toLowerCase() == "a") && (n = !1), ue(R.targetTouches[0].target, ".gslide-inline") && !te(R.targetTouches[0].target.parentNode, "gslide-inline") && (n = !1), n) {
@@ -445,20 +445,20 @@ function Mi(c) {
445
445
  }
446
446
  a = !0;
447
447
  let q = R.targetTouches[0].clientX, A = R.targetTouches[0].clientY, T = L - q, N = M - A;
448
- Math.abs(T) > Math.abs(N) ? (k = !1, x = !0) : (x = !1, k = !0), v = E.pageX - S.pageX, m = v * 100 / i, f = E.pageY - S.pageY, y = f * 100 / t;
448
+ Math.abs(T) > Math.abs(N) ? (k = !1, x = !0) : (x = !1, k = !0), v = E.pageX - S.pageX, g = v * 100 / i, f = E.pageY - S.pageY, y = f * 100 / t;
449
449
  let P;
450
- if (k && o && (P = 1 - Math.abs(f) / t, O.style.opacity = P, c.settings.touchFollowAxis && (m = 0)), x && (P = 1 - Math.abs(v) / i, r.style.opacity = P, c.settings.touchFollowAxis && (y = 0)), !o)
451
- return Fe(r, `translate3d(${m}%, 0, 0)`);
452
- Fe(r, `translate3d(${m}%, ${y}%, 0)`);
450
+ if (k && o && (P = 1 - Math.abs(f) / t, O.style.opacity = P, c.settings.touchFollowAxis && (g = 0)), x && (P = 1 - Math.abs(v) / i, r.style.opacity = P, c.settings.touchFollowAxis && (y = 0)), !o)
451
+ return Fe(r, `translate3d(${g}%, 0, 0)`);
452
+ Fe(r, `translate3d(${g}%, ${y}%, 0)`);
453
453
  },
454
454
  touchEnd: () => {
455
455
  if (!n)
456
456
  return;
457
457
  if (a = !1, p || h) {
458
- _ = b, g = w;
458
+ _ = b, m = w;
459
459
  return;
460
460
  }
461
- const R = Math.abs(parseInt(y)), q = Math.abs(parseInt(m));
461
+ const R = Math.abs(parseInt(y)), q = Math.abs(parseInt(g));
462
462
  if (R > 29 && o) {
463
463
  c.close();
464
464
  return;
@@ -472,23 +472,23 @@ function Mi(c) {
472
472
  }, 50);
473
473
  },
474
474
  multipointStart: () => {
475
- h = !0, d = l || 1;
475
+ h = !0, u = l || 1;
476
476
  },
477
477
  pinch: (R) => {
478
478
  if (!o || a)
479
479
  return !1;
480
- h = !0, o.scaleX = o.scaleY = d * R.zoom;
481
- let q = d * R.zoom;
480
+ h = !0, o.scaleX = o.scaleY = u * R.zoom;
481
+ let q = u * R.zoom;
482
482
  if (p = !0, q <= 1) {
483
- p = !1, q = 1, g = null, _ = null, b = null, w = null, o.setAttribute("style", "");
483
+ p = !1, q = 1, m = null, _ = null, b = null, w = null, o.setAttribute("style", "");
484
484
  return;
485
485
  }
486
- q > u && (q = u), o.style.transform = `scale3d(${q}, ${q}, 1)`, l = q;
486
+ q > d && (q = d), o.style.transform = `scale3d(${q}, ${q}, 1)`, l = q;
487
487
  },
488
488
  pressMove: (R) => {
489
489
  if (p && !h) {
490
490
  var q = E.pageX - S.pageX, A = E.pageY - S.pageY;
491
- _ && (q = q + _), g && (A = A + g), b = q, w = A;
491
+ _ && (q = q + _), m && (A = A + m), b = q, w = A;
492
492
  let T = `translate3d(${q}px, ${A}px, 0)`;
493
493
  l && (T += ` scale3d(${l}, ${l}, 1)`), Fe(o, T);
494
494
  }
@@ -643,15 +643,15 @@ function Oi(c, e, i, t) {
643
643
  H(n, "gvideo-container"), r.insertBefore(_e('<div class="gvideo-wrapper"></div>'), r.firstChild);
644
644
  const a = c.querySelector(".gvideo-wrapper");
645
645
  Ot(this.settings.plyr.css, "Plyr");
646
- let d = e.href, u = e?.videoProvider, l = !1;
646
+ let u = e.href, d = e?.videoProvider, l = !1;
647
647
  r.style.maxWidth = e.width, Ot(this.settings.plyr.js, "Plyr", () => {
648
- if (!u && d.match(/vimeo\.com\/([0-9]*)/) && (u = "vimeo"), !u && (d.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || d.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || d.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)) && (u = "youtube"), u === "local" || !u) {
649
- u = "local";
648
+ if (!d && u.match(/vimeo\.com\/([0-9]*)/) && (d = "vimeo"), !d && (u.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || u.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || u.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)) && (d = "youtube"), d === "local" || !d) {
649
+ d = "local";
650
650
  let w = '<video id="' + s + '" ';
651
- w += `style="background:#000; max-width: ${e.width};" `, w += 'preload="metadata" ', w += 'x-webkit-airplay="allow" ', w += "playsinline ", w += "controls ", w += 'class="gvideo-local">', w += `<source src="${d}">`, w += "</video>", l = _e(w);
651
+ w += `style="background:#000; max-width: ${e.width};" `, w += 'preload="metadata" ', w += 'x-webkit-airplay="allow" ', w += "playsinline ", w += "controls ", w += 'class="gvideo-local">', w += `<source src="${u}">`, w += "</video>", l = _e(w);
652
652
  }
653
- const h = l || _e(`<div id="${s}" data-plyr-provider="${u}" data-plyr-embed-id="${d}"></div>`);
654
- H(a, `${u}-video gvideo`), a.appendChild(h), a.setAttribute("data-id", s), a.setAttribute("data-index", i);
653
+ const h = l || _e(`<div id="${s}" data-plyr-provider="${d}" data-plyr-embed-id="${u}"></div>`);
654
+ H(a, `${d}-video gvideo`), a.appendChild(h), a.setAttribute("data-id", s), a.setAttribute("data-index", i);
655
655
  const p = Z(this.settings.plyr, "config") ? this.settings.plyr.config : {}, b = new Plyr("#" + s, p);
656
656
  b.on("ready", (w) => {
657
657
  o[s] = w.detail.plyr, G(t) && t();
@@ -670,7 +670,7 @@ function Dt(c) {
670
670
  function $i(c, e, i, t) {
671
671
  const n = c.querySelector(".gslide-media"), s = Z(e, "href") && e.href ? e.href.split("#").pop().trim() : !1, r = Z(e, "content") && e.content ? e.content : !1;
672
672
  let o;
673
- if (r && (Pe(r) && (o = _e(`<div class="ginlined-content">${r}</div>`)), ge(r))) {
673
+ if (r && (Pe(r) && (o = _e(`<div class="ginlined-content">${r}</div>`)), me(r))) {
674
674
  r.style.display == "none" && (r.style.display = "block");
675
675
  const a = document.createElement("div");
676
676
  a.className = "ginlined-content", a.appendChild(r), o = a;
@@ -679,8 +679,8 @@ function $i(c, e, i, t) {
679
679
  let a = document.getElementById(s);
680
680
  if (!a)
681
681
  return !1;
682
- const d = a.cloneNode(!0);
683
- d.style.height = e.height, d.style.maxWidth = e.width, H(d, "ginlined-content"), o = d;
682
+ const u = a.cloneNode(!0);
683
+ u.style.height = e.height, u.style.maxWidth = e.width, H(u, "ginlined-content"), o = u;
684
684
  }
685
685
  if (!o)
686
686
  return console.error("Unable to append inline slide content", e), !1;
@@ -730,7 +730,7 @@ class Pi {
730
730
  }
731
731
  parseConfig(e, i) {
732
732
  let t = fe({ descPosition: i.descPosition }, this.defaults);
733
- if (Ce(e) && !ge(e)) {
733
+ if (Ce(e) && !me(e)) {
734
734
  Z(e, "type") || (Z(e, "content") && e.content ? e.type = "inline" : Z(e, "href") && (e.type = this.sourceType(e.href)));
735
735
  let o = fe(t, e);
736
736
  return this.setSize(o, i), o;
@@ -738,8 +738,8 @@ class Pi {
738
738
  let n = "", s = e.getAttribute("data-glightbox"), r = e.nodeName.toLowerCase();
739
739
  if (r === "a" && (n = e.href), r === "img" && (n = e.src, t.alt = e.alt), t.href = n, X(t, (o, a) => {
740
740
  Z(i, a) && a !== "width" && (t[a] = i[a]);
741
- const d = e.dataset[a];
742
- re(d) || (t[a] = this.sanitizeValue(d));
741
+ const u = e.dataset[a];
742
+ re(u) || (t[a] = this.sanitizeValue(u));
743
743
  }), t.content && (t.type = "inline"), !t.type && n && (t.type = this.sourceType(n)), re(s)) {
744
744
  if (!t.title && r == "a") {
745
745
  let o = e.title;
@@ -751,13 +751,13 @@ class Pi {
751
751
  }
752
752
  } else {
753
753
  let o = [];
754
- X(t, (a, d) => {
755
- o.push(";\\s?" + d);
756
- }), o = o.join("\\s?:|"), s.trim() !== "" && X(t, (a, d) => {
757
- const u = s, l = "s?" + d + "s?:s?(.*?)(" + o + "s?:|$)", h = new RegExp(l), p = u.match(h);
754
+ X(t, (a, u) => {
755
+ o.push(";\\s?" + u);
756
+ }), o = o.join("\\s?:|"), s.trim() !== "" && X(t, (a, u) => {
757
+ const d = s, l = "s?" + u + "s?:s?(.*?)(" + o + "s?:|$)", h = new RegExp(l), p = d.match(h);
758
758
  if (p && p.length && p[1]) {
759
759
  const b = p[1].trim().replace(/;\s*$/, "");
760
- t[d] = this.sanitizeValue(b);
760
+ t[u] = this.sanitizeValue(b);
761
761
  }
762
762
  });
763
763
  }
@@ -830,14 +830,14 @@ class ze {
830
830
  slide: e,
831
831
  player: !1
832
832
  });
833
- let r = n.type, o = n.descPosition, a = e.querySelector(".gslide-media"), d = e.querySelector(".gslide-title"), u = e.querySelector(".gslide-desc"), l = e.querySelector(".gdesc-inner"), h = i, p = "gSlideTitle_" + this.index, b = "gSlideDesc_" + this.index;
833
+ let r = n.type, o = n.descPosition, a = e.querySelector(".gslide-media"), u = e.querySelector(".gslide-title"), d = e.querySelector(".gslide-desc"), l = e.querySelector(".gdesc-inner"), h = i, p = "gSlideTitle_" + this.index, b = "gSlideDesc_" + this.index;
834
834
  if (G(t.afterSlideLoad) && (h = () => {
835
835
  G(i) && i(), t.afterSlideLoad({
836
836
  index: this.index,
837
837
  slide: e,
838
838
  player: this.instance.getSlidePlayerInstance(this.index)
839
839
  });
840
- }), n.title == "" && n.description == "" ? l && l.parentNode.parentNode.removeChild(l.parentNode) : (d && n.title !== "" ? (d.id = p, d.innerHTML = n.title) : d.parentNode.removeChild(d), u && n.description !== "" ? (u.id = b, s && t.moreLength > 0 ? (n.smallDescription = this.slideShortDesc(n.description, t.moreLength, t.moreText), u.innerHTML = n.smallDescription, this.descriptionEvents(u, n)) : u.innerHTML = n.description) : u.parentNode.removeChild(u), H(a.parentNode, `desc-${o}`), H(l.parentNode, `description-${o}`)), H(a, `gslide-${r}`), H(e, "loaded"), r === "video") {
840
+ }), n.title == "" && n.description == "" ? l && l.parentNode.parentNode.removeChild(l.parentNode) : (u && n.title !== "" ? (u.id = p, u.innerHTML = n.title) : u.parentNode.removeChild(u), d && n.description !== "" ? (d.id = b, s && t.moreLength > 0 ? (n.smallDescription = this.slideShortDesc(n.description, t.moreLength, t.moreText), d.innerHTML = n.smallDescription, this.descriptionEvents(d, n)) : d.innerHTML = n.description) : d.parentNode.removeChild(d), H(a.parentNode, `desc-${o}`), H(l.parentNode, `description-${o}`)), H(a, `gslide-${r}`), H(e, "loaded"), r === "video") {
841
841
  Oi.apply(this.instance, [e, n, this.index, h]);
842
842
  return;
843
843
  }
@@ -896,8 +896,8 @@ class ze {
896
896
  o.innerHTML = i.description, H(r, "gdesc-open");
897
897
  let a = oe("click", {
898
898
  onElement: [r, ue(o, ".gslide-description")],
899
- withCallback: (d, u) => {
900
- d.target.nodeName.toLowerCase() !== "a" && (J(r, "gdesc-open"), H(r, "gdesc-closed"), o.innerHTML = i.smallDescription, this.descriptionEvents(o, i), setTimeout(() => {
899
+ withCallback: (u, d) => {
900
+ u.target.nodeName.toLowerCase() !== "a" && (J(r, "gdesc-open"), H(r, "gdesc-closed"), o.innerHTML = i.smallDescription, this.descriptionEvents(o, i), setTimeout(() => {
901
901
  J(r, "gdesc-closed");
902
902
  }, 400), a.destroy());
903
903
  }
@@ -923,7 +923,7 @@ class ze {
923
923
  * @return { object }
924
924
  */
925
925
  getConfig() {
926
- !ge(this.element) && !this.element.hasOwnProperty("draggable") && (this.element.draggable = this.instance.settings.draggable);
926
+ !me(this.element) && !this.element.hasOwnProperty("draggable") && (this.element.draggable = this.instance.settings.draggable);
927
927
  const e = new Pi(this.instance.settings.slideExtraAttributes);
928
928
  return this.slideConfig = e.parseConfig(this.element, this.instance.settings), this.slideConfig;
929
929
  }
@@ -1051,7 +1051,7 @@ class Ut {
1051
1051
  return !1;
1052
1052
  this.activeSlide = null, this.prevActiveSlideIndex = null, this.prevActiveSlide = null;
1053
1053
  let t = Ge(i) ? i : this.settings.startAt;
1054
- if (ge(e)) {
1054
+ if (me(e)) {
1055
1055
  const o = e.getAttribute("data-gallery");
1056
1056
  o && (this.fullElementsList = this.elements, this.elements = this.getGalleryElements(this.elements, o)), re(t) && (t = this.getElementIndex(e), t < 0 && (t = 0));
1057
1057
  }
@@ -1161,15 +1161,15 @@ class Ut {
1161
1161
  i < 0 && (i = this.elements.length);
1162
1162
  const t = new ze(e, this, i), n = t.getConfig(), s = fe({}, n), r = t.create(), o = this.elements.length - 1;
1163
1163
  s.index = i, s.node = !1, s.instance = t, s.slideConfig = n, this.elements.splice(i, 0, s);
1164
- let a = null, d = null;
1164
+ let a = null, u = null;
1165
1165
  if (this.slidesContainer) {
1166
1166
  if (i > o)
1167
1167
  this.slidesContainer.appendChild(r);
1168
1168
  else {
1169
- let u = this.slidesContainer.querySelectorAll(".gslide")[i];
1170
- this.slidesContainer.insertBefore(r, u);
1169
+ let d = this.slidesContainer.querySelectorAll(".gslide")[i];
1170
+ this.slidesContainer.insertBefore(r, d);
1171
1171
  }
1172
- (this.settings.preload && this.index == 0 && i == 0 || this.index - 1 == i || this.index + 1 == i) && this.preloadSlide(i), this.index === 0 && i === 0 && (this.index = 1), this.updateNavigationClasses(), a = this.slidesContainer.querySelectorAll(".gslide")[i], d = this.getSlidePlayerInstance(i), s.slideNode = a;
1172
+ (this.settings.preload && this.index == 0 && i == 0 || this.index - 1 == i || this.index + 1 == i) && this.preloadSlide(i), this.index === 0 && i === 0 && (this.index = 1), this.updateNavigationClasses(), a = this.slidesContainer.querySelectorAll(".gslide")[i], u = this.getSlidePlayerInstance(i), s.slideNode = a;
1173
1173
  }
1174
1174
  this.trigger("slide_inserted", {
1175
1175
  index: i,
@@ -1178,11 +1178,11 @@ class Ut {
1178
1178
  slideConfig: n,
1179
1179
  slideIndex: i,
1180
1180
  trigger: null,
1181
- player: d
1181
+ player: u
1182
1182
  }), G(this.settings.slideInserted) && this.settings.slideInserted({
1183
1183
  index: i,
1184
1184
  slide: a,
1185
- player: d
1185
+ player: u
1186
1186
  });
1187
1187
  }
1188
1188
  /**
@@ -1312,7 +1312,7 @@ class Ut {
1312
1312
  * @return void
1313
1313
  */
1314
1314
  stopSlideVideo(e) {
1315
- if (ge(e)) {
1315
+ if (me(e)) {
1316
1316
  let t = e.querySelector(".gvideo-wrapper");
1317
1317
  t && (e = t.getAttribute("data-index"));
1318
1318
  }
@@ -1327,7 +1327,7 @@ class Ut {
1327
1327
  * @return void
1328
1328
  */
1329
1329
  slidePlayerPause(e) {
1330
- if (ge(e)) {
1330
+ if (me(e)) {
1331
1331
  let t = e.querySelector(".gvideo-wrapper");
1332
1332
  t && (e = t.getAttribute("data-index"));
1333
1333
  }
@@ -1342,7 +1342,7 @@ class Ut {
1342
1342
  * @return void
1343
1343
  */
1344
1344
  playSlideVideo(e) {
1345
- if (ge(e)) {
1345
+ if (me(e)) {
1346
1346
  let t = e.querySelector(".gvideo-wrapper");
1347
1347
  t && (e = t.getAttribute("data-index"));
1348
1348
  }
@@ -1360,7 +1360,7 @@ class Ut {
1360
1360
  slidePlayerPlay(e) {
1361
1361
  if (Ht && !this.settings.plyr.config?.muted)
1362
1362
  return;
1363
- if (ge(e)) {
1363
+ if (me(e)) {
1364
1364
  let t = e.querySelector(".gvideo-wrapper");
1365
1365
  t && (e = t.getAttribute("data-index"));
1366
1366
  }
@@ -1473,8 +1473,8 @@ class Ut {
1473
1473
  if (this.built)
1474
1474
  return !1;
1475
1475
  const e = document.body.childNodes, i = [];
1476
- X(e, (d) => {
1477
- d.parentNode == document.body && d.nodeName.charAt(0) !== "#" && d.hasAttribute && !d.hasAttribute("aria-hidden") && (i.push(d), d.setAttribute("aria-hidden", "true"));
1476
+ X(e, (u) => {
1477
+ u.parentNode == document.body && u.nodeName.charAt(0) !== "#" && u.hasAttribute && !u.hasAttribute("aria-hidden") && (i.push(u), u.setAttribute("aria-hidden", "true"));
1478
1478
  });
1479
1479
  const t = Z(this.settings.svg, "next") ? this.settings.svg.next : "", n = Z(this.settings.svg, "prev") ? this.settings.svg.prev : "", s = Z(this.settings.svg, "close") ? this.settings.svg.close : "";
1480
1480
  let r = this.settings.lightboxHTML;
@@ -1484,26 +1484,26 @@ class Ut {
1484
1484
  let a = o.querySelector(".gclose");
1485
1485
  this.prevButton = o.querySelector(".gprev"), this.nextButton = o.querySelector(".gnext"), this.overlay = o.querySelector(".goverlay"), this.loader = o.querySelector(".gloader"), this.slidesContainer = document.getElementById("glightbox-slider"), this.bodyHiddenChildElms = i, this.events = {}, H(this.modal, "glightbox-" + this.settings.skin), this.settings.closeButton && a && (this.events.close = oe("click", {
1486
1486
  onElement: a,
1487
- withCallback: (d, u) => {
1488
- d.preventDefault(), this.close();
1487
+ withCallback: (u, d) => {
1488
+ u.preventDefault(), this.close();
1489
1489
  }
1490
1490
  })), a && !this.settings.closeButton && a.parentNode.removeChild(a), this.nextButton && (this.events.next = oe("click", {
1491
1491
  onElement: this.nextButton,
1492
- withCallback: (d, u) => {
1493
- d.preventDefault(), this.nextSlide();
1492
+ withCallback: (u, d) => {
1493
+ u.preventDefault(), this.nextSlide();
1494
1494
  }
1495
1495
  })), this.prevButton && (this.events.prev = oe("click", {
1496
1496
  onElement: this.prevButton,
1497
- withCallback: (d, u) => {
1498
- d.preventDefault(), this.prevSlide();
1497
+ withCallback: (u, d) => {
1498
+ u.preventDefault(), this.prevSlide();
1499
1499
  }
1500
1500
  })), this.settings.closeOnOutsideClick && (this.events.outClose = oe("click", {
1501
1501
  onElement: o,
1502
- withCallback: (d, u) => {
1503
- !this.preventOutsideClick && !te(document.body, "glightbox-mobile") && !ue(d.target, ".ginner-container") && !ue(d.target, ".gbtn") && !te(d.target, "gnext") && !te(d.target, "gprev") && this.close();
1502
+ withCallback: (u, d) => {
1503
+ !this.preventOutsideClick && !te(document.body, "glightbox-mobile") && !ue(u.target, ".ginner-container") && !ue(u.target, ".gbtn") && !te(u.target, "gnext") && !te(u.target, "gprev") && this.close();
1504
1504
  }
1505
- })), X(this.elements, (d, u) => {
1506
- this.slidesContainer.appendChild(d.instance.create()), d.slideNode = this.slidesContainer.querySelectorAll(".gslide")[u];
1505
+ })), X(this.elements, (u, d) => {
1506
+ this.slidesContainer.appendChild(u.instance.create()), u.slideNode = this.slidesContainer.querySelectorAll(".gslide")[d];
1507
1507
  }), zt && H(document.body, "glightbox-touch"), this.events.resize = oe("resize", {
1508
1508
  onElement: window,
1509
1509
  withCallback: () => {
@@ -1531,23 +1531,23 @@ class Ut {
1531
1531
  if (r <= 768)
1532
1532
  n.querySelector("img");
1533
1533
  else if (a) {
1534
- let d = s.offsetHeight, u = n.querySelector("img");
1534
+ let u = s.offsetHeight, d = n.querySelector("img");
1535
1535
  const h = this.elements[this.index].node.getAttribute("data-height") ?? "100vh";
1536
- u.setAttribute("style", `max-height: calc(${h} - ${d}px)`), s.setAttribute("style", `max-width: ${u.offsetWidth}px;`);
1536
+ d.setAttribute("style", `max-height: calc(${h} - ${u}px)`), s.setAttribute("style", `max-width: ${d.offsetWidth}px;`);
1537
1537
  }
1538
1538
  }
1539
1539
  if (t) {
1540
- let d = Z(this.settings.plyr.config, "ratio") ? this.settings.plyr.config.ratio : "";
1541
- if (!d) {
1540
+ let u = Z(this.settings.plyr.config, "ratio") ? this.settings.plyr.config.ratio : "";
1541
+ if (!u) {
1542
1542
  const b = t.clientWidth, w = t.clientHeight, _ = b / w;
1543
- d = `${b / _}:${w / _}`;
1543
+ u = `${b / _}:${w / _}`;
1544
1544
  }
1545
- let u = d.split(":"), l = this.settings.videosWidth, h = this.settings.videosWidth;
1545
+ let d = u.split(":"), l = this.settings.videosWidth, h = this.settings.videosWidth;
1546
1546
  Ge(l) || l.indexOf("px") !== -1 ? h = parseInt(l) : l.indexOf("vw") !== -1 ? h = r * parseInt(l) / 100 : l.indexOf("vh") !== -1 ? h = o * parseInt(l) / 100 : l.indexOf("%") !== -1 ? h = r * parseInt(l) / 100 : h = parseInt(t.clientWidth);
1547
- let p = h / (parseInt(u[0]) / parseInt(u[1]));
1547
+ let p = h / (parseInt(d[0]) / parseInt(d[1]));
1548
1548
  if (p = Math.floor(p), a && (o = o - s.offsetHeight), h > r || p > o || o < p && r > h) {
1549
- let b = t.offsetWidth, w = t.offsetHeight, _ = o / w, g = { width: b * _ };
1550
- t.parentNode.setAttribute("style", `max-width: ${g.width}px`), a && s.setAttribute("style", `max-width: ${g.width}px;`);
1549
+ let b = t.offsetWidth, w = t.offsetHeight, _ = o / w, m = { width: b * _ };
1550
+ t.parentNode.setAttribute("style", `max-width: ${m.width}px`), a && s.setAttribute("style", `max-width: ${m.width}px;`);
1551
1551
  } else
1552
1552
  t.parentNode.style.maxWidth = `${l}`, a && s.setAttribute("style", `max-width: ${l};`);
1553
1553
  }
@@ -1979,7 +1979,7 @@ var Wi = {
1979
1979
  }
1980
1980
  }
1981
1981
  };
1982
- function me(c) {
1982
+ function ge(c) {
1983
1983
  console.error("[Glide warn]: ".concat(c));
1984
1984
  }
1985
1985
  function Q(c) {
@@ -2007,7 +2007,7 @@ function ht(c) {
2007
2007
  function Xi(c, e, i) {
2008
2008
  var t = {};
2009
2009
  for (var n in e)
2010
- Je(e[n]) ? t[n] = e[n](c, t, i) : me("Extension must be a function");
2010
+ Je(e[n]) ? t[n] = e[n](c, t, i) : ge("Extension must be a function");
2011
2011
  for (var s in t)
2012
2012
  Je(t[s].mount) && t[s].mount();
2013
2013
  return t;
@@ -2080,7 +2080,7 @@ var Zi = /* @__PURE__ */ (function() {
2080
2080
  key: "mount",
2081
2081
  value: function() {
2082
2082
  var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2083
- return this._e.emit("mount.before"), Ae(i) ? this._c = Xi(this, i, this._e) : me("You need to provide a object on `mount()`"), this._e.emit("mount.after"), this;
2083
+ return this._e.emit("mount.before"), Ae(i) ? this._c = Xi(this, i, this._e) : ge("You need to provide a object on `mount()`"), this._e.emit("mount.after"), this;
2084
2084
  }
2085
2085
  /**
2086
2086
  * Collects an instance `translate` transformers.
@@ -2092,7 +2092,7 @@ var Zi = /* @__PURE__ */ (function() {
2092
2092
  key: "mutate",
2093
2093
  value: function() {
2094
2094
  var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
2095
- return ht(i) ? this._t = i : me("You need to provide a array on `mutate()`"), this;
2095
+ return ht(i) ? this._t = i : ge("You need to provide a array on `mutate()`"), this;
2096
2096
  }
2097
2097
  /**
2098
2098
  * Updates glide with specified settings.
@@ -2221,7 +2221,7 @@ var Zi = /* @__PURE__ */ (function() {
2221
2221
  return this._o;
2222
2222
  },
2223
2223
  set: function(i) {
2224
- Ae(i) ? this._o = i : me("Options must be an `object` instance.");
2224
+ Ae(i) ? this._o = i : ge("Options must be an `object` instance.");
2225
2225
  }
2226
2226
  /**
2227
2227
  * Gets current index of the slider.
@@ -2276,10 +2276,10 @@ function Ki(c, e, i) {
2276
2276
  *
2277
2277
  * @param {String} move
2278
2278
  */
2279
- make: function(d) {
2280
- var u = this;
2281
- c.disabled || (!c.settings.waitForTransition || c.disable(), this.move = d, i.emit("run.before", this.move), this.calculate(), i.emit("run", this.move), e.Transition.after(function() {
2282
- u.isStart() && i.emit("run.start", u.move), u.isEnd() && i.emit("run.end", u.move), u.isOffset() && (u._o = !1, i.emit("run.offset", u.move)), i.emit("run.after", u.move), c.enable();
2279
+ make: function(u) {
2280
+ var d = this;
2281
+ c.disabled || (!c.settings.waitForTransition || c.disable(), this.move = u, i.emit("run.before", this.move), this.calculate(), i.emit("run", this.move), e.Transition.after(function() {
2282
+ d.isStart() && i.emit("run.start", d.move), d.isEnd() && i.emit("run.end", d.move), d.isOffset() && (d._o = !1, i.emit("run.offset", d.move)), i.emit("run.after", d.move), c.enable();
2283
2283
  }));
2284
2284
  },
2285
2285
  /**
@@ -2288,17 +2288,17 @@ function Ki(c, e, i) {
2288
2288
  * @return {Number|Undefined}
2289
2289
  */
2290
2290
  calculate: function() {
2291
- var d = this.move, u = this.length, l = d.steps, h = d.direction, p = 1;
2291
+ var u = this.move, d = this.length, l = u.steps, h = u.direction, p = 1;
2292
2292
  if (h === "=") {
2293
- if (c.settings.bound && Q(l) > u) {
2294
- c.index = u;
2293
+ if (c.settings.bound && Q(l) > d) {
2294
+ c.index = d;
2295
2295
  return;
2296
2296
  }
2297
2297
  c.index = l;
2298
2298
  return;
2299
2299
  }
2300
2300
  if (h === ">" && l === ">") {
2301
- c.index = u;
2301
+ c.index = d;
2302
2302
  return;
2303
2303
  }
2304
2304
  if (h === "<" && l === "<") {
@@ -2307,7 +2307,7 @@ function Ki(c, e, i) {
2307
2307
  }
2308
2308
  if (h === "|" && (p = c.settings.perView || 1), h === ">" || h === "|" && l === ">") {
2309
2309
  var b = n(p);
2310
- b > u && (this._o = !0), c.index = s(b, p);
2310
+ b > d && (this._o = !0), c.index = s(b, p);
2311
2311
  return;
2312
2312
  }
2313
2313
  if (h === "<" || h === "|" && l === "<") {
@@ -2315,7 +2315,7 @@ function Ki(c, e, i) {
2315
2315
  w < 0 && (this._o = !0), c.index = o(w, p);
2316
2316
  return;
2317
2317
  }
2318
- me("Invalid direction pattern [".concat(h).concat(l, "] has been used"));
2318
+ ge("Invalid direction pattern [".concat(h).concat(l, "] has been used"));
2319
2319
  },
2320
2320
  /**
2321
2321
  * Checks if we are on the first slide.
@@ -2340,8 +2340,8 @@ function Ki(c, e, i) {
2340
2340
  * @return {Boolean}
2341
2341
  */
2342
2342
  isOffset: function() {
2343
- var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
2344
- return d ? this._o ? d === "|>" ? this.move.direction === "|" && this.move.steps === ">" : d === "|<" ? this.move.direction === "|" && this.move.steps === "<" : this.move.direction === d : !1 : this._o;
2343
+ var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
2344
+ return u ? this._o ? u === "|>" ? this.move.direction === "|" && this.move.steps === ">" : u === "|<" ? this.move.direction === "|" && this.move.steps === "<" : this.move.direction === u : !1 : this._o;
2345
2345
  },
2346
2346
  /**
2347
2347
  * Checks if bound mode is active
@@ -2353,23 +2353,23 @@ function Ki(c, e, i) {
2353
2353
  }
2354
2354
  };
2355
2355
  function n(a) {
2356
- var d = c.index;
2357
- return c.isType("carousel") ? d + a : d + (a - d % a);
2356
+ var u = c.index;
2357
+ return c.isType("carousel") ? u + a : u + (a - u % a);
2358
2358
  }
2359
- function s(a, d) {
2360
- var u = t.length;
2361
- return a <= u ? a : c.isType("carousel") ? a - (u + 1) : c.settings.rewind ? t.isBound() && !t.isEnd() ? u : 0 : t.isBound() ? u : Math.floor(u / d) * d;
2359
+ function s(a, u) {
2360
+ var d = t.length;
2361
+ return a <= d ? a : c.isType("carousel") ? a - (d + 1) : c.settings.rewind ? t.isBound() && !t.isEnd() ? d : 0 : t.isBound() ? d : Math.floor(d / u) * u;
2362
2362
  }
2363
2363
  function r(a) {
2364
- var d = c.index;
2364
+ var u = c.index;
2365
2365
  if (c.isType("carousel"))
2366
- return d - a;
2367
- var u = Math.ceil(d / a);
2368
- return (u - 1) * a;
2366
+ return u - a;
2367
+ var d = Math.ceil(u / a);
2368
+ return (d - 1) * a;
2369
2369
  }
2370
- function o(a, d) {
2371
- var u = t.length;
2372
- return a >= 0 ? a : c.isType("carousel") ? a + (u + 1) : c.settings.rewind ? t.isBound() && t.isStart() ? u : Math.floor(u / d) * d : 0;
2370
+ function o(a, u) {
2371
+ var d = t.length;
2372
+ return a >= 0 ? a : c.isType("carousel") ? a + (d + 1) : c.settings.rewind ? t.isBound() && t.isStart() ? d : Math.floor(d / u) * u : 0;
2373
2373
  }
2374
2374
  return V(t, "move", {
2375
2375
  /**
@@ -2385,11 +2385,11 @@ function Ki(c, e, i) {
2385
2385
  *
2386
2386
  * @returns {Object}
2387
2387
  */
2388
- set: function(d) {
2389
- var u = d.substr(1);
2388
+ set: function(u) {
2389
+ var d = u.substr(1);
2390
2390
  this._m = {
2391
- direction: d.substr(0, 1),
2392
- steps: u ? Q(u) ? Q(u) : u : 0
2391
+ direction: u.substr(0, 1),
2392
+ steps: d ? Q(d) ? Q(d) : d : 0
2393
2393
  };
2394
2394
  }
2395
2395
  }), V(t, "length", {
@@ -2400,8 +2400,8 @@ function Ki(c, e, i) {
2400
2400
  * @return {Number}
2401
2401
  */
2402
2402
  get: function() {
2403
- var d = c.settings, u = e.Html.slides.length;
2404
- return this.isBound() ? u - 1 - (Q(d.perView) - 1) + Q(d.focusAt) : u - 1;
2403
+ var u = c.settings, d = e.Html.slides.length;
2404
+ return this.isBound() ? d - 1 - (Q(u.perView) - 1) + Q(u.focusAt) : d - 1;
2405
2405
  }
2406
2406
  }), V(t, "offset", {
2407
2407
  /**
@@ -2420,15 +2420,15 @@ function Ft() {
2420
2420
  function it(c, e) {
2421
2421
  var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, t, n, s, r, o = 0, a = function() {
2422
2422
  o = i.leading === !1 ? 0 : Ft(), t = null, r = c.apply(n, s), t || (n = s = null);
2423
- }, d = function() {
2423
+ }, u = function() {
2424
2424
  var l = Ft();
2425
2425
  !o && i.leading === !1 && (o = l);
2426
2426
  var h = e - (l - o);
2427
2427
  return n = this, s = arguments, h <= 0 || h > e ? (t && (clearTimeout(t), t = null), o = l, r = c.apply(n, s), t || (n = s = null)) : !t && i.trailing !== !1 && (t = setTimeout(a, h)), r;
2428
2428
  };
2429
- return d.cancel = function() {
2429
+ return u.cancel = function() {
2430
2430
  clearTimeout(t), o = 0, t = n = s = null;
2431
- }, d;
2431
+ }, u;
2432
2432
  }
2433
2433
  var Ue = {
2434
2434
  ltr: ["marginLeft", "marginRight"],
@@ -2445,8 +2445,8 @@ function es(c, e, i) {
2445
2445
  */
2446
2446
  apply: function(s) {
2447
2447
  for (var r = 0, o = s.length; r < o; r++) {
2448
- var a = s[r].style, d = e.Direction.value;
2449
- r !== 0 ? a[Ue[d][0]] = "".concat(this.value / 2, "px") : a[Ue[d][0]] = "", r !== s.length - 1 ? a[Ue[d][1]] = "".concat(this.value / 2, "px") : a[Ue[d][1]] = "";
2448
+ var a = s[r].style, u = e.Direction.value;
2449
+ r !== 0 ? a[Ue[u][0]] = "".concat(this.value / 2, "px") : a[Ue[u][0]] = "", r !== s.length - 1 ? a[Ue[u][1]] = "".concat(this.value / 2, "px") : a[Ue[u][1]] = "";
2450
2450
  }
2451
2451
  },
2452
2452
  /**
@@ -2544,7 +2544,7 @@ function is(c, e, i) {
2544
2544
  * @return {Object}
2545
2545
  */
2546
2546
  set: function(s) {
2547
- dt(s) && (s = document.querySelector(s)), s !== null ? t._r = s : me("Root element must be a existing Html node");
2547
+ dt(s) && (s = document.querySelector(s)), s !== null ? t._r = s : ge("Root element must be a existing Html node");
2548
2548
  }
2549
2549
  }), V(t, "track", {
2550
2550
  /**
@@ -2822,16 +2822,16 @@ function ls(c, e, i) {
2822
2822
  * @return {[]}
2823
2823
  */
2824
2824
  collect: function() {
2825
- var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], r = e.Html.slides, o = c.settings, a = o.perView, d = o.classes, u = o.cloningRatio;
2825
+ var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], r = e.Html.slides, o = c.settings, a = o.perView, u = o.classes, d = o.cloningRatio;
2826
2826
  if (r.length > 0)
2827
- for (var l = +!!c.settings.peek, h = a + l + Math.round(a / 2), p = r.slice(0, h).reverse(), b = r.slice(h * -1), w = 0; w < Math.max(u, Math.floor(a / r.length)); w++) {
2827
+ for (var l = +!!c.settings.peek, h = a + l + Math.round(a / 2), p = r.slice(0, h).reverse(), b = r.slice(h * -1), w = 0; w < Math.max(d, Math.floor(a / r.length)); w++) {
2828
2828
  for (var _ = 0; _ < p.length; _++) {
2829
- var g = p[_].cloneNode(!0);
2830
- g.classList.add(d.slide.clone), s.push(g);
2829
+ var m = p[_].cloneNode(!0);
2830
+ m.classList.add(u.slide.clone), s.push(m);
2831
2831
  }
2832
2832
  for (var v = 0; v < b.length; v++) {
2833
2833
  var f = b[v].cloneNode(!0);
2834
- f.classList.add(d.slide.clone), s.unshift(f);
2834
+ f.classList.add(u.slide.clone), s.unshift(f);
2835
2835
  }
2836
2836
  }
2837
2837
  return s;
@@ -2842,10 +2842,10 @@ function ls(c, e, i) {
2842
2842
  * @return {Void}
2843
2843
  */
2844
2844
  append: function() {
2845
- for (var s = this.items, r = e.Html, o = r.wrapper, a = r.slides, d = Math.floor(s.length / 2), u = s.slice(0, d).reverse(), l = s.slice(d * -1).reverse(), h = "".concat(e.Sizes.slideWidth, "px"), p = 0; p < l.length; p++)
2845
+ for (var s = this.items, r = e.Html, o = r.wrapper, a = r.slides, u = Math.floor(s.length / 2), d = s.slice(0, u).reverse(), l = s.slice(u * -1).reverse(), h = "".concat(e.Sizes.slideWidth, "px"), p = 0; p < l.length; p++)
2846
2846
  o.appendChild(l[p]);
2847
- for (var b = 0; b < u.length; b++)
2848
- o.insertBefore(u[b], a[0]);
2847
+ for (var b = 0; b < d.length; b++)
2848
+ o.insertBefore(d[b], a[0]);
2849
2849
  for (var w = 0; w < s.length; w++)
2850
2850
  s[w].style.width = h;
2851
2851
  },
@@ -3016,7 +3016,7 @@ function ds(c, e, i) {
3016
3016
  * @return {Void}
3017
3017
  */
3018
3018
  set: function(s) {
3019
- cs.indexOf(s) > -1 ? t._v = s : me("Direction value must be `ltr` or `rtl`");
3019
+ cs.indexOf(s) > -1 ? t._v = s : ge("Direction value must be `ltr` or `rtl`");
3020
3020
  }
3021
3021
  }), i.on(["destroy", "update"], function() {
3022
3022
  t.removeClass();
@@ -3066,7 +3066,7 @@ function fs(c, e) {
3066
3066
  }
3067
3067
  };
3068
3068
  }
3069
- function gs(c, e) {
3069
+ function ms(c, e) {
3070
3070
  return {
3071
3071
  /**
3072
3072
  * Modifies passed translate value with a `peek` setting.
@@ -3083,7 +3083,7 @@ function gs(c, e) {
3083
3083
  }
3084
3084
  };
3085
3085
  }
3086
- function ms(c, e) {
3086
+ function gs(c, e) {
3087
3087
  return {
3088
3088
  /**
3089
3089
  * Modifies passed translate value with index in the `focusAt` setting.
@@ -3098,7 +3098,7 @@ function ms(c, e) {
3098
3098
  };
3099
3099
  }
3100
3100
  function bs(c, e, i) {
3101
- var t = [ps, fs, gs, ms].concat(c._t, [hs]);
3101
+ var t = [ps, fs, ms, gs].concat(c._t, [hs]);
3102
3102
  return {
3103
3103
  /**
3104
3104
  * Piplines translate value with registered transformers.
@@ -3109,7 +3109,7 @@ function bs(c, e, i) {
3109
3109
  mutate: function(s) {
3110
3110
  for (var r = 0; r < t.length; r++) {
3111
3111
  var o = t[r];
3112
- Je(o) && Je(o().modify) ? s = o(c, e, i).modify(s) : me("Transformer should be a function that returns an object with `modify()` method");
3112
+ Je(o) && Je(o().modify) ? s = o(c, e, i).modify(s) : ge("Transformer should be a function that returns an object with `modify()` method");
3113
3113
  }
3114
3114
  return s;
3115
3115
  }
@@ -3251,11 +3251,11 @@ try {
3251
3251
  window.addEventListener("testPassive", null, Gt), window.removeEventListener("testPassive", null, Gt);
3252
3252
  } catch {
3253
3253
  }
3254
- var gt = oi, je = ["touchstart", "mousedown"], Vt = ["touchmove", "mousemove"], Wt = ["touchend", "touchcancel", "mouseup", "mouseleave"], Yt = ["mousedown", "mousemove", "mouseup", "mouseleave"];
3254
+ var mt = oi, je = ["touchstart", "mousedown"], Vt = ["touchmove", "mousemove"], Wt = ["touchend", "touchcancel", "mouseup", "mouseleave"], Yt = ["mousedown", "mousemove", "mouseup", "mouseleave"];
3255
3255
  function ws(c, e, i) {
3256
- var t = new we(), n = 0, s = 0, r = 0, o = !1, a = gt ? {
3256
+ var t = new we(), n = 0, s = 0, r = 0, o = !1, a = mt ? {
3257
3257
  passive: !0
3258
- } : !1, d = {
3258
+ } : !1, u = {
3259
3259
  /**
3260
3260
  * Initializes swipe bindings.
3261
3261
  *
@@ -3284,9 +3284,9 @@ function ws(c, e, i) {
3284
3284
  */
3285
3285
  move: function(l) {
3286
3286
  if (!c.disabled) {
3287
- var h = c.settings, p = h.touchAngle, b = h.touchRatio, w = h.classes, _ = this.touches(l), g = Q(_.pageX) - s, v = Q(_.pageY) - r, f = Math.abs(g << 2), m = Math.abs(v << 2), y = Math.sqrt(f + m), k = Math.sqrt(m);
3287
+ var h = c.settings, p = h.touchAngle, b = h.touchRatio, w = h.classes, _ = this.touches(l), m = Q(_.pageX) - s, v = Q(_.pageY) - r, f = Math.abs(m << 2), g = Math.abs(v << 2), y = Math.sqrt(f + g), k = Math.sqrt(g);
3288
3288
  if (n = Math.asin(k / y), n * 180 / Math.PI < p)
3289
- l.stopPropagation(), e.Move.make(g * Yi(b)), e.Html.root.classList.add(w.dragging), i.emit("swipe.move");
3289
+ l.stopPropagation(), e.Move.make(m * Yi(b)), e.Html.root.classList.add(w.dragging), i.emit("swipe.move");
3290
3290
  else
3291
3291
  return !1;
3292
3292
  }
@@ -3299,8 +3299,8 @@ function ws(c, e, i) {
3299
3299
  */
3300
3300
  end: function(l) {
3301
3301
  if (!c.disabled) {
3302
- var h = c.settings, p = h.perSwipe, b = h.touchAngle, w = h.classes, _ = this.touches(l), g = this.threshold(l), v = _.pageX - s, f = n * 180 / Math.PI;
3303
- this.enable(), v > g && f < b ? e.Run.make(e.Direction.resolve("".concat(p, "<"))) : v < -g && f < b ? e.Run.make(e.Direction.resolve("".concat(p, ">"))) : e.Move.make(), e.Html.root.classList.remove(w.dragging), this.unbindSwipeMove(), this.unbindSwipeEnd(), i.emit("swipe.end");
3302
+ var h = c.settings, p = h.perSwipe, b = h.touchAngle, w = h.classes, _ = this.touches(l), m = this.threshold(l), v = _.pageX - s, f = n * 180 / Math.PI;
3303
+ this.enable(), v > m && f < b ? e.Run.make(e.Direction.resolve("".concat(p, "<"))) : v < -m && f < b ? e.Run.make(e.Direction.resolve("".concat(p, ">"))) : e.Move.make(), e.Html.root.classList.remove(w.dragging), this.unbindSwipeMove(), this.unbindSwipeEnd(), i.emit("swipe.end");
3304
3304
  }
3305
3305
  },
3306
3306
  /**
@@ -3399,8 +3399,8 @@ function ws(c, e, i) {
3399
3399
  return i.on("build.after", function() {
3400
3400
  e.Html.root.classList.add(c.settings.classes.swipeable);
3401
3401
  }), i.on("destroy", function() {
3402
- d.unbindSwipeStart(), d.unbindSwipeMove(), d.unbindSwipeEnd(), t.destroy();
3403
- }), d;
3402
+ u.unbindSwipeStart(), u.unbindSwipeMove(), u.unbindSwipeEnd(), t.destroy();
3403
+ }), u;
3404
3404
  }
3405
3405
  function xs(c, e, i) {
3406
3406
  var t = new we(), n = {
@@ -3524,7 +3524,7 @@ function ks(c, e, i) {
3524
3524
  }
3525
3525
  var _s = '[data-glide-el="controls[nav]"]', vt = '[data-glide-el^="controls"]', Ss = "".concat(vt, ' [data-glide-dir*="<"]'), Ts = "".concat(vt, ' [data-glide-dir*=">"]');
3526
3526
  function Es(c, e, i) {
3527
- var t = new we(), n = gt ? {
3527
+ var t = new we(), n = mt ? {
3528
3528
  passive: !0
3529
3529
  } : !1, s = {
3530
3530
  /**
@@ -3564,9 +3564,9 @@ function Es(c, e, i) {
3564
3564
  * @return {Void}
3565
3565
  */
3566
3566
  addClass: function(o) {
3567
- var a = c.settings, d = o[c.index];
3568
- d && (d.classList.add(a.classes.nav.active), ri(d).forEach(function(u) {
3569
- u.classList.remove(a.classes.nav.active);
3567
+ var a = c.settings, u = o[c.index];
3568
+ u && (u.classList.add(a.classes.nav.active), ri(u).forEach(function(d) {
3569
+ d.classList.remove(a.classes.nav.active);
3570
3570
  }));
3571
3571
  },
3572
3572
  /**
@@ -3594,9 +3594,9 @@ function Es(c, e, i) {
3594
3594
  * @param {NodeList[]} lists
3595
3595
  */
3596
3596
  resetArrowState: function() {
3597
- for (var o = c.settings, a = arguments.length, d = new Array(a), u = 0; u < a; u++)
3598
- d[u] = arguments[u];
3599
- d.forEach(function(l) {
3597
+ for (var o = c.settings, a = arguments.length, u = new Array(a), d = 0; d < a; d++)
3598
+ u[d] = arguments[d];
3599
+ u.forEach(function(l) {
3600
3600
  ft(l).forEach(function(h) {
3601
3601
  h.classList.remove(o.classes.arrow.disabled);
3602
3602
  });
@@ -3608,9 +3608,9 @@ function Es(c, e, i) {
3608
3608
  * @param {NodeList[]} lists
3609
3609
  */
3610
3610
  disableArrow: function() {
3611
- for (var o = c.settings, a = arguments.length, d = new Array(a), u = 0; u < a; u++)
3612
- d[u] = arguments[u];
3613
- d.forEach(function(l) {
3611
+ for (var o = c.settings, a = arguments.length, u = new Array(a), d = 0; d < a; d++)
3612
+ u[d] = arguments[d];
3613
+ u.forEach(function(l) {
3614
3614
  ft(l).forEach(function(h) {
3615
3615
  h.classList.add(o.classes.arrow.disabled);
3616
3616
  });
@@ -3663,7 +3663,7 @@ function Es(c, e, i) {
3663
3663
  * @return {void}
3664
3664
  */
3665
3665
  click: function(o) {
3666
- !gt && o.type === "touchstart" && o.preventDefault();
3666
+ !mt && o.type === "touchstart" && o.preventDefault();
3667
3667
  var a = o.currentTarget.getAttribute("data-glide-dir");
3668
3668
  e.Run.make(e.Direction.resolve(a));
3669
3669
  }
@@ -3829,7 +3829,7 @@ function Cs(c, e, i) {
3829
3829
  }), n;
3830
3830
  }
3831
3831
  function Xt(c) {
3832
- return Ae(c) ? Ji(c) : (me("Breakpoints option must be an object"), {});
3832
+ return Ae(c) ? Ji(c) : (ge("Breakpoints option must be an object"), {});
3833
3833
  }
3834
3834
  function Rs(c, e, i) {
3835
3835
  var t = new we(), n = c.settings, s = Xt(n.breakpoints), r = Object.assign({}, n), o = {
@@ -3839,11 +3839,11 @@ function Rs(c, e, i) {
3839
3839
  * @param {Object} points
3840
3840
  * @returns {Object}
3841
3841
  */
3842
- match: function(d) {
3842
+ match: function(u) {
3843
3843
  if (typeof window.matchMedia < "u") {
3844
- for (var u in d)
3845
- if (d.hasOwnProperty(u) && window.matchMedia("(max-width: ".concat(u, "px)")).matches)
3846
- return d[u];
3844
+ for (var d in u)
3845
+ if (u.hasOwnProperty(d) && window.matchMedia("(max-width: ".concat(d, "px)")).matches)
3846
+ return u[d];
3847
3847
  }
3848
3848
  return r;
3849
3849
  }
@@ -4008,7 +4008,7 @@ const ie = {
4008
4008
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
4009
4009
  paragraph: B(kt).replace("hr", He).replace("heading", ` *#{1,6} *[^
4010
4010
  ]`).replace("lheading", ci).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
4011
- }, Fs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gs = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, di = /^( {2,}|\\)\n(?!\s*$)/, Vs = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, nt = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, hi = /[^\s\p{P}\p{S}]/u, Ws = B(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), pi = /(?!~)[\p{P}\p{S}]/u, Ys = /(?!~)[\s\p{P}\p{S}]/u, Xs = /(?:[^\s\p{P}\p{S}]|~)/u, Js = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, fi = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Zs = B(fi, "u").replace(/punct/g, nt).getRegex(), Qs = B(fi, "u").replace(/punct/g, pi).getRegex(), gi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ks = B(gi, "gu").replace(/notPunctSpace/g, hi).replace(/punctSpace/g, Et).replace(/punct/g, nt).getRegex(), en = B(gi, "gu").replace(/notPunctSpace/g, Xs).replace(/punctSpace/g, Ys).replace(/punct/g, pi).getRegex(), tn = B("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, hi).replace(/punctSpace/g, Et).replace(/punct/g, nt).getRegex(), sn = B(/\\(punct)/, "gu").replace(/punct/g, nt).getRegex(), nn = B(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), rn = B(St).replace("(?:-->|$)", "-->").getRegex(), on = B("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", rn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ze = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, ln = B(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ze).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), mi = B(/^!?\[(label)\]\[(ref)\]/).replace("label", Ze).replace("ref", _t).getRegex(), bi = B(/^!?\[(ref)\](?:\[\])?/).replace("ref", _t).getRegex(), an = B("reflink|nolink(?!\\()", "g").replace("reflink", mi).replace("nolink", bi).getRegex(), Lt = {
4011
+ }, Fs = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gs = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, di = /^( {2,}|\\)\n(?!\s*$)/, Vs = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, nt = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, hi = /[^\s\p{P}\p{S}]/u, Ws = B(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), pi = /(?!~)[\p{P}\p{S}]/u, Ys = /(?!~)[\s\p{P}\p{S}]/u, Xs = /(?:[^\s\p{P}\p{S}]|~)/u, Js = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, fi = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Zs = B(fi, "u").replace(/punct/g, nt).getRegex(), Qs = B(fi, "u").replace(/punct/g, pi).getRegex(), mi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ks = B(mi, "gu").replace(/notPunctSpace/g, hi).replace(/punctSpace/g, Et).replace(/punct/g, nt).getRegex(), en = B(mi, "gu").replace(/notPunctSpace/g, Xs).replace(/punctSpace/g, Ys).replace(/punct/g, pi).getRegex(), tn = B("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, hi).replace(/punctSpace/g, Et).replace(/punct/g, nt).getRegex(), sn = B(/\\(punct)/, "gu").replace(/punct/g, nt).getRegex(), nn = B(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), rn = B(St).replace("(?:-->|$)", "-->").getRegex(), on = B("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", rn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ze = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, ln = B(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ze).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), gi = B(/^!?\[(label)\]\[(ref)\]/).replace("label", Ze).replace("ref", _t).getRegex(), bi = B(/^!?\[(ref)\](?:\[\])?/).replace("ref", _t).getRegex(), an = B("reflink|nolink(?!\\()", "g").replace("reflink", gi).replace("nolink", bi).getRegex(), Lt = {
4012
4012
  _backpedal: De,
4013
4013
  // only used for GFM url
4014
4014
  anyPunctuation: sn,
@@ -4024,7 +4024,7 @@ const ie = {
4024
4024
  link: ln,
4025
4025
  nolink: bi,
4026
4026
  punctuation: Ws,
4027
- reflink: mi,
4027
+ reflink: gi,
4028
4028
  reflinkSearch: an,
4029
4029
  tag: on,
4030
4030
  text: Vs,
@@ -4033,7 +4033,7 @@ const ie = {
4033
4033
  ...Lt,
4034
4034
  link: B(/^!?\[(label)\]\((.*?)\)/).replace("label", Ze).getRegex(),
4035
4035
  reflink: B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ze).getRegex()
4036
- }, mt = {
4036
+ }, gt = {
4037
4037
  ...Lt,
4038
4038
  emStrongRDelimAst: en,
4039
4039
  emStrongLDelim: Qs,
@@ -4042,16 +4042,16 @@ const ie = {
4042
4042
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
4043
4043
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
4044
4044
  }, un = {
4045
- ...mt,
4045
+ ...gt,
4046
4046
  br: B(di).replace("{2,}", "*").getRegex(),
4047
- text: B(mt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
4047
+ text: B(gt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
4048
4048
  }, Be = {
4049
4049
  normal: Tt,
4050
4050
  gfm: js,
4051
4051
  pedantic: Bs
4052
4052
  }, $e = {
4053
4053
  normal: Lt,
4054
- gfm: mt,
4054
+ gfm: gt,
4055
4055
  breaks: un,
4056
4056
  pedantic: cn
4057
4057
  }, dn = {
@@ -4079,8 +4079,8 @@ function Qt(c) {
4079
4079
  }
4080
4080
  function Kt(c, e) {
4081
4081
  const i = c.replace(ie.findPipe, (s, r, o) => {
4082
- let a = !1, d = r;
4083
- for (; --d >= 0 && o[d] === "\\"; )
4082
+ let a = !1, u = r;
4083
+ for (; --u >= 0 && o[u] === "\\"; )
4084
4084
  a = !a;
4085
4085
  return a ? "|" : " |";
4086
4086
  }), t = i.split(ie.splitPipe);
@@ -4223,20 +4223,20 @@ class Qe {
4223
4223
  for (; t.length > 0; ) {
4224
4224
  let o = !1;
4225
4225
  const a = [];
4226
- let d;
4227
- for (d = 0; d < t.length; d++)
4228
- if (this.rules.other.blockquoteStart.test(t[d]))
4229
- a.push(t[d]), o = !0;
4226
+ let u;
4227
+ for (u = 0; u < t.length; u++)
4228
+ if (this.rules.other.blockquoteStart.test(t[u]))
4229
+ a.push(t[u]), o = !0;
4230
4230
  else if (!o)
4231
- a.push(t[d]);
4231
+ a.push(t[u]);
4232
4232
  else
4233
4233
  break;
4234
- t = t.slice(d);
4235
- const u = a.join(`
4236
- `), l = u.replace(this.rules.other.blockquoteSetextReplace, `
4234
+ t = t.slice(u);
4235
+ const d = a.join(`
4236
+ `), l = d.replace(this.rules.other.blockquoteSetextReplace, `
4237
4237
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
4238
4238
  n = n ? `${n}
4239
- ${u}` : u, s = s ? `${s}
4239
+ ${d}` : d, s = s ? `${s}
4240
4240
  ${l}` : l;
4241
4241
  const h = this.lexer.state.top;
4242
4242
  if (this.lexer.state.top = !0, this.lexer.blockTokens(l, r, !0), this.lexer.state.top = h, t.length === 0)
@@ -4283,46 +4283,46 @@ ${l}` : l;
4283
4283
  const r = this.rules.other.listItemRegex(t);
4284
4284
  let o = !1;
4285
4285
  for (; e; ) {
4286
- let d = !1, u = "", l = "";
4286
+ let u = !1, d = "", l = "";
4287
4287
  if (!(i = r.exec(e)) || this.rules.block.hr.test(e))
4288
4288
  break;
4289
- u = i[0], e = e.substring(u.length);
4289
+ d = i[0], e = e.substring(d.length);
4290
4290
  let h = i[2].split(`
4291
4291
  `, 1)[0].replace(this.rules.other.listReplaceTabs, (v) => " ".repeat(3 * v.length)), p = e.split(`
4292
4292
  `, 1)[0], b = !h.trim(), w = 0;
4293
- if (this.options.pedantic ? (w = 2, l = h.trimStart()) : b ? w = i[1].length + 1 : (w = i[2].search(this.rules.other.nonSpaceChar), w = w > 4 ? 1 : w, l = h.slice(w), w += i[1].length), b && this.rules.other.blankLine.test(p) && (u += p + `
4294
- `, e = e.substring(p.length + 1), d = !0), !d) {
4295
- const v = this.rules.other.nextBulletRegex(w), f = this.rules.other.hrRegex(w), m = this.rules.other.fencesBeginRegex(w), y = this.rules.other.headingBeginRegex(w), k = this.rules.other.htmlBeginRegex(w);
4293
+ if (this.options.pedantic ? (w = 2, l = h.trimStart()) : b ? w = i[1].length + 1 : (w = i[2].search(this.rules.other.nonSpaceChar), w = w > 4 ? 1 : w, l = h.slice(w), w += i[1].length), b && this.rules.other.blankLine.test(p) && (d += p + `
4294
+ `, e = e.substring(p.length + 1), u = !0), !u) {
4295
+ const v = this.rules.other.nextBulletRegex(w), f = this.rules.other.hrRegex(w), g = this.rules.other.fencesBeginRegex(w), y = this.rules.other.headingBeginRegex(w), k = this.rules.other.htmlBeginRegex(w);
4296
4296
  for (; e; ) {
4297
4297
  const x = e.split(`
4298
4298
  `, 1)[0];
4299
4299
  let S;
4300
- if (p = x, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), S = p) : S = p.replace(this.rules.other.tabCharGlobal, " "), m.test(p) || y.test(p) || k.test(p) || v.test(p) || f.test(p))
4300
+ if (p = x, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), S = p) : S = p.replace(this.rules.other.tabCharGlobal, " "), g.test(p) || y.test(p) || k.test(p) || v.test(p) || f.test(p))
4301
4301
  break;
4302
4302
  if (S.search(this.rules.other.nonSpaceChar) >= w || !p.trim())
4303
4303
  l += `
4304
4304
  ` + S.slice(w);
4305
4305
  else {
4306
- if (b || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || m.test(h) || y.test(h) || f.test(h))
4306
+ if (b || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || g.test(h) || y.test(h) || f.test(h))
4307
4307
  break;
4308
4308
  l += `
4309
4309
  ` + p;
4310
4310
  }
4311
- !b && !p.trim() && (b = !0), u += x + `
4311
+ !b && !p.trim() && (b = !0), d += x + `
4312
4312
  `, e = e.substring(x.length + 1), h = S.slice(w);
4313
4313
  }
4314
4314
  }
4315
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (o = !0));
4316
- let _ = null, g;
4317
- this.options.gfm && (_ = this.rules.other.listIsTask.exec(l), _ && (g = _[0] !== "[ ] ", l = l.replace(this.rules.other.listReplaceTask, ""))), s.items.push({
4315
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(d) && (o = !0));
4316
+ let _ = null, m;
4317
+ this.options.gfm && (_ = this.rules.other.listIsTask.exec(l), _ && (m = _[0] !== "[ ] ", l = l.replace(this.rules.other.listReplaceTask, ""))), s.items.push({
4318
4318
  type: "list_item",
4319
- raw: u,
4319
+ raw: d,
4320
4320
  task: !!_,
4321
- checked: g,
4321
+ checked: m,
4322
4322
  loose: !1,
4323
4323
  text: l,
4324
4324
  tokens: []
4325
- }), s.raw += u;
4325
+ }), s.raw += d;
4326
4326
  }
4327
4327
  const a = s.items.at(-1);
4328
4328
  if (a)
@@ -4330,14 +4330,14 @@ ${l}` : l;
4330
4330
  else
4331
4331
  return;
4332
4332
  s.raw = s.raw.trimEnd();
4333
- for (let d = 0; d < s.items.length; d++)
4334
- if (this.lexer.state.top = !1, s.items[d].tokens = this.lexer.blockTokens(s.items[d].text, []), !s.loose) {
4335
- const u = s.items[d].tokens.filter((h) => h.type === "space"), l = u.length > 0 && u.some((h) => this.rules.other.anyLine.test(h.raw));
4333
+ for (let u = 0; u < s.items.length; u++)
4334
+ if (this.lexer.state.top = !1, s.items[u].tokens = this.lexer.blockTokens(s.items[u].text, []), !s.loose) {
4335
+ const d = s.items[u].tokens.filter((h) => h.type === "space"), l = d.length > 0 && d.some((h) => this.rules.other.anyLine.test(h.raw));
4336
4336
  s.loose = l;
4337
4337
  }
4338
4338
  if (s.loose)
4339
- for (let d = 0; d < s.items.length; d++)
4340
- s.items[d].loose = !0;
4339
+ for (let u = 0; u < s.items.length; u++)
4340
+ s.items[u].loose = !0;
4341
4341
  return s;
4342
4342
  }
4343
4343
  }
@@ -4388,11 +4388,11 @@ ${l}` : l;
4388
4388
  align: r.align[o]
4389
4389
  });
4390
4390
  for (const o of s)
4391
- r.rows.push(Kt(o, r.header.length).map((a, d) => ({
4391
+ r.rows.push(Kt(o, r.header.length).map((a, u) => ({
4392
4392
  text: a,
4393
4393
  tokens: this.lexer.inline(a),
4394
4394
  header: !1,
4395
- align: r.align[d]
4395
+ align: r.align[u]
4396
4396
  })));
4397
4397
  return r;
4398
4398
  }
@@ -4504,21 +4504,21 @@ ${l}` : l;
4504
4504
  return;
4505
4505
  if (!(n[1] || n[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
4506
4506
  const r = [...n[0]].length - 1;
4507
- let o, a, d = r, u = 0;
4507
+ let o, a, u = r, d = 0;
4508
4508
  const l = n[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
4509
4509
  for (l.lastIndex = 0, i = i.slice(-1 * e.length + r); (n = l.exec(i)) != null; ) {
4510
4510
  if (o = n[1] || n[2] || n[3] || n[4] || n[5] || n[6], !o)
4511
4511
  continue;
4512
4512
  if (a = [...o].length, n[3] || n[4]) {
4513
- d += a;
4513
+ u += a;
4514
4514
  continue;
4515
4515
  } else if ((n[5] || n[6]) && r % 3 && !((r + a) % 3)) {
4516
- u += a;
4516
+ d += a;
4517
4517
  continue;
4518
4518
  }
4519
- if (d -= a, d > 0)
4519
+ if (u -= a, u > 0)
4520
4520
  continue;
4521
- a = Math.min(a, a + d + u);
4521
+ a = Math.min(a, a + u + d);
4522
4522
  const h = [...n[0]][0].length, p = e.slice(0, r + n.index + h + a);
4523
4523
  if (Math.min(r, a) % 2) {
4524
4524
  const w = p.slice(1, -1);
@@ -4749,8 +4749,8 @@ class le {
4749
4749
  let r = 1 / 0;
4750
4750
  const o = e.slice(1);
4751
4751
  let a;
4752
- this.options.extensions.startBlock.forEach((d) => {
4753
- a = d.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (r = Math.min(r, a));
4752
+ this.options.extensions.startBlock.forEach((u) => {
4753
+ a = u.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (r = Math.min(r, a));
4754
4754
  }), r < 1 / 0 && r >= 0 && (s = e.substring(0, r + 1));
4755
4755
  }
4756
4756
  if (this.state.top && (n = this.tokenizer.paragraph(s))) {
@@ -4801,7 +4801,7 @@ class le {
4801
4801
  for (; e; ) {
4802
4802
  s || (r = ""), s = !1;
4803
4803
  let o;
4804
- if (this.options.extensions?.inline?.some((d) => (o = d.call({ lexer: this }, e, i)) ? (e = e.substring(o.raw.length), i.push(o), !0) : !1))
4804
+ if (this.options.extensions?.inline?.some((u) => (o = u.call({ lexer: this }, e, i)) ? (e = e.substring(o.raw.length), i.push(o), !0) : !1))
4805
4805
  continue;
4806
4806
  if (o = this.tokenizer.escape(e)) {
4807
4807
  e = e.substring(o.raw.length), i.push(o);
@@ -4817,8 +4817,8 @@ class le {
4817
4817
  }
4818
4818
  if (o = this.tokenizer.reflink(e, this.tokens.links)) {
4819
4819
  e = e.substring(o.raw.length);
4820
- const d = i.at(-1);
4821
- o.type === "text" && d?.type === "text" ? (d.raw += o.raw, d.text += o.text) : i.push(o);
4820
+ const u = i.at(-1);
4821
+ o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : i.push(o);
4822
4822
  continue;
4823
4823
  }
4824
4824
  if (o = this.tokenizer.emStrong(e, t, r)) {
@@ -4847,26 +4847,26 @@ class le {
4847
4847
  }
4848
4848
  let a = e;
4849
4849
  if (this.options.extensions?.startInline) {
4850
- let d = 1 / 0;
4851
- const u = e.slice(1);
4850
+ let u = 1 / 0;
4851
+ const d = e.slice(1);
4852
4852
  let l;
4853
4853
  this.options.extensions.startInline.forEach((h) => {
4854
- l = h.call({ lexer: this }, u), typeof l == "number" && l >= 0 && (d = Math.min(d, l));
4855
- }), d < 1 / 0 && d >= 0 && (a = e.substring(0, d + 1));
4854
+ l = h.call({ lexer: this }, d), typeof l == "number" && l >= 0 && (u = Math.min(u, l));
4855
+ }), u < 1 / 0 && u >= 0 && (a = e.substring(0, u + 1));
4856
4856
  }
4857
4857
  if (o = this.tokenizer.inlineText(a)) {
4858
4858
  e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (r = o.raw.slice(-1)), s = !0;
4859
- const d = i.at(-1);
4860
- d?.type === "text" ? (d.raw += o.raw, d.text += o.text) : i.push(o);
4859
+ const u = i.at(-1);
4860
+ u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : i.push(o);
4861
4861
  continue;
4862
4862
  }
4863
4863
  if (e) {
4864
- const d = "Infinite loop on byte: " + e.charCodeAt(0);
4864
+ const u = "Infinite loop on byte: " + e.charCodeAt(0);
4865
4865
  if (this.options.silent) {
4866
- console.error(d);
4866
+ console.error(u);
4867
4867
  break;
4868
4868
  } else
4869
- throw new Error(d);
4869
+ throw new Error(u);
4870
4870
  }
4871
4871
  }
4872
4872
  return i;
@@ -5312,10 +5312,10 @@ class fn {
5312
5312
  throw new Error(`renderer '${r}' does not exist`);
5313
5313
  if (["options", "parser"].includes(r))
5314
5314
  continue;
5315
- const o = r, a = t.renderer[o], d = s[o];
5316
- s[o] = (...u) => {
5317
- let l = a.apply(s, u);
5318
- return l === !1 && (l = d.apply(s, u)), l || "";
5315
+ const o = r, a = t.renderer[o], u = s[o];
5316
+ s[o] = (...d) => {
5317
+ let l = a.apply(s, d);
5318
+ return l === !1 && (l = u.apply(s, d)), l || "";
5319
5319
  };
5320
5320
  }
5321
5321
  n.renderer = s;
@@ -5327,10 +5327,10 @@ class fn {
5327
5327
  throw new Error(`tokenizer '${r}' does not exist`);
5328
5328
  if (["options", "rules", "lexer"].includes(r))
5329
5329
  continue;
5330
- const o = r, a = t.tokenizer[o], d = s[o];
5331
- s[o] = (...u) => {
5332
- let l = a.apply(s, u);
5333
- return l === !1 && (l = d.apply(s, u)), l;
5330
+ const o = r, a = t.tokenizer[o], u = s[o];
5331
+ s[o] = (...d) => {
5332
+ let l = a.apply(s, d);
5333
+ return l === !1 && (l = u.apply(s, d)), l;
5334
5334
  };
5335
5335
  }
5336
5336
  n.tokenizer = s;
@@ -5342,15 +5342,15 @@ class fn {
5342
5342
  throw new Error(`hook '${r}' does not exist`);
5343
5343
  if (["options", "block"].includes(r))
5344
5344
  continue;
5345
- const o = r, a = t.hooks[o], d = s[o];
5346
- Ye.passThroughHooks.has(r) ? s[o] = (u) => {
5345
+ const o = r, a = t.hooks[o], u = s[o];
5346
+ Ye.passThroughHooks.has(r) ? s[o] = (d) => {
5347
5347
  if (this.defaults.async)
5348
- return Promise.resolve(a.call(s, u)).then((h) => d.call(s, h));
5349
- const l = a.call(s, u);
5350
- return d.call(s, l);
5351
- } : s[o] = (...u) => {
5352
- let l = a.apply(s, u);
5353
- return l === !1 && (l = d.apply(s, u)), l;
5348
+ return Promise.resolve(a.call(s, d)).then((h) => u.call(s, h));
5349
+ const l = a.call(s, d);
5350
+ return u.call(s, l);
5351
+ } : s[o] = (...d) => {
5352
+ let l = a.apply(s, d);
5353
+ return l === !1 && (l = u.apply(s, d)), l;
5354
5354
  };
5355
5355
  }
5356
5356
  n.hooks = s;
@@ -5384,17 +5384,17 @@ class fn {
5384
5384
  if (typeof t != "string")
5385
5385
  return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
5386
5386
  r.hooks && (r.hooks.options = r, r.hooks.block = e);
5387
- const a = r.hooks ? r.hooks.provideLexer() : e ? le.lex : le.lexInline, d = r.hooks ? r.hooks.provideParser() : e ? ae.parse : ae.parseInline;
5387
+ const a = r.hooks ? r.hooks.provideLexer() : e ? le.lex : le.lexInline, u = r.hooks ? r.hooks.provideParser() : e ? ae.parse : ae.parseInline;
5388
5388
  if (r.async)
5389
- return Promise.resolve(r.hooks ? r.hooks.preprocess(t) : t).then((u) => a(u, r)).then((u) => r.hooks ? r.hooks.processAllTokens(u) : u).then((u) => r.walkTokens ? Promise.all(this.walkTokens(u, r.walkTokens)).then(() => u) : u).then((u) => d(u, r)).then((u) => r.hooks ? r.hooks.postprocess(u) : u).catch(o);
5389
+ return Promise.resolve(r.hooks ? r.hooks.preprocess(t) : t).then((d) => a(d, r)).then((d) => r.hooks ? r.hooks.processAllTokens(d) : d).then((d) => r.walkTokens ? Promise.all(this.walkTokens(d, r.walkTokens)).then(() => d) : d).then((d) => u(d, r)).then((d) => r.hooks ? r.hooks.postprocess(d) : d).catch(o);
5390
5390
  try {
5391
5391
  r.hooks && (t = r.hooks.preprocess(t));
5392
- let u = a(t, r);
5393
- r.hooks && (u = r.hooks.processAllTokens(u)), r.walkTokens && this.walkTokens(u, r.walkTokens);
5394
- let l = d(u, r);
5392
+ let d = a(t, r);
5393
+ r.hooks && (d = r.hooks.processAllTokens(d)), r.walkTokens && this.walkTokens(d, r.walkTokens);
5394
+ let l = u(d, r);
5395
5395
  return r.hooks && (l = r.hooks.postprocess(l)), l;
5396
- } catch (u) {
5397
- return o(u);
5396
+ } catch (d) {
5397
+ return o(d);
5398
5398
  }
5399
5399
  };
5400
5400
  }
@@ -5443,7 +5443,7 @@ z.walkTokens;
5443
5443
  z.parseInline;
5444
5444
  ae.parse;
5445
5445
  le.lex;
5446
- class gn {
5446
+ class mn {
5447
5447
  constructor(e = {}, i) {
5448
5448
  const t = {
5449
5449
  lang: []
@@ -5453,7 +5453,7 @@ class gn {
5453
5453
  async checkIntent(e, i, t) {
5454
5454
  let n = "You are an assistant", s = "", r = `This is the user's request:
5455
5455
 
5456
- ${e}`, o, a, d;
5456
+ ${e}`, o, a, u;
5457
5457
  if (t.image && i === "openai")
5458
5458
  return r += `
5459
5459
  Extract some information.
@@ -5498,7 +5498,7 @@ Extract some information.
5498
5498
  },
5499
5499
  required: []
5500
5500
  }
5501
- }], a = await this.builder.send(r, s, n, "", o), a ? (d = JSON.parse(a), d) : !1;
5501
+ }], a = await this.builder.send(r, s, n, "", o), a ? (u = JSON.parse(a), u) : !1;
5502
5502
  if (t.image) {
5503
5503
  if (r += `
5504
5504
 
@@ -5560,7 +5560,7 @@ Check the type of the request:
5560
5560
  }
5561
5561
  }], a = await this.builder.send(r, s, n, "", o), !a)
5562
5562
  return !1;
5563
- d = JSON.parse(a);
5563
+ u = JSON.parse(a);
5564
5564
  } else if (t.video) {
5565
5565
  if (r += `
5566
5566
 
@@ -5588,7 +5588,7 @@ Check the type of the request:
5588
5588
  }
5589
5589
  }], a = await this.builder.send(r, s, n, "", o), !a)
5590
5590
  return !1;
5591
- d = JSON.parse(a);
5591
+ u = JSON.parse(a);
5592
5592
  } else if (t.audio) {
5593
5593
  if (r += `
5594
5594
 
@@ -5610,9 +5610,9 @@ Check the type of the request:
5610
5610
  }
5611
5611
  }], a = await this.builder.send(r, s, n, "", o), !a)
5612
5612
  return !1;
5613
- d = JSON.parse(a);
5613
+ u = JSON.parse(a);
5614
5614
  }
5615
- return this.builder.settings.consoleLog && console.log(d), this.extractInfo(d, i, e);
5615
+ return this.builder.settings.consoleLog && console.log(u), this.extractInfo(u, i, e);
5616
5616
  }
5617
5617
  async extractInfo(e, i, t) {
5618
5618
  const n = this.builder.settings.defaultModels;
@@ -5627,7 +5627,7 @@ ${t}
5627
5627
 
5628
5628
  Check the request and return the details.
5629
5629
  `;
5630
- let d = [{
5630
+ let u = [{
5631
5631
  name: "check_request",
5632
5632
  description: "Check user request.",
5633
5633
  parameters: {
@@ -5722,10 +5722,10 @@ Check the request and return the details.
5722
5722
  // 'prompt'
5723
5723
  ]
5724
5724
  }
5725
- }], u = await this.builder.send(a, o, s, "", d);
5726
- if (!u)
5725
+ }], d = await this.builder.send(a, o, s, "", u);
5726
+ if (!d)
5727
5727
  return !1;
5728
- let l = JSON.parse(u);
5728
+ let l = JSON.parse(d);
5729
5729
  return {
5730
5730
  ...e,
5731
5731
  ...l
@@ -5741,7 +5741,7 @@ ${t}
5741
5741
 
5742
5742
  Check the request and return the details.
5743
5743
  `;
5744
- let d = [{
5744
+ let u = [{
5745
5745
  name: "check_request",
5746
5746
  description: "Check user request.",
5747
5747
  parameters: {
@@ -5768,10 +5768,10 @@ Check the request and return the details.
5768
5768
  // 'image_url'
5769
5769
  ]
5770
5770
  }
5771
- }], u = await this.builder.send(a, o, s, "", d);
5772
- if (!u)
5771
+ }], d = await this.builder.send(a, o, s, "", u);
5772
+ if (!d)
5773
5773
  return !1;
5774
- let l = JSON.parse(u);
5774
+ let l = JSON.parse(d);
5775
5775
  return {
5776
5776
  ...e,
5777
5777
  ...l
@@ -5787,7 +5787,7 @@ Thie is the list of models:
5787
5787
  ${t}
5788
5788
 
5789
5789
  Check the request and return the details.
5790
- `, d = [{
5790
+ `, u = [{
5791
5791
  name: "check_request",
5792
5792
  description: "Check user request.",
5793
5793
  parameters: {
@@ -5810,10 +5810,10 @@ Check the request and return the details.
5810
5810
  // 'prompt'
5811
5811
  ]
5812
5812
  }
5813
- }], u = await this.builder.send(a, o, s, "", d);
5814
- if (!u)
5813
+ }], d = await this.builder.send(a, o, s, "", u);
5814
+ if (!d)
5815
5815
  return !1;
5816
- let l = JSON.parse(u);
5816
+ let l = JSON.parse(d);
5817
5817
  return {
5818
5818
  ...e,
5819
5819
  ...l
@@ -5837,13 +5837,13 @@ Check the request and return the details.
5837
5837
  },
5838
5838
  required: ["image_url"]
5839
5839
  }
5840
- }], d = await this.builder.send(o, r, s, "", a);
5841
- if (!d)
5840
+ }], u = await this.builder.send(o, r, s, "", a);
5841
+ if (!u)
5842
5842
  return !1;
5843
- let u = JSON.parse(d);
5843
+ let d = JSON.parse(u);
5844
5844
  return {
5845
5845
  ...e,
5846
- ...u
5846
+ ...d
5847
5847
  };
5848
5848
  } else if (e.upscale_image) {
5849
5849
  const s = "You are an assistant", o = `
@@ -5856,7 +5856,7 @@ Thie is the list of models:
5856
5856
  ${t}
5857
5857
 
5858
5858
  Check the request and return the details.
5859
- `, d = [{
5859
+ `, u = [{
5860
5860
  name: "check_request",
5861
5861
  description: "Check user request.",
5862
5862
  parameters: {
@@ -5875,10 +5875,10 @@ Check the request and return the details.
5875
5875
  // 'image_url'
5876
5876
  ]
5877
5877
  }
5878
- }], u = await this.builder.send(a, o, s, "", d);
5879
- if (!u)
5878
+ }], d = await this.builder.send(a, o, s, "", u);
5879
+ if (!d)
5880
5880
  return !1;
5881
- let l = JSON.parse(u);
5881
+ let l = JSON.parse(d);
5882
5882
  return {
5883
5883
  ...e,
5884
5884
  ...l
@@ -5894,7 +5894,7 @@ Thie is the list of models:
5894
5894
  ${t}
5895
5895
 
5896
5896
  Check the request and return the details.
5897
- `, d = [{
5897
+ `, u = [{
5898
5898
  name: "check_request",
5899
5899
  description: "Check user request.",
5900
5900
  parameters: {
@@ -5915,10 +5915,10 @@ Check the request and return the details.
5915
5915
  },
5916
5916
  required: ["image_url", "prompt"]
5917
5917
  }
5918
- }], u = await this.builder.send(a, o, s, "", d);
5919
- if (!u)
5918
+ }], d = await this.builder.send(a, o, s, "", u);
5919
+ if (!d)
5920
5920
  return !1;
5921
- let l = JSON.parse(u);
5921
+ let l = JSON.parse(d);
5922
5922
  return {
5923
5923
  ...e,
5924
5924
  ...l
@@ -5936,7 +5936,7 @@ Thie is the list of models:
5936
5936
  ${t}
5937
5937
 
5938
5938
  Check the request and return the details.
5939
- `, d = [{
5939
+ `, u = [{
5940
5940
  name: "check_request",
5941
5941
  description: "Check user request.",
5942
5942
  parameters: {
@@ -5963,10 +5963,10 @@ Check the request and return the details.
5963
5963
  // 'image_url'
5964
5964
  ]
5965
5965
  }
5966
- }], u = await this.builder.send(a, o, s, "", d);
5967
- if (!u)
5966
+ }], d = await this.builder.send(a, o, s, "", u);
5967
+ if (!d)
5968
5968
  return !1;
5969
- let l = JSON.parse(u);
5969
+ let l = JSON.parse(d);
5970
5970
  return {
5971
5971
  ...e,
5972
5972
  ...l
@@ -5982,7 +5982,7 @@ Thie is the list of models:
5982
5982
  ${t}
5983
5983
 
5984
5984
  Check the request and return the details.
5985
- `, d = [{
5985
+ `, u = [{
5986
5986
  name: "check_request",
5987
5987
  description: "Check user request.",
5988
5988
  parameters: {
@@ -6085,10 +6085,10 @@ Check the request and return the details.
6085
6085
  // 'prompt'
6086
6086
  ]
6087
6087
  }
6088
- }], u = await this.builder.send(a, o, s, "", d);
6089
- if (!u)
6088
+ }], d = await this.builder.send(a, o, s, "", u);
6089
+ if (!d)
6090
6090
  return !1;
6091
- let l = JSON.parse(u);
6091
+ let l = JSON.parse(d);
6092
6092
  return {
6093
6093
  ...e,
6094
6094
  ...l
@@ -6104,7 +6104,7 @@ Thie is the list of models:
6104
6104
  ${t}
6105
6105
 
6106
6106
  Check the request and return the details.
6107
- `, d = [{
6107
+ `, u = [{
6108
6108
  name: "check_request",
6109
6109
  description: "Check user request.",
6110
6110
  parameters: {
@@ -6207,10 +6207,10 @@ Check the request and return the details.
6207
6207
  // 'prompt'
6208
6208
  ]
6209
6209
  }
6210
- }], u = await this.builder.send(a, o, s, "", d);
6211
- if (!u)
6210
+ }], d = await this.builder.send(a, o, s, "", u);
6211
+ if (!d)
6212
6212
  return !1;
6213
- let l = JSON.parse(u);
6213
+ let l = JSON.parse(d);
6214
6214
  return {
6215
6215
  ...e,
6216
6216
  ...l
@@ -6226,7 +6226,7 @@ Thie is the list of models:
6226
6226
  ${t}
6227
6227
 
6228
6228
  Check the request and return the details.
6229
- `, d = [{
6229
+ `, u = [{
6230
6230
  name: "check_request",
6231
6231
  description: "Check user request.",
6232
6232
  parameters: {
@@ -6325,10 +6325,10 @@ Check the request and return the details.
6325
6325
  // 'prompt'
6326
6326
  ]
6327
6327
  }
6328
- }], u = await this.builder.send(a, o, s, "", d);
6329
- if (!u)
6328
+ }], d = await this.builder.send(a, o, s, "", u);
6329
+ if (!d)
6330
6330
  return !1;
6331
- let l = JSON.parse(u);
6331
+ let l = JSON.parse(d);
6332
6332
  return {
6333
6333
  ...e,
6334
6334
  ...l
@@ -6344,7 +6344,7 @@ Thie is the list of models:
6344
6344
  ${t}
6345
6345
 
6346
6346
  Check the request and return the details.
6347
- `, d = [{
6347
+ `, u = [{
6348
6348
  name: "check_request",
6349
6349
  description: "Check user request.",
6350
6350
  parameters: {
@@ -6369,10 +6369,10 @@ Check the request and return the details.
6369
6369
  },
6370
6370
  required: ["text"]
6371
6371
  }
6372
- }], u = await this.builder.send(a, o, s, "", d);
6373
- if (!u)
6372
+ }], d = await this.builder.send(a, o, s, "", u);
6373
+ if (!d)
6374
6374
  return !1;
6375
- let l = JSON.parse(u);
6375
+ let l = JSON.parse(d);
6376
6376
  return {
6377
6377
  ...e,
6378
6378
  ...l
@@ -6452,14 +6452,14 @@ Check the information and return the details.
6452
6452
  headers: a,
6453
6453
  body: JSON.stringify(e)
6454
6454
  });
6455
- let d = await s.text();
6455
+ let u = await s.text();
6456
6456
  try {
6457
- r = JSON.parse(d);
6457
+ r = JSON.parse(u);
6458
6458
  } catch {
6459
6459
  return {
6460
6460
  mediaGenerated: !1,
6461
6461
  status: "error",
6462
- message: d
6462
+ message: u
6463
6463
  };
6464
6464
  }
6465
6465
  if (this.builder.output.push(r), r.error)
@@ -6470,33 +6470,33 @@ Check the information and return the details.
6470
6470
  //this.out('Request failed.')
6471
6471
  };
6472
6472
  {
6473
- const u = r.data;
6473
+ const d = r.data;
6474
6474
  let l = "", h = "", p, b = !1, w = [], _ = [];
6475
- return u.entries && u.entries.forEach((g) => {
6476
- p = g.url.split(".").pop().toLowerCase(), p === "mp4" ? (l += `
6475
+ return d.entries && d.entries.forEach((m) => {
6476
+ p = m.url.split(".").pop().toLowerCase(), p === "mp4" ? (l += `
6477
6477
  <p class="responsive-video">
6478
6478
  <video controls>
6479
- <source src="${g.url}" type="video/mp4">
6479
+ <source src="${m.url}" type="video/mp4">
6480
6480
  Your browser does not support the video tag.
6481
6481
  </video>
6482
6482
  </p>
6483
- `, h += `![](${g.url})`) : p === "wav" || p === "mp3" ? (l += `
6483
+ `, h += `![](${m.url})`) : p === "wav" || p === "mp3" ? (l += `
6484
6484
  <p class="responsive-audio">
6485
6485
  <audio controls>
6486
- <source src="${g.url}" type="audio/mpeg">
6486
+ <source src="${m.url}" type="audio/mpeg">
6487
6487
  Your browser does not support the audio tag.
6488
6488
  </audio>
6489
6489
  </p>
6490
- `, h += `![](${g.url})`) : (l += `
6490
+ `, h += `![](${m.url})`) : (l += `
6491
6491
  <div>
6492
- <img src="${g.url}" />
6492
+ <img src="${m.url}" />
6493
6493
  <div>
6494
- <a class="link-view" href="${g.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
6495
- <a class="link-download" href="${g.url}" download>${this.out("Download")}</a>
6494
+ <a class="link-view" href="${m.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
6495
+ <a class="link-download" href="${m.url}" download>${this.out("Download")}</a>
6496
6496
  </div>
6497
6497
  </div>
6498
- `, h += `![](${g.url})`, b = !0), w.push(g.url), _.push(g.file_url);
6499
- }), b && (l = `<div class="image-container">${l}</div>`), typeof u == "string" && (l = u, h = u), n ? (t.innerHTML = "", t.remove()) : (t.innerHTML = l, this.builder.outputHtml += `<div class="result-container">${l}</div>`), {
6498
+ `, h += `![](${m.url})`, b = !0), w.push(m.url), _.push(m.file_url);
6499
+ }), b && (l = `<div class="image-container">${l}</div>`), typeof d == "string" && (l = d, h = d), n ? (t.innerHTML = "", t.remove()) : (t.innerHTML = l, this.builder.outputHtml += `<div class="result-container">${l}</div>`), {
6500
6500
  mediaGenerated: !0,
6501
6501
  status: "success",
6502
6502
  markdown: h,
@@ -6520,14 +6520,14 @@ Check the information and return the details.
6520
6520
  headers: a,
6521
6521
  body: JSON.stringify(e)
6522
6522
  });
6523
- let d = await s.text();
6523
+ let u = await s.text();
6524
6524
  try {
6525
- r = JSON.parse(d);
6525
+ r = JSON.parse(u);
6526
6526
  } catch {
6527
6527
  return {
6528
6528
  mediaGenerated: !1,
6529
6529
  status: "error",
6530
- message: d
6530
+ message: u
6531
6531
  };
6532
6532
  }
6533
6533
  if (this.builder.output.push(r), r.error)
@@ -6538,8 +6538,8 @@ Check the information and return the details.
6538
6538
  //this.out('Request failed.')
6539
6539
  };
6540
6540
  {
6541
- const u = r.data;
6542
- let l = this.renderResult(u, t, n);
6541
+ const d = r.data;
6542
+ let l = this.renderResult(d, t, n);
6543
6543
  return {
6544
6544
  mediaGenerated: !0,
6545
6545
  status: "success",
@@ -6550,14 +6550,14 @@ Check the information and return the details.
6550
6550
  }
6551
6551
  }
6552
6552
  async waitingReplicate(e, i, t, n) {
6553
- let s, r, o, a = e.model, d = this.builder.settings.replicateStatusEndpoint;
6554
- d = d.replace("{REQUEST_ID}", i);
6555
- let u = {
6553
+ let s, r, o, a = e.model, u = this.builder.settings.replicateStatusEndpoint;
6554
+ u = u.replace("{REQUEST_ID}", i);
6555
+ let d = {
6556
6556
  "Content-Type": "application/json",
6557
6557
  ...this.builder.settings.headers
6558
6558
  }, l = {
6559
6559
  model: a,
6560
- endpoint: d,
6560
+ endpoint: u,
6561
6561
  request_id: i
6562
6562
  // customData: this.builder.settings.customData
6563
6563
  };
@@ -6565,7 +6565,7 @@ Check the information and return the details.
6565
6565
  if (r = await fetch(this.builder.settings.checkRequestStatusUrl_Replicate, {
6566
6566
  signal: this.builder.mediaSignal,
6567
6567
  method: "POST",
6568
- headers: u,
6568
+ headers: d,
6569
6569
  body: JSON.stringify(l)
6570
6570
  }), o = await r.json(), o.ok && (s = o.data.status), !s)
6571
6571
  return {
@@ -6587,13 +6587,13 @@ Check the information and return the details.
6587
6587
  }
6588
6588
  async waitingFal(e, i, t, n) {
6589
6589
  let s, r, o, a = e.model;
6590
- const d = this.getEndpoint(a, i, this.builder.settings.falStatusEndpoint);
6591
- let u = {
6590
+ const u = this.getEndpoint(a, i, this.builder.settings.falStatusEndpoint);
6591
+ let d = {
6592
6592
  "Content-Type": "application/json",
6593
6593
  ...this.builder.settings.headers
6594
6594
  }, l = {
6595
6595
  model: a,
6596
- endpoint: d,
6596
+ endpoint: u,
6597
6597
  request_id: i
6598
6598
  // customData: this.builder.settings.customData
6599
6599
  };
@@ -6601,7 +6601,7 @@ Check the information and return the details.
6601
6601
  if (r = await fetch(this.builder.settings.checkRequestStatusUrl_Fal, {
6602
6602
  signal: this.builder.mediaSignal,
6603
6603
  method: "POST",
6604
- headers: u,
6604
+ headers: d,
6605
6605
  body: JSON.stringify(l)
6606
6606
  }), o = await r.json(), o.ok && o.status)
6607
6607
  s = o.status;
@@ -6625,32 +6625,32 @@ Check the information and return the details.
6625
6625
  renderResult(e, i, t) {
6626
6626
  let n = "", s = "", r = [], o = [];
6627
6627
  if (e.entries) {
6628
- let a, d = !1;
6629
- e.entries.forEach((u) => {
6630
- a = u.url.split(".").pop().toLowerCase(), a === "mp4" ? (n += `
6628
+ let a, u = !1;
6629
+ e.entries.forEach((d) => {
6630
+ a = d.url.split(".").pop().toLowerCase(), a === "mp4" ? (n += `
6631
6631
  <p class="responsive-video">
6632
6632
  <video controls>
6633
- <source src="${u.url}" type="video/mp4">
6633
+ <source src="${d.url}" type="video/mp4">
6634
6634
  Your browser does not support the video tag.
6635
6635
  </video>
6636
6636
  </p>
6637
- `, s += `![](${u.url})`, r.push(u.url), o.push(u.file_url)) : a === "wav" || a === "mp3" ? (n += `
6637
+ `, s += `![](${d.url})`, r.push(d.url), o.push(d.file_url)) : a === "wav" || a === "mp3" ? (n += `
6638
6638
  <p class="responsive-audio">
6639
6639
  <audio controls>
6640
- <source src="${u.url}" type="audio/mpeg">
6640
+ <source src="${d.url}" type="audio/mpeg">
6641
6641
  Your browser does not support the audio tag.
6642
6642
  </audio>
6643
6643
  </p>
6644
- `, s += `![](${u.url})`, r.push(u.url), o.push(u.file_url)) : (n += `
6644
+ `, s += `![](${d.url})`, r.push(d.url), o.push(d.file_url)) : (n += `
6645
6645
  <div>
6646
- <img src="${u.url}" />
6646
+ <img src="${d.url}" />
6647
6647
  <div>
6648
- <a class="link-view" href="${u.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
6649
- <a class="link-download" href="${u.url}" download>${this.out("Download")}</a>
6648
+ <a class="link-view" href="${d.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
6649
+ <a class="link-download" href="${d.url}" download>${this.out("Download")}</a>
6650
6650
  </div>
6651
6651
  </div>
6652
- `, s += `![](${u.url})`, r.push(u.url), o.push(u.file_url), d = !0);
6653
- }), d && (n = `<div class="image-container">${n}</div>`);
6652
+ `, s += `![](${d.url})`, r.push(d.url), o.push(d.file_url), u = !0);
6653
+ }), u && (n = `<div class="image-container">${n}</div>`);
6654
6654
  } else typeof e == "string" && (n = `
6655
6655
  <p>
6656
6656
  ${e}
@@ -6672,17 +6672,17 @@ Check the information and return the details.
6672
6672
  status: "error",
6673
6673
  message: this.out("Model not found.")
6674
6674
  };
6675
- let d = e.prompt;
6676
- if (!d)
6675
+ let u = e.prompt;
6676
+ if (!u)
6677
6677
  return {
6678
6678
  mediaGenerated: !1,
6679
6679
  status: "error",
6680
6680
  message: this.out("Please input a prompt.")
6681
6681
  };
6682
- let u = e.aspect_ratio || "16:9", l = e.num_images || 1;
6682
+ let d = e.aspect_ratio || "16:9", l = e.num_images || 1;
6683
6683
  l > 4 && (l = 4), n = {
6684
- prompt: d,
6685
- aspect_ratio: u,
6684
+ prompt: u,
6685
+ aspect_ratio: d,
6686
6686
  num_outputs: l
6687
6687
  }, s.model = a, s.customData = this.builder.settings.customData;
6688
6688
  } else if (e.edit_area_in_image) {
@@ -6693,8 +6693,8 @@ Check the information and return the details.
6693
6693
  status: "error",
6694
6694
  message: this.out("Model not found.")
6695
6695
  };
6696
- let d = e.prompt;
6697
- if (!d)
6696
+ let u = e.prompt;
6697
+ if (!u)
6698
6698
  return {
6699
6699
  mediaGenerated: !1,
6700
6700
  status: "error",
@@ -6722,7 +6722,7 @@ Check the information and return the details.
6722
6722
  message: this.out("Image mask not found.")
6723
6723
  };
6724
6724
  n = {
6725
- prompt: d,
6725
+ prompt: u,
6726
6726
  image: p,
6727
6727
  mask: b
6728
6728
  // num_images,
@@ -6735,24 +6735,24 @@ Check the information and return the details.
6735
6735
  status: "error",
6736
6736
  message: this.out("Model not found.")
6737
6737
  };
6738
- let d = e.prompt;
6739
- if (!d)
6738
+ let u = e.prompt;
6739
+ if (!u)
6740
6740
  return {
6741
6741
  mediaGenerated: !1,
6742
6742
  status: "error",
6743
6743
  message: this.out("Please input a prompt.")
6744
6744
  };
6745
- let u = e.width || 1280, l = e.height || 768;
6745
+ let d = e.width || 1280, l = e.height || 768;
6746
6746
  e.num_images, n = {
6747
- prompt: d,
6748
- size: `${u}x${l}`,
6747
+ prompt: u,
6748
+ size: `${d}x${l}`,
6749
6749
  // num_images,
6750
6750
  style: "digital_illustration"
6751
6751
  // style_id,
6752
6752
  // colors,
6753
6753
  }, s.model = a, s.customData = this.builder.settings.customData;
6754
6754
  } else if (e.upscale_image) {
6755
- let a = this.validateModel(e.model, u, "upscale_image");
6755
+ let a = this.validateModel(e.model, d, "upscale_image");
6756
6756
  if (!a)
6757
6757
  return {
6758
6758
  mediaGenerated: !1,
@@ -6765,8 +6765,8 @@ Check the information and return the details.
6765
6765
  status: "error",
6766
6766
  message: this.out("Image reference not found.")
6767
6767
  };
6768
- let u = "replicate";
6769
- const l = await this.builder.upload.getInputURLs(u);
6768
+ let d = "replicate";
6769
+ const l = await this.builder.upload.getInputURLs(d);
6770
6770
  if (l.error)
6771
6771
  return {
6772
6772
  mediaGenerated: !1,
@@ -6792,8 +6792,8 @@ Check the information and return the details.
6792
6792
  status: "error",
6793
6793
  message: this.out("Model not found.")
6794
6794
  };
6795
- let d = e.prompt;
6796
- if (!d)
6795
+ let u = e.prompt;
6796
+ if (!u)
6797
6797
  return {
6798
6798
  mediaGenerated: !1,
6799
6799
  status: "error",
@@ -6822,7 +6822,7 @@ Check the information and return the details.
6822
6822
  };
6823
6823
  n = {
6824
6824
  image: p,
6825
- prompt: `${d}. No talk. Answer only.`
6825
+ prompt: `${u}. No talk. Answer only.`
6826
6826
  }, s.model = a, s.customData = this.builder.settings.customData;
6827
6827
  } else if (e.image_to_video_generation) {
6828
6828
  let a = this.validateModel(e.model, l, "image_to_video_generation");
@@ -6832,8 +6832,8 @@ Check the information and return the details.
6832
6832
  status: "error",
6833
6833
  message: this.out("Model not found.")
6834
6834
  };
6835
- let d = e.prompt || "stunning video", u = e.duration || 5;
6836
- u > 10 && (u = 5);
6835
+ let u = e.prompt || "stunning video", d = e.duration || 5;
6836
+ d > 10 && (d = 5);
6837
6837
  let l = "replicate";
6838
6838
  const h = await this.builder.upload.getInputURLs(l);
6839
6839
  if (h.error)
@@ -6851,18 +6851,18 @@ Check the information and return the details.
6851
6851
  };
6852
6852
  a === "kwaivgi/kling-v1.6-pro" && (n = {
6853
6853
  start_image: p,
6854
- prompt: d,
6855
- duration: u
6854
+ prompt: u,
6855
+ duration: d
6856
6856
  }), a === "kwaivgi/kling-v1.6-standard" && (n = {
6857
6857
  start_image: p,
6858
- prompt: d,
6859
- duration: u
6858
+ prompt: u,
6859
+ duration: d
6860
6860
  }), a === "minimax/video-01-live" && (n = {
6861
6861
  first_frame_image: p,
6862
- prompt: d
6862
+ prompt: u
6863
6863
  }), a === "luma/ray" && (n = {
6864
6864
  start_image_url: p,
6865
- prompt: d
6865
+ prompt: u
6866
6866
  }), s.model = a, s.customData = this.builder.settings.customData;
6867
6867
  } else if (e.text_to_video_generation) {
6868
6868
  let a = this.validateModel(e.model, r, "text_to_video_generation");
@@ -6872,21 +6872,21 @@ Check the information and return the details.
6872
6872
  status: "error",
6873
6873
  message: this.out("Model not found.")
6874
6874
  };
6875
- let d = e.prompt;
6876
- if (!d)
6875
+ let u = e.prompt;
6876
+ if (!u)
6877
6877
  return {
6878
6878
  mediaGenerated: !1,
6879
6879
  status: "error",
6880
6880
  message: this.out("Please input a prompt.")
6881
6881
  };
6882
- let u = e.duration || 5;
6883
- u > 10 && (u = 5), a === "kwaivgi/kling-v1.6-standard" && (n = {
6884
- prompt: d,
6885
- duration: u
6882
+ let d = e.duration || 5;
6883
+ d > 10 && (d = 5), a === "kwaivgi/kling-v1.6-standard" && (n = {
6884
+ prompt: u,
6885
+ duration: d
6886
6886
  }), a === "minimax/video-01" && (n = {
6887
- prompt: d
6887
+ prompt: u
6888
6888
  }), a === "luma/ray" && (n = {
6889
- prompt: d
6889
+ prompt: u
6890
6890
  }), s.model = a, s.customData = this.builder.settings.customData;
6891
6891
  } else if (e.text_to_speech) {
6892
6892
  let a = this.validateModel(e.model, r, "text_to_speech");
@@ -6909,10 +6909,10 @@ Check the information and return the details.
6909
6909
  }, s.model = a, s.customData = this.builder.settings.customData;
6910
6910
  }
6911
6911
  if (s.model.indexOf(":") !== -1) {
6912
- const d = s.model.split(":")[1];
6913
- s.version = d;
6914
- let u = this.builder.settings.replicateEndpoint1;
6915
- s.endpoint = u, s.payload = n, this.builder.settings.consoleLog && console.log("PAYLOAD 1");
6912
+ const u = s.model.split(":")[1];
6913
+ s.version = u;
6914
+ let d = this.builder.settings.replicateEndpoint1;
6915
+ s.endpoint = d, s.payload = n, this.builder.settings.consoleLog && console.log("PAYLOAD 1");
6916
6916
  } else {
6917
6917
  let a = this.builder.settings.replicateEndpoint2;
6918
6918
  a = a.replace("{MODEL}", s.model), s.endpoint = a, s.payload = n, this.builder.settings.consoleLog && console.log("PAYLOAD 2");
@@ -6927,17 +6927,17 @@ Check the information and return the details.
6927
6927
  status: "error",
6928
6928
  message: this.out("Endpoint not configured.")
6929
6929
  };
6930
- let d, u = {
6930
+ let u, d = {
6931
6931
  "Content-Type": "application/json",
6932
6932
  ...this.builder.settings.headers
6933
6933
  }, h = await (await fetch(a, {
6934
6934
  signal: this.builder.mediaSignal,
6935
6935
  method: "POST",
6936
- headers: u,
6936
+ headers: d,
6937
6937
  body: JSON.stringify(s)
6938
6938
  })).json();
6939
6939
  if (h.ok) {
6940
- if (d = h.data.id, !d)
6940
+ if (u = h.data.id, !u)
6941
6941
  return {
6942
6942
  mediaGenerated: !1,
6943
6943
  status: "error",
@@ -6949,7 +6949,7 @@ Check the information and return the details.
6949
6949
  status: "error",
6950
6950
  message: h.error
6951
6951
  };
6952
- const p = this.waitingReplicate(s, d, i, t);
6952
+ const p = this.waitingReplicate(s, u, i, t);
6953
6953
  return this.builder.isMediaGenerating = !1, p;
6954
6954
  } else {
6955
6955
  let a = this.builder.settings.generateMediaUrl;
@@ -6959,14 +6959,14 @@ Check the information and return the details.
6959
6959
  status: "error",
6960
6960
  message: this.out("Endpoint not configured: generateMediaUrl.")
6961
6961
  };
6962
- let d = {
6962
+ let u = {
6963
6963
  "Content-Type": "application/json",
6964
6964
  ...this.builder.settings.headers
6965
6965
  };
6966
6966
  const l = await (await fetch(a, {
6967
6967
  signal: this.builder.mediaSignal,
6968
6968
  method: "POST",
6969
- headers: d,
6969
+ headers: u,
6970
6970
  body: JSON.stringify(s)
6971
6971
  })).json();
6972
6972
  if (this.builder.isMediaGenerating = !1, l.error)
@@ -6997,36 +6997,36 @@ Check the information and return the details.
6997
6997
  status: "error",
6998
6998
  message: this.out("Please input a prompt.")
6999
6999
  };
7000
- const d = new FormData();
7001
- d.append("customData", JSON.stringify(this.builder.settings.customData)), d.append("model", o), d.append("prompt", a);
7002
- let u = !1, l = this.builder.getFormValues();
7000
+ const u = new FormData();
7001
+ u.append("customData", JSON.stringify(this.builder.settings.customData)), u.append("model", o), u.append("prompt", a);
7002
+ let d = !1, l = this.builder.getFormValues();
7003
7003
  for (const f of l) {
7004
7004
  if (f.value instanceof FileList && f.type === "multifile") {
7005
- const m = f.value;
7006
- if (m.length > 0)
7007
- for (const y of m)
7008
- d.append("file[]", y), u = !0;
7005
+ const g = f.value;
7006
+ if (g.length > 0)
7007
+ for (const y of g)
7008
+ u.append("file[]", y), d = !0;
7009
7009
  }
7010
7010
  if (f.value instanceof FileList && f.type === "file") {
7011
- const m = f.value;
7012
- if (m.length > 0) {
7013
- const y = m[0];
7014
- d.append("file[]", y), u = !0;
7011
+ const g = f.value;
7012
+ if (g.length > 0) {
7013
+ const y = g[0];
7014
+ u.append("file[]", y), d = !0;
7015
7015
  }
7016
7016
  }
7017
7017
  if (typeof f.value == "string" && f.value.indexOf("base64") !== -1) {
7018
- let m = f.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/, "");
7019
- d.append("mask", m);
7018
+ let g = f.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/, "");
7019
+ u.append("mask", g);
7020
7020
  }
7021
7021
  }
7022
7022
  if (this.builder.selectedFiles && this.builder.selectedFiles.length > 0)
7023
7023
  for (let f = 0; f < this.builder.selectedFiles.length; f++) {
7024
- const m = this.builder.selectedFiles[f];
7025
- d.append("file[]", m), u = !0;
7024
+ const g = this.builder.selectedFiles[f];
7025
+ u.append("file[]", g), d = !0;
7026
7026
  }
7027
7027
  let h, p = e.size || "auto", b = e.quality || "auto", w = e.num_images || 1;
7028
- if (u) {
7029
- d.append("size", p), d.append("n", w), d.append("quality", b), n = {
7028
+ if (d) {
7029
+ u.append("size", p), u.append("n", w), u.append("quality", b), n = {
7030
7030
  prompt: a,
7031
7031
  size: p,
7032
7032
  quality: b,
@@ -7035,14 +7035,14 @@ Check the information and return the details.
7035
7035
  let f = this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;
7036
7036
  h = await fetch(f, {
7037
7037
  method: "POST",
7038
- body: d
7038
+ body: u
7039
7039
  });
7040
7040
  } else {
7041
- let f = e.background || "auto", m = e.output_format || "png";
7041
+ let f = e.background || "auto", g = e.output_format || "png";
7042
7042
  n = {
7043
7043
  prompt: a,
7044
7044
  background: f,
7045
- output_format: m,
7045
+ output_format: g,
7046
7046
  size: p,
7047
7047
  quality: b,
7048
7048
  n: w
@@ -7061,9 +7061,9 @@ Check the information and return the details.
7061
7061
  }
7062
7062
  const _ = await h.json();
7063
7063
  this.builder.settings.consoleLog && console.log(_), this.builder.isMediaGenerating = !1;
7064
- const g = _.data;
7064
+ const m = _.data;
7065
7065
  this.builder.output.push(_);
7066
- let v = this.renderResult(g, i, t);
7066
+ let v = this.renderResult(m, i, t);
7067
7067
  return {
7068
7068
  mediaGenerated: !0,
7069
7069
  status: "success",
@@ -7087,35 +7087,35 @@ Check the information and return the details.
7087
7087
  status: "error",
7088
7088
  message: this.out("Please input a prompt.")
7089
7089
  };
7090
- let d = [];
7091
- d.push({
7090
+ let u = [];
7091
+ u.push({
7092
7092
  text: a
7093
7093
  });
7094
- let u = this.builder.getFormValues();
7095
- if (!(u && Object.keys(u).length === 0)) {
7096
- for (const g of u)
7097
- if (g.value instanceof FileList && g.type === "multifile") {
7098
- const v = g.value;
7094
+ let d = this.builder.getFormValues();
7095
+ if (!(d && Object.keys(d).length === 0)) {
7096
+ for (const m of d)
7097
+ if (m.value instanceof FileList && m.type === "multifile") {
7098
+ const v = m.value;
7099
7099
  if (v.length > 0)
7100
7100
  for (const f of v) {
7101
- const m = await new Promise((y, k) => {
7101
+ const g = await new Promise((y, k) => {
7102
7102
  const x = new FileReader();
7103
7103
  x.onload = (S) => {
7104
7104
  const E = S.target.result.split(",")[1];
7105
7105
  y(E);
7106
7106
  }, x.onerror = k, x.readAsDataURL(f);
7107
7107
  });
7108
- d.push({
7108
+ u.push({
7109
7109
  inlineData: {
7110
7110
  mimeType: "image/png",
7111
- data: m
7111
+ data: g
7112
7112
  }
7113
7113
  });
7114
7114
  }
7115
7115
  }
7116
7116
  }
7117
7117
  n = {
7118
- contents: d
7118
+ contents: u
7119
7119
  }, s.model = o, s.customData = this.builder.settings.customData, s.payload = n, this.builder.payloads.push(s), this.builder.settings.consoleLog && console.log(s);
7120
7120
  const l = this.builder.settings.generateMediaUrl_Google;
7121
7121
  let h = {
@@ -7156,17 +7156,17 @@ Check the information and return the details.
7156
7156
  status: "error",
7157
7157
  message: this.out("Please input a prompt.")
7158
7158
  };
7159
- let _ = e.width || 1280, g = e.height || 768, v = e.aspect_ratio, f = e.num_images || 1;
7159
+ let _ = e.width || 1280, m = e.height || 768, v = e.aspect_ratio, f = e.num_images || 1;
7160
7160
  if (f > 4 && (f = 4), v) {
7161
7161
  let {
7162
7162
  w: U,
7163
7163
  h: F
7164
7164
  } = this.getDimension(v);
7165
- _ = U, g = F;
7165
+ _ = U, m = F;
7166
7166
  }
7167
- let m = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7168
- m && y && k && !(m === "0" && y === "0" && k === "0") && T.push({
7169
- r: m,
7167
+ let g = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7168
+ g && y && k && !(g === "0" && y === "0" && k === "0") && T.push({
7169
+ r: g,
7170
7170
  g: y,
7171
7171
  b: k
7172
7172
  }), x && S && E && !(x === "0" && S === "0" && E === "0") && T.push({
@@ -7215,13 +7215,13 @@ Check the information and return the details.
7215
7215
  prompt: w,
7216
7216
  image_size: {
7217
7217
  width: _,
7218
- height: g
7218
+ height: m
7219
7219
  },
7220
7220
  num_images: f
7221
7221
  }, b.indexOf("gemini") !== -1 && (s = {
7222
7222
  prompt: w,
7223
7223
  input_image_urls: P
7224
- }), b === "fal-ai/ideogram/v2a" && (v = this.getClosestAspectRatio(_, g), s = {
7224
+ }), b === "fal-ai/ideogram/v2a" && (v = this.getClosestAspectRatio(_, m), s = {
7225
7225
  prompt: w,
7226
7226
  aspect_ratio: v,
7227
7227
  num_images: f
@@ -7229,7 +7229,7 @@ Check the information and return the details.
7229
7229
  prompt: w,
7230
7230
  image_size: {
7231
7231
  width: _,
7232
- height: g
7232
+ height: m
7233
7233
  },
7234
7234
  num_images: f,
7235
7235
  // style,
@@ -7256,14 +7256,14 @@ Check the information and return the details.
7256
7256
  status: "error",
7257
7257
  message: this.out("Image reference not found.")
7258
7258
  };
7259
- const g = await this.builder.upload.getInputURLs(n);
7260
- if (g.error)
7259
+ const m = await this.builder.upload.getInputURLs(n);
7260
+ if (m.error)
7261
7261
  return {
7262
7262
  mediaGenerated: !1,
7263
7263
  status: "error",
7264
- message: g.error
7264
+ message: m.error
7265
7265
  };
7266
- let v = g[e.image_url], f = g[e.image_url + "_mask"];
7266
+ let v = m[e.image_url], f = m[e.image_url + "_mask"];
7267
7267
  if (s = {
7268
7268
  image_url: v,
7269
7269
  mask_url: f,
@@ -7274,8 +7274,8 @@ Check the information and return the details.
7274
7274
  image_url: v,
7275
7275
  prompt: w
7276
7276
  };
7277
- let m = this.validateModel(e.model, n, "edit_image");
7278
- r.model = m;
7277
+ let g = this.validateModel(e.model, n, "edit_image");
7278
+ r.model = g;
7279
7279
  }
7280
7280
  r.customData = this.builder.settings.customData;
7281
7281
  } else if (e.text_to_2d_illustration_generation) {
@@ -7293,9 +7293,9 @@ Check the information and return the details.
7293
7293
  status: "error",
7294
7294
  message: this.out("Please input a prompt.")
7295
7295
  };
7296
- let _ = e.width || 1280, g = e.height || 768, v = e.num_images || 1;
7296
+ let _ = e.width || 1280, m = e.height || 768, v = e.num_images || 1;
7297
7297
  v > 4 && (v = 4);
7298
- let f = e.style || "any", m = e.style_id || this.builder.settings._2dIllustrationStyleId, y = e.color1_red, k = e.color1_green, x = e.color1_blue, S = e.color2_red, E = e.color2_green, L = e.color2_blue, M = e.color3_red, C = e.color3_green, D = e.color3_blue, O = e.color4_red, $ = e.color4_green, R = e.color4_blue, q = e.color5_red, A = e.color5_green, T = e.color5_blue, N = [];
7298
+ let f = e.style || "any", g = e.style_id || this.builder.settings._2dIllustrationStyleId, y = e.color1_red, k = e.color1_green, x = e.color1_blue, S = e.color2_red, E = e.color2_green, L = e.color2_blue, M = e.color3_red, C = e.color3_green, D = e.color3_blue, O = e.color4_red, $ = e.color4_green, R = e.color4_blue, q = e.color5_red, A = e.color5_green, T = e.color5_blue, N = [];
7299
7299
  y && k && x && !(y === "0" && k === "0" && x === "0") && N.push({
7300
7300
  r: y,
7301
7301
  g: k,
@@ -7320,11 +7320,11 @@ Check the information and return the details.
7320
7320
  prompt: w,
7321
7321
  image_size: {
7322
7322
  width: _,
7323
- height: g
7323
+ height: m
7324
7324
  },
7325
7325
  num_images: v,
7326
7326
  style: f,
7327
- style_id: m,
7327
+ style_id: g,
7328
7328
  colors: N
7329
7329
  }, r.model = b, r.customData = this.builder.settings.customData;
7330
7330
  } else if (e.text_to_digital_illustration_generation) {
@@ -7342,11 +7342,11 @@ Check the information and return the details.
7342
7342
  status: "error",
7343
7343
  message: this.out("Please input a prompt.")
7344
7344
  };
7345
- let _ = e.width || 1280, g = e.height || 768, v = e.num_images || 1;
7345
+ let _ = e.width || 1280, m = e.height || 768, v = e.num_images || 1;
7346
7346
  v > 4 && (v = 4);
7347
- let f = e.style || "digital_illustration", m = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7348
- m && y && k && !(m === "0" && y === "0" && k === "0") && T.push({
7349
- r: m,
7347
+ let f = e.style || "digital_illustration", g = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7348
+ g && y && k && !(g === "0" && y === "0" && k === "0") && T.push({
7349
+ r: g,
7350
7350
  g: y,
7351
7351
  b: k
7352
7352
  }), x && S && E && !(x === "0" && S === "0" && E === "0") && T.push({
@@ -7369,7 +7369,7 @@ Check the information and return the details.
7369
7369
  prompt: w,
7370
7370
  image_size: {
7371
7371
  width: _,
7372
- height: g
7372
+ height: m
7373
7373
  },
7374
7374
  num_images: v,
7375
7375
  style: f,
@@ -7391,11 +7391,11 @@ Check the information and return the details.
7391
7391
  status: "error",
7392
7392
  message: this.out("Please input a prompt.")
7393
7393
  };
7394
- let _ = e.width || 1024, g = e.height || 1365, v = e.num_images || 1;
7394
+ let _ = e.width || 1024, m = e.height || 1365, v = e.num_images || 1;
7395
7395
  v > 4 && (v = 1);
7396
- let f = "digital_illustration/cover", m = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7397
- m && y && k && !(m === "0" && y === "0" && k === "0") && T.push({
7398
- r: m,
7396
+ let f = "digital_illustration/cover", g = e.color1_red, y = e.color1_green, k = e.color1_blue, x = e.color2_red, S = e.color2_green, E = e.color2_blue, L = e.color3_red, M = e.color3_green, C = e.color3_blue, D = e.color4_red, O = e.color4_green, $ = e.color4_blue, R = e.color5_red, q = e.color5_green, A = e.color5_blue, T = [];
7397
+ g && y && k && !(g === "0" && y === "0" && k === "0") && T.push({
7398
+ r: g,
7399
7399
  g: y,
7400
7400
  b: k
7401
7401
  }), x && S && E && !(x === "0" && S === "0" && E === "0") && T.push({
@@ -7418,7 +7418,7 @@ Check the information and return the details.
7418
7418
  prompt: w,
7419
7419
  image_size: {
7420
7420
  width: _,
7421
- height: g
7421
+ height: m
7422
7422
  },
7423
7423
  num_images: v,
7424
7424
  style: f,
@@ -7446,15 +7446,15 @@ Check the information and return the details.
7446
7446
  status: "error",
7447
7447
  message: _.error
7448
7448
  };
7449
- let g = _[e.image_url];
7450
- if (!g)
7449
+ let m = _[e.image_url];
7450
+ if (!m)
7451
7451
  return {
7452
7452
  mediaGenerated: !1,
7453
7453
  status: "error",
7454
7454
  message: this.out("Image not provided.")
7455
7455
  };
7456
7456
  s = {
7457
- image_url: g,
7457
+ image_url: m,
7458
7458
  upscale_factor: 2
7459
7459
  }, r.model = b, r.customData = this.builder.settings.customData;
7460
7460
  } else if (e.describe_image) {
@@ -7478,14 +7478,14 @@ Check the information and return the details.
7478
7478
  status: "error",
7479
7479
  message: this.out("Image reference not found.")
7480
7480
  };
7481
- const g = await this.builder.upload.getInputURLs(n);
7482
- if (g.error)
7481
+ const m = await this.builder.upload.getInputURLs(n);
7482
+ if (m.error)
7483
7483
  return {
7484
7484
  mediaGenerated: !1,
7485
7485
  status: "error",
7486
- message: g.error
7486
+ message: m.error
7487
7487
  };
7488
- let v = g[e.image_url];
7488
+ let v = m[e.image_url];
7489
7489
  if (!v)
7490
7490
  return {
7491
7491
  mediaGenerated: !1,
@@ -7508,14 +7508,14 @@ Check the information and return the details.
7508
7508
  w = e.prompt || "stunning video";
7509
7509
  let _ = e.duration || 5;
7510
7510
  _ > 10 && (_ = 5);
7511
- const g = await this.builder.upload.getInputURLs(n);
7512
- if (g.error)
7511
+ const m = await this.builder.upload.getInputURLs(n);
7512
+ if (m.error)
7513
7513
  return {
7514
7514
  mediaGenerated: !1,
7515
7515
  status: "error",
7516
- message: g.error
7516
+ message: m.error
7517
7517
  };
7518
- let v = g[e.image_url];
7518
+ let v = m[e.image_url];
7519
7519
  if (!v)
7520
7520
  return {
7521
7521
  mediaGenerated: !1,
@@ -7580,17 +7580,17 @@ Check the information and return the details.
7580
7580
  status: "error",
7581
7581
  message: this.out("Endpoint not configured: generateMediaUrl_Fal.")
7582
7582
  };
7583
- let d, u = {
7583
+ let u, d = {
7584
7584
  "Content-Type": "application/json",
7585
7585
  ...this.builder.settings.headers
7586
7586
  }, h = await (await fetch(a, {
7587
7587
  signal: this.builder.mediaSignal,
7588
7588
  method: "POST",
7589
- headers: u,
7589
+ headers: d,
7590
7590
  body: JSON.stringify(r)
7591
7591
  })).json();
7592
7592
  if (h.ok)
7593
- d = h.request_id;
7593
+ u = h.request_id;
7594
7594
  else
7595
7595
  return {
7596
7596
  mediaGenerated: !1,
@@ -7598,7 +7598,7 @@ Check the information and return the details.
7598
7598
  message: h.error
7599
7599
  //this.out('Generating video request failed.')
7600
7600
  };
7601
- const p = this.waitingFal(r, d, i, t);
7601
+ const p = this.waitingFal(r, u, i, t);
7602
7602
  return this.builder.isMediaGenerating = !1, p;
7603
7603
  }
7604
7604
  validateModel(e, i, t) {
@@ -7628,14 +7628,14 @@ Check the information and return the details.
7628
7628
  let o = {};
7629
7629
  o.model = r, o.customData = this.builder.settings.customData, o.payload = s, this.builder.payloads.push(o), this.builder.settings.consoleLog && console.log(o);
7630
7630
  const a = this.builder.settings.generateMediaUrl_Google;
7631
- let d = {
7631
+ let u = {
7632
7632
  "Content-Type": "application/json",
7633
7633
  ...this.builder.settings.headers
7634
7634
  };
7635
7635
  const l = await (await fetch(a, {
7636
7636
  signal: this.builder.mediaSignal,
7637
7637
  method: "POST",
7638
- headers: d,
7638
+ headers: u,
7639
7639
  body: JSON.stringify(o)
7640
7640
  })).json();
7641
7641
  this.builder.settings.consoleLog && console.log(l);
@@ -7657,12 +7657,12 @@ Check the information and return the details.
7657
7657
  if (n.name = t.name, n.files = [], this.builder.selectedFiles && this.builder.selectedFiles.length > 0) {
7658
7658
  const r = [];
7659
7659
  for (let o = 0; o < this.builder.selectedFiles.length; o++) {
7660
- const a = this.builder.selectedFiles[o], d = new FormData();
7661
- d.append("file", a), d.append("customData", this.builder.settings.customData);
7662
- let u = this.builder.settings.uploadMediaUrl_Fal;
7663
- const h = await (await fetch(u, {
7660
+ const a = this.builder.selectedFiles[o], u = new FormData();
7661
+ u.append("file", a), u.append("customData", this.builder.settings.customData);
7662
+ let d = this.builder.settings.uploadMediaUrl_Fal;
7663
+ const h = await (await fetch(d, {
7664
7664
  method: "POST",
7665
- body: d
7665
+ body: u
7666
7666
  })).json();
7667
7667
  if (h.ok) {
7668
7668
  const p = h.url;
@@ -7679,8 +7679,8 @@ Check the information and return the details.
7679
7679
  r++;
7680
7680
  const a = new FormData();
7681
7681
  a.append("file", o), a.append("customData", this.builder.settings.customData);
7682
- let d = this.builder.settings.uploadMediaUrl_Fal;
7683
- const l = await (await fetch(d, {
7682
+ let u = this.builder.settings.uploadMediaUrl_Fal;
7683
+ const l = await (await fetch(u, {
7684
7684
  method: "POST",
7685
7685
  body: a
7686
7686
  })).json();
@@ -7698,10 +7698,10 @@ Check the information and return the details.
7698
7698
  if (t = t || this.builder.settings.defaultMediaGenerationProvider, t === "google" && e.trim().startsWith("{"))
7699
7699
  return this.generate_GoogleMediaByJSON(e, i, r, o);
7700
7700
  this.builder.isMediaGenerating = !0, this.mediaController = new AbortController(), this.builder.mediaSignal = this.mediaController.signal;
7701
- let a, d = !1, u;
7701
+ let a, u = !1, d;
7702
7702
  if (e.trim().startsWith("{"))
7703
7703
  try {
7704
- u = JSON.parse(e), u && typeof u == "object" && (d = !0);
7704
+ d = JSON.parse(e), d && typeof d == "object" && (u = !0);
7705
7705
  } catch {
7706
7706
  return {
7707
7707
  mediaGenerated: !1,
@@ -7709,7 +7709,7 @@ Check the information and return the details.
7709
7709
  message: this.out("Incorrect JSON format.")
7710
7710
  };
7711
7711
  }
7712
- if (d) {
7712
+ if (u) {
7713
7713
  let l = i.trim();
7714
7714
  if (!l)
7715
7715
  return {
@@ -7718,81 +7718,81 @@ Check the information and return the details.
7718
7718
  message: this.out("Please provide model information in the context.")
7719
7719
  };
7720
7720
  let h = await this.uploadMultiple();
7721
- ((g, v) => {
7722
- const f = (m) => {
7723
- if (Array.isArray(m)) {
7724
- const y = m[0], k = v.find((x) => x.name === y);
7725
- if (k && m.every((x) => x === y))
7721
+ ((m, v) => {
7722
+ const f = (g) => {
7723
+ if (Array.isArray(g)) {
7724
+ const y = g[0], k = v.find((x) => x.name === y);
7725
+ if (k && g.every((x) => x === y))
7726
7726
  return k.files;
7727
- for (let x = 0; x < m.length; x++)
7728
- m[x] = f(m[x]);
7729
- } else if (typeof m == "object" && m !== null)
7730
- for (let y in m)
7731
- m[y] = f(m[y]);
7732
- return m;
7727
+ for (let x = 0; x < g.length; x++)
7728
+ g[x] = f(g[x]);
7729
+ } else if (typeof g == "object" && g !== null)
7730
+ for (let y in g)
7731
+ g[y] = f(g[y]);
7732
+ return g;
7733
7733
  };
7734
- return f(g);
7735
- })(u, h), t || (l.startsWith("fal") ? t = "fal" : t = "replicate");
7736
- const b = (g) => typeof g == "object" && g !== null && !Array.isArray(g), w = await this.builder.upload.getInputURLs(t);
7734
+ return f(m);
7735
+ })(d, h), t || (l.startsWith("fal") ? t = "fal" : t = "replicate");
7736
+ const b = (m) => typeof m == "object" && m !== null && !Array.isArray(m), w = await this.builder.upload.getInputURLs(t);
7737
7737
  if (w.error)
7738
7738
  return {
7739
7739
  mediaGenerated: !1,
7740
7740
  status: "error",
7741
7741
  message: w.error
7742
7742
  };
7743
- Object.keys(u).forEach((g) => {
7743
+ Object.keys(d).forEach((m) => {
7744
7744
  Object.keys(w).forEach((v) => {
7745
- if (u[g] === v) {
7745
+ if (d[m] === v) {
7746
7746
  let f = w[v];
7747
- u[g] = f;
7747
+ d[m] = f;
7748
7748
  }
7749
- if (Array.isArray(u[g])) {
7750
- for (let f = 0; f < u[g].length; f++)
7751
- if (u[g][f] === v) {
7752
- let m = w[v];
7753
- u[g][f] = m;
7749
+ if (Array.isArray(d[m])) {
7750
+ for (let f = 0; f < d[m].length; f++)
7751
+ if (d[m][f] === v) {
7752
+ let g = w[v];
7753
+ d[m][f] = g;
7754
7754
  }
7755
7755
  }
7756
7756
  });
7757
- }), Object.keys(u).forEach((g) => {
7758
- let v = u[g];
7757
+ }), Object.keys(d).forEach((m) => {
7758
+ let v = d[m];
7759
7759
  if (b(v))
7760
7760
  for (const f in v)
7761
- Object.prototype.hasOwnProperty.call(v, f) && Object.keys(w).forEach((m) => {
7762
- if (v[f] === m) {
7763
- let y = w[m];
7764
- v[f] = y, m === y && !y.startsWith("http") && (v[f] = "");
7761
+ Object.prototype.hasOwnProperty.call(v, f) && Object.keys(w).forEach((g) => {
7762
+ if (v[f] === g) {
7763
+ let y = w[g];
7764
+ v[f] = y, g === y && !y.startsWith("http") && (v[f] = "");
7765
7765
  }
7766
7766
  });
7767
7767
  if (Array.isArray(v)) {
7768
7768
  for (let f = 0; f < v.length; f++)
7769
7769
  if (b(v[f]))
7770
- for (const m in v[f])
7771
- Object.prototype.hasOwnProperty.call(v[f], m) && Object.keys(w).forEach((y) => {
7772
- if (v[f][m] === y) {
7770
+ for (const g in v[f])
7771
+ Object.prototype.hasOwnProperty.call(v[f], g) && Object.keys(w).forEach((y) => {
7772
+ if (v[f][g] === y) {
7773
7773
  let k = w[y];
7774
- v[f][m] = k, y === k && !k.startsWith("http") && (v[f][m] = "");
7774
+ v[f][g] = k, y === k && !k.startsWith("http") && (v[f][g] = "");
7775
7775
  }
7776
7776
  });
7777
- u[g] = [...v.filter((f) => f !== "")];
7777
+ d[m] = [...v.filter((f) => f !== "")];
7778
7778
  }
7779
7779
  });
7780
7780
  let _ = {};
7781
7781
  if (_.model = l, _.customData = this.builder.settings.customData, t === "replicate" && l.indexOf(":") !== -1) {
7782
- const g = l.split(":");
7783
- _.version = g[1];
7782
+ const m = l.split(":");
7783
+ _.version = m[1];
7784
7784
  }
7785
7785
  if (t === "replicate")
7786
7786
  if (l.indexOf(":") !== -1) {
7787
- let g = this.builder.settings.replicateEndpoint1;
7788
- _.endpoint = g, _.payload = u, this.builder.settings.consoleLog && console.log("JSON PAYLOAD 1");
7787
+ let m = this.builder.settings.replicateEndpoint1;
7788
+ _.endpoint = m, _.payload = d, this.builder.settings.consoleLog && console.log("JSON PAYLOAD 1");
7789
7789
  } else {
7790
- let g = this.builder.settings.replicateEndpoint2;
7791
- g = g.replace("{MODEL}", _.model), _.endpoint = g, _.payload = u, this.builder.settings.consoleLog && console.log("JSON PAYLOAD 2");
7790
+ let m = this.builder.settings.replicateEndpoint2;
7791
+ m = m.replace("{MODEL}", _.model), _.endpoint = m, _.payload = d, this.builder.settings.consoleLog && console.log("JSON PAYLOAD 2");
7792
7792
  }
7793
7793
  else if (t === "fal") {
7794
- let g = `https://queue.fal.run/${_.model}`;
7795
- _.endpoint = g, _.payload = u, this.builder.settings.consoleLog && console.log("JSON PAYLOAD");
7794
+ let m = `https://queue.fal.run/${_.model}`;
7795
+ _.endpoint = m, _.payload = d, this.builder.settings.consoleLog && console.log("JSON PAYLOAD");
7796
7796
  }
7797
7797
  return this.builder.payloads.push(_), this.builder.settings.consoleLog && console.log(_), this.generateMediaByJSON(_, t, r, o);
7798
7798
  }
@@ -7827,21 +7827,21 @@ Check the information and return the details.
7827
7827
  "Content-Type": "application/json",
7828
7828
  ...this.builder.settings.headers
7829
7829
  };
7830
- const g = await (await fetch(this.builder.settings.minimizeImageUrl, {
7830
+ const m = await (await fetch(this.builder.settings.minimizeImageUrl, {
7831
7831
  signal: this.builder.mediaSignal,
7832
7832
  method: "POST",
7833
7833
  headers: w,
7834
7834
  body: JSON.stringify(b)
7835
7835
  })).json();
7836
- if (this.builder.output.push(g), g.error)
7837
- return this.builder.settings.consoleLog && console.log(g.error), this.builder.isMediaGenerating = !1, {
7836
+ if (this.builder.output.push(m), m.error)
7837
+ return this.builder.settings.consoleLog && console.log(m.error), this.builder.isMediaGenerating = !1, {
7838
7838
  mediaGenerated: !1,
7839
7839
  status: "error",
7840
- message: g.error
7840
+ message: m.error
7841
7841
  //this.out('Request failed.')
7842
7842
  };
7843
7843
  {
7844
- const v = g.url, f = `
7844
+ const v = m.url, f = `
7845
7845
  <div class="image-container">
7846
7846
  <div>
7847
7847
  <img src="${v}" />
@@ -7851,11 +7851,11 @@ Check the information and return the details.
7851
7851
  </div>
7852
7852
  </div>
7853
7853
  </div>`;
7854
- let m = `![](${v})`;
7854
+ let g = `![](${v})`;
7855
7855
  return o ? (r.innerHTML = "", r.remove()) : (r.innerHTML = f, this.builder.outputHtml += `<div class="result-container">${f}</div>`), this.builder.isMediaGenerating = !1, {
7856
7856
  mediaGenerated: !0,
7857
7857
  status: "success",
7858
- markdown: m,
7858
+ markdown: g,
7859
7859
  output: [v]
7860
7860
  };
7861
7861
  }
@@ -7913,43 +7913,43 @@ Check the information and return the details.
7913
7913
  "Content-Type": "application/json",
7914
7914
  ...this.builder.settings.headers
7915
7915
  };
7916
- const d = await (await fetch(s, {
7916
+ const u = await (await fetch(s, {
7917
7917
  signal: this.builder.mediaSignal,
7918
7918
  method: "POST",
7919
7919
  headers: o,
7920
7920
  body: JSON.stringify(e)
7921
7921
  })).json();
7922
7922
  if (this.builder.isMediaGenerating = !1, i === "fal") {
7923
- let u = d.request_id;
7924
- return this.waitingFal(e, u, t, n);
7923
+ let d = u.request_id;
7924
+ return this.waitingFal(e, d, t, n);
7925
7925
  }
7926
- if (d.error)
7927
- return this.builder.settings.consoleLog && console.log(d.error), {
7926
+ if (u.error)
7927
+ return this.builder.settings.consoleLog && console.log(u.error), {
7928
7928
  mediaGenerated: !1,
7929
7929
  status: "error",
7930
- message: d.error
7930
+ message: u.error
7931
7931
  //this.out('Request failed.')
7932
7932
  };
7933
7933
  if (r) {
7934
- let u;
7935
- if (d.ok) {
7936
- if (u = d.data.id, !u)
7934
+ let d;
7935
+ if (u.ok) {
7936
+ if (d = u.data.id, !d)
7937
7937
  return {
7938
7938
  mediaGenerated: !1,
7939
7939
  status: "error",
7940
- message: d.data && d.data.detail
7940
+ message: u.data && u.data.detail
7941
7941
  };
7942
7942
  } else
7943
7943
  return {
7944
7944
  mediaGenerated: !1,
7945
7945
  status: "error",
7946
- message: d.error
7946
+ message: u.error
7947
7947
  //this.out('Generating video request failed.')
7948
7948
  };
7949
- return this.waitingReplicate(e, u, t, n);
7949
+ return this.waitingReplicate(e, d, t, n);
7950
7950
  } else {
7951
- const u = d.data;
7952
- let l = this.renderResult(u, t, n);
7951
+ const d = u.data;
7952
+ let l = this.renderResult(d, t, n);
7953
7953
  return {
7954
7954
  mediaGenerated: !0,
7955
7955
  status: "success",
@@ -8011,7 +8011,7 @@ Check the information and return the details.
8011
8011
  return e;
8012
8012
  }
8013
8013
  }
8014
- class mn {
8014
+ class gn {
8015
8015
  constructor(e = {}, i) {
8016
8016
  const t = {
8017
8017
  lang: []
@@ -8084,15 +8084,15 @@ class mn {
8084
8084
  filename: `${e}_${o}.png`,
8085
8085
  // inputName + '.png',
8086
8086
  customData: this.builder.settings.customData
8087
- }, d;
8088
- i === "replicate" ? d = this.builder.settings.uploadBase64Url : i === "fal" ? d = this.builder.settings.uploadBase64Url_Fal : d = this.builder.settings.uploadBase64Url_Fal || this.builder.settings.uploadBase64Url;
8089
- let u = {
8087
+ }, u;
8088
+ i === "replicate" ? u = this.builder.settings.uploadBase64Url : i === "fal" ? u = this.builder.settings.uploadBase64Url_Fal : u = this.builder.settings.uploadBase64Url_Fal || this.builder.settings.uploadBase64Url;
8089
+ let d = {
8090
8090
  "Content-Type": "application/json",
8091
8091
  ...this.builder.settings.headers
8092
- }, h = await (await fetch(d, {
8092
+ }, h = await (await fetch(u, {
8093
8093
  signal: this.builder.mediaSignal,
8094
8094
  method: "POST",
8095
- headers: u,
8095
+ headers: d,
8096
8096
  body: JSON.stringify(a)
8097
8097
  })).json();
8098
8098
  return h.ok && (r = h.url), r ? {
@@ -8116,11 +8116,11 @@ class mn {
8116
8116
  o.append("file", this.builder.photoBlob[e], `photo_${r}.jpg`), o.append("customData", this.builder.settings.customData);
8117
8117
  let a;
8118
8118
  i === "replicate" ? a = this.builder.settings.uploadMediaUrl : i === "fal" ? a = this.builder.settings.uploadMediaUrl_Fal : a = this.builder.settings.uploadMediaUrl_Fal || this.builder.settings.uploadMediaUrl;
8119
- const u = await (await fetch(a, {
8119
+ const d = await (await fetch(a, {
8120
8120
  method: "POST",
8121
8121
  body: o
8122
8122
  })).json();
8123
- return u.ok ? (s = u.url, n = u.filename, {
8123
+ return d.ok ? (s = d.url, n = d.filename, {
8124
8124
  filename: n,
8125
8125
  url: s
8126
8126
  }) : {
@@ -8132,11 +8132,11 @@ class mn {
8132
8132
  r.append("file", this.builder.selectedFiles[0]), r.append("customData", this.builder.settings.customData);
8133
8133
  let o;
8134
8134
  i === "replicate" ? o = this.builder.settings.uploadMediaUrl : i === "fal" ? o = this.builder.settings.uploadMediaUrl_Fal : o = this.builder.settings.uploadMediaUrl_Fal || this.builder.settings.uploadMediaUrl;
8135
- const d = await (await fetch(o, {
8135
+ const u = await (await fetch(o, {
8136
8136
  method: "POST",
8137
8137
  body: r
8138
8138
  })).json();
8139
- return d.ok ? (s = d.url, n = d.filename, {
8139
+ return u.ok ? (s = u.url, n = u.filename, {
8140
8140
  filename: n,
8141
8141
  url: s
8142
8142
  }) : {
@@ -8151,12 +8151,12 @@ class mn {
8151
8151
  o.append("file", r), o.append("customData", this.builder.settings.customData);
8152
8152
  let a;
8153
8153
  i === "replicate" ? a = this.builder.settings.uploadMediaUrl : i === "fal" ? a = this.builder.settings.uploadMediaUrl_Fal : a = this.builder.settings.uploadMediaUrl_Fal || this.builder.settings.uploadMediaUrl;
8154
- const u = await (await fetch(a, {
8154
+ const d = await (await fetch(a, {
8155
8155
  method: "POST",
8156
8156
  body: o
8157
8157
  })).json();
8158
- if (u.ok)
8159
- s = u.url, n = u.filename;
8158
+ if (d.ok)
8159
+ s = d.url, n = d.filename;
8160
8160
  else
8161
8161
  return {
8162
8162
  error: this.out("Upload file failed.")
@@ -8245,22 +8245,22 @@ class bn {
8245
8245
  const o = document.createElement("label");
8246
8246
  r.appendChild(o), o.innerHTML = `${this.out("Brush Size")}:
8247
8247
  <input type="range" class="brush-size" min="5" max="100" value="30">`;
8248
- const a = o.querySelector(".brush-size"), d = document.createElement("button");
8249
- d.className = "btn-undobrush", d.title = this.out("Undo"), d.innerHTML = `
8248
+ const a = o.querySelector(".brush-size"), u = document.createElement("button");
8249
+ u.className = "btn-undobrush", u.title = this.out("Undo"), u.innerHTML = `
8250
8250
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
8251
8251
  class="icon-undo">
8252
8252
  <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
8253
8253
  <path d="M9 14l-4 -4l4 -4"></path>
8254
8254
  <path d="M5 10h11a4 4 0 1 1 0 8h-1"></path>
8255
- </svg>`, r.appendChild(d);
8256
- const u = document.createElement("button");
8257
- u.className = "btn-redobrush", u.title = this.out("Redo"), u.innerHTML = `
8255
+ </svg>`, r.appendChild(u);
8256
+ const d = document.createElement("button");
8257
+ d.className = "btn-redobrush", d.title = this.out("Redo"), d.innerHTML = `
8258
8258
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
8259
8259
  class="icon-redo">
8260
8260
  <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
8261
8261
  <path d="M15 14l4 -4l-4 -4"></path>
8262
8262
  <path d="M19 10h-11a4 4 0 1 0 0 8h1"></path>
8263
- </svg>`, r.appendChild(u);
8263
+ </svg>`, r.appendChild(d);
8264
8264
  const l = document.createElement("button");
8265
8265
  l.className = "btn-clearbrush", l.title = this.out("Clear"), l.innerHTML = `
8266
8266
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
@@ -8286,7 +8286,7 @@ class bn {
8286
8286
  b.className = "imagemask";
8287
8287
  const w = b.getContext("2d", {
8288
8288
  willReadFrequently: !0
8289
- }), _ = document.createElement("canvas"), g = _.getContext("2d", {
8289
+ }), _ = document.createElement("canvas"), m = _.getContext("2d", {
8290
8290
  willReadFrequently: !0
8291
8291
  }), v = this.element.querySelector(".inp-imagemask"), f = (T) => {
8292
8292
  const N = document.createElement("canvas"), P = N.getContext("2d", {
@@ -8297,27 +8297,27 @@ class bn {
8297
8297
  let F = document.querySelector(".imagemask-output");
8298
8298
  F || (F = document.createElement("img"), F.className = "imagemask-output", document.body.appendChild(F)), F.src = U, this.empty || (v.value = U);
8299
8299
  };
8300
- let m = [], y = [];
8300
+ let g = [], y = [];
8301
8301
  const k = () => {
8302
- m.push(_.toDataURL()), m.length > 10 && m.shift(), y = [];
8302
+ g.push(_.toDataURL()), g.length > 10 && g.shift(), y = [];
8303
8303
  }, x = (T) => {
8304
8304
  const N = new Image();
8305
8305
  N.src = T, N.onload = () => {
8306
- w.clearRect(0, 0, b.width, b.height), w.drawImage(N, 0, 0, b.width, b.height), g.clearRect(0, 0, _.width, _.height), g.drawImage(N, 0, 0, _.width, _.height), f(_);
8306
+ w.clearRect(0, 0, b.width, b.height), w.drawImage(N, 0, 0, b.width, b.height), m.clearRect(0, 0, _.width, _.height), m.drawImage(N, 0, 0, _.width, _.height), f(_);
8307
8307
  };
8308
8308
  };
8309
8309
  b.addEventListener("mousedown", () => {
8310
8310
  k();
8311
- }), d.addEventListener("click", (T) => {
8312
- T.preventDefault(), m.length > 0 && (y.push(b.toDataURL()), x(m.pop()));
8313
8311
  }), u.addEventListener("click", (T) => {
8314
- T.preventDefault(), y.length > 0 && (m.push(b.toDataURL()), x(y.pop()));
8312
+ T.preventDefault(), g.length > 0 && (y.push(b.toDataURL()), x(g.pop()));
8313
+ }), d.addEventListener("click", (T) => {
8314
+ T.preventDefault(), y.length > 0 && (g.push(b.toDataURL()), x(y.pop()));
8315
8315
  });
8316
8316
  const S = document.createElement("img");
8317
8317
  s.appendChild(S), s.appendChild(b), this.loaded = () => {
8318
8318
  s.style.display = "flex";
8319
8319
  const T = document.querySelector(".imagemask-controls");
8320
- T.style.display = "flex", e.style.display = "flex", M(), m = [], y = [], w.clearRect(0, 0, b.width, b.height), g.clearRect(0, 0, _.width, _.height), this.empty = !0, v.value = "";
8320
+ T.style.display = "flex", e.style.display = "flex", M(), g = [], y = [], w.clearRect(0, 0, b.width, b.height), m.clearRect(0, 0, _.width, _.height), this.empty = !0, v.value = "";
8321
8321
  try {
8322
8322
  f(_);
8323
8323
  } catch {
@@ -8327,15 +8327,15 @@ class bn {
8327
8327
  };
8328
8328
  let E = null, L = null;
8329
8329
  const M = () => {
8330
- b.width > 0 && b.height > 0 && (E = w.getImageData(0, 0, b.width, b.height), L = g.getImageData(0, 0, _.width, _.height));
8330
+ b.width > 0 && b.height > 0 && (E = w.getImageData(0, 0, b.width, b.height), L = m.getImageData(0, 0, _.width, _.height));
8331
8331
  const T = S.offsetWidth, N = S.offsetHeight, P = window.devicePixelRatio || 1;
8332
8332
  b.width = T * P, b.height = N * P, w.scale(P, P), b.style.width = `${T}px`, b.style.height = `${N}px`;
8333
8333
  const U = S.naturalWidth, F = S.naturalHeight;
8334
- if (_.width = U * P, _.height = F * P, g.scale(P, P), _.style.width = `${U}px`, _.style.height = `${F}px`, E) {
8334
+ if (_.width = U * P, _.height = F * P, m.scale(P, P), _.style.width = `${U}px`, _.style.height = `${F}px`, E) {
8335
8335
  const W = document.createElement("canvas");
8336
8336
  W.width = E.width, W.height = E.height, W.getContext("2d").putImageData(E, 0, 0);
8337
8337
  const ne = document.createElement("canvas");
8338
- ne.width = L.width, ne.height = L.height, ne.getContext("2d").putImageData(L, 0, 0), w.drawImage(W, 0, 0, E.width, E.height, 0, 0, b.width, b.height), g.drawImage(ne, 0, 0, L.width, L.height, 0, 0, _.width, _.height);
8338
+ ne.width = L.width, ne.height = L.height, ne.getContext("2d").putImageData(L, 0, 0), w.drawImage(W, 0, 0, E.width, E.height, 0, 0, b.width, b.height), m.drawImage(ne, 0, 0, L.width, L.height, 0, 0, _.width, _.height);
8339
8339
  }
8340
8340
  };
8341
8341
  let C = !1, D = parseInt(a.value, 10);
@@ -8365,7 +8365,7 @@ class bn {
8365
8365
  x: N,
8366
8366
  y: P
8367
8367
  } = O(T), U = _.width / b.width, F = _.height / b.height, W = N * U, de = P * F;
8368
- w.fillStyle = "rgb(255, 255, 255)", w.beginPath(), w.arc(N, P, D / 2, 0, Math.PI * 2), w.fill(), g.fillStyle = "rgb(255, 255, 255)", g.beginPath(), g.arc(W, de, D / 2 * U, 0, Math.PI * 2), g.fill();
8368
+ w.fillStyle = "rgb(255, 255, 255)", w.beginPath(), w.arc(N, P, D / 2, 0, Math.PI * 2), w.fill(), m.fillStyle = "rgb(255, 255, 255)", m.beginPath(), m.arc(W, de, D / 2 * U, 0, Math.PI * 2), m.fill();
8369
8369
  };
8370
8370
  b.addEventListener("mousedown", $), b.addEventListener("mouseup", R), b.addEventListener("mousemove", q), b.addEventListener("touchstart", (T) => {
8371
8371
  $(T), T.preventDefault();
@@ -8378,7 +8378,7 @@ class bn {
8378
8378
  }, {
8379
8379
  passive: !1
8380
8380
  }), l.addEventListener("click", (T) => {
8381
- T.preventDefault(), k(), w.clearRect(0, 0, b.width, b.height), g.clearRect(0, 0, _.width, _.height), this.empty = !0, v.value = "", f(_);
8381
+ T.preventDefault(), k(), w.clearRect(0, 0, b.width, b.height), m.clearRect(0, 0, _.width, _.height), this.empty = !0, v.value = "", f(_);
8382
8382
  }), window.addEventListener("resize", M);
8383
8383
  const A = (T) => {
8384
8384
  T ? (e.setAttribute("aria-modal", "true"), e.setAttribute("role", "dialog"), e.classList.add("fullscreen"), i.style.display = "block", t.style.display = "flex", h.style.display = "none") : (e.removeAttribute("aria-modal"), e.removeAttribute("role"), e.classList.remove("fullscreen"), i.style.display = "none", t.style.display = "none", h.style.display = ""), M();
@@ -8539,9 +8539,9 @@ class yn {
8539
8539
  n && n.call(this, s);
8540
8540
  }, !e)
8541
8541
  throw new Error("A valid DOM element is required.");
8542
- e.classList.add("formview-container"), e.classList.add("fb-ui"), this.element = e, this.media = new gn({
8542
+ e.classList.add("formview-container"), e.classList.add("fb-ui"), this.element = e, this.media = new mn({
8543
8543
  lang: this.settings.lang
8544
- }, this), this.upload = new mn({
8544
+ }, this), this.upload = new gn({
8545
8545
  lang: this.settings.lang
8546
8546
  }, this);
8547
8547
  }
@@ -8574,9 +8574,9 @@ class yn {
8574
8574
  replicate: b,
8575
8575
  web: w,
8576
8576
  openai: _,
8577
- google: g
8577
+ google: m
8578
8578
  } = this.settings.templatesConfig;
8579
- return !w && h.includes("web") || !g && h.includes("google") || !_ && h.includes("openai") ? !1 : !p && !b ? !(h.includes("fal") || h.includes("replicate")) : !p && h.includes("fal") ? h.includes("replicate") : !b && h.includes("replicate") ? h.includes("fal") : !0;
8579
+ return !w && h.includes("web") || !m && h.includes("google") || !_ && h.includes("openai") ? !1 : !p && !b ? !(h.includes("fal") || h.includes("replicate")) : !p && h.includes("fal") ? h.includes("replicate") : !b && h.includes("replicate") ? h.includes("fal") : !0;
8580
8580
  });
8581
8581
  const r = this.settings.templateFilters, o = {
8582
8582
  all: {
@@ -8599,19 +8599,19 @@ class yn {
8599
8599
  }
8600
8600
  }, a = document.createElement("div");
8601
8601
  a.className = "app-filters", e.appendChild(a);
8602
- const d = document.createElement("ul");
8603
- d.className = "app-list", e.appendChild(d);
8604
- const u = (l) => {
8602
+ const u = document.createElement("ul");
8603
+ u.className = "app-list", e.appendChild(u);
8604
+ const d = (l) => {
8605
8605
  let h = n.filter((b) => l === "all" || b.categories.includes(l));
8606
8606
  const p = this.settings.templateOutput || ["image", "video", "audio", "text"];
8607
- h = h.filter((b) => b.categories.every((w) => p.includes(w))), this.renderList(h, d);
8607
+ h = h.filter((b) => b.categories.every((w) => p.includes(w))), this.renderList(h, u);
8608
8608
  };
8609
8609
  r.forEach((l) => {
8610
8610
  const h = document.createElement("button");
8611
8611
  h.textContent = o[l].desc, h.setAttribute("data-value", l), l === "all" && h.classList.add("active"), h.addEventListener("click", () => {
8612
- a.querySelectorAll("button").forEach((b) => b.classList.remove("active")), h.classList.add("active"), u(l);
8612
+ a.querySelectorAll("button").forEach((b) => b.classList.remove("active")), h.classList.add("active"), d(l);
8613
8613
  }), a.appendChild(h);
8614
- }), u("all");
8614
+ }), d("all");
8615
8615
  }
8616
8616
  }
8617
8617
  //NEW
@@ -8627,7 +8627,7 @@ class yn {
8627
8627
  const r = await (await fetch(n)).blob(), o = new File([r], e.split("/").pop(), {
8628
8628
  type: r.type
8629
8629
  });
8630
- this.element.querySelector(".div-selected-preview") || (this.selectedFiles = []), t && t.hasAttribute("multiple") ? this.selectedFiles.some((u) => u.name === o.name) || this.selectedFiles.push(o) : this.selectedFiles = [o], this.setSelectedFiles(this.selectedFiles), this.renderSelectedFiles(), i.closest(".image-mask") && this.objImageMask && this.objImageMask.loadImage(o);
8630
+ this.element.querySelector(".div-selected-preview") || (this.selectedFiles = []), t && t.hasAttribute("multiple") ? this.selectedFiles.some((d) => d.name === o.name) || this.selectedFiles.push(o) : this.selectedFiles = [o], this.setSelectedFiles(this.selectedFiles), this.renderSelectedFiles(), i.closest(".image-mask") && this.objImageMask && this.objImageMask.loadImage(o);
8631
8631
  }
8632
8632
  setSelectedFiles(e) {
8633
8633
  this.selectedFiles = e;
@@ -8695,22 +8695,22 @@ class yn {
8695
8695
  let h = r + o;
8696
8696
  a = `<img class="thumbnail" src="${h}" alt="${t.name}" />`, t.form.thumbnailFit && (a = `<img class="thumbnail" style="object-fit:${t.form.thumbnailFit}" src="${h}" alt="${t.name}" />`);
8697
8697
  }
8698
- const d = document.createElement("div");
8699
- d.className = "div-template-buttons";
8700
- let u = !1, l = !1;
8698
+ const u = document.createElement("div");
8699
+ u.className = "div-template-buttons";
8700
+ let d = !1, l = !1;
8701
8701
  if (this.settings.templateButtons && this.settings.templateButtons.viewButton && this.settings.templateButtons.viewButton.text) {
8702
8702
  const h = document.createElement("button");
8703
- h.className = "btn-template-view", h.innerText = this.out(this.settings.templateButtons.viewButton.text), d.appendChild(h), h.addEventListener("click", (p) => {
8703
+ h.className = "btn-template-view", h.innerText = this.out(this.settings.templateButtons.viewButton.text), u.appendChild(h), h.addEventListener("click", (p) => {
8704
8704
  if (p.preventDefault(), this.isGenerating) {
8705
8705
  alert(this.out("Please wait until generation is complete."));
8706
8706
  return;
8707
8707
  }
8708
8708
  this.settings.onSelectTemplate && this.settings.onSelectTemplate(t), this.trigger("templateView", t);
8709
- }), u = !0;
8709
+ }), d = !0;
8710
8710
  }
8711
8711
  if (this.settings.templateButtons && this.settings.templateButtons.useButton && this.settings.templateButtons.useButton.text) {
8712
8712
  const h = document.createElement("button");
8713
- h.className = "btn-template-use", h.innerText = this.out(this.settings.templateButtons.useButton.text), d.appendChild(h), h.addEventListener("click", (p) => {
8713
+ h.className = "btn-template-use", h.innerText = this.out(this.settings.templateButtons.useButton.text), u.appendChild(h), h.addEventListener("click", (p) => {
8714
8714
  p.preventDefault(), this.settings.onSelectTemplate && this.settings.onSelectTemplate(t), this.trigger("templateUse", t);
8715
8715
  }), l = !0;
8716
8716
  }
@@ -8721,7 +8721,7 @@ class yn {
8721
8721
  <div class="description">${t.form.description}</div>
8722
8722
  ${t.info ? ` <div class="info mt-1">${t.info}</div>` : ""}
8723
8723
  </div>
8724
- `, u || l ? (s.querySelector(".card-text").appendChild(d), s.classList.remove("cursor-pointer"), s.classList.add("cursor-default")) : (s.classList.add("cursor-pointer"), s.classList.remove("cursor-default")), n.appendChild(s), u || l || s.addEventListener("click", (h) => {
8724
+ `, d || l ? (s.querySelector(".card-text").appendChild(u), s.classList.remove("cursor-pointer"), s.classList.add("cursor-default")) : (s.classList.add("cursor-pointer"), s.classList.remove("cursor-default")), n.appendChild(s), d || l || s.addEventListener("click", (h) => {
8725
8725
  if (h.preventDefault(), this.isGenerating) {
8726
8726
  alert(this.out("Please wait until generation is complete."));
8727
8727
  return;
@@ -8741,35 +8741,35 @@ class yn {
8741
8741
  });
8742
8742
  let o = !1;
8743
8743
  n.body.innerText.trim() === "" && (o = !0);
8744
- const d = document.createElement("div");
8745
- d.className = "result-tool", e.appendChild(d);
8746
- const u = document.createElement("button");
8747
- u.className = "btn-result-tool", u.innerHTML = `
8744
+ const u = document.createElement("div");
8745
+ u.className = "result-tool", e.appendChild(u);
8746
+ const d = document.createElement("button");
8747
+ d.className = "btn-result-tool", d.innerHTML = `
8748
8748
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
8749
8749
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
8750
8750
  </svg>
8751
8751
  <span>${this.out("Copy")}</span>
8752
- `, o || d.appendChild(u);
8752
+ `, o || u.appendChild(d);
8753
8753
  const l = document.createElement("button");
8754
8754
  l.className = "btn-result-tool", l.innerHTML = `
8755
8755
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
8756
8756
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
8757
8757
  </svg>
8758
8758
  <span>${this.out("Clear")}</span>
8759
- `, d.appendChild(l), u && u.addEventListener("click", (h) => {
8759
+ `, u.appendChild(l), d && d.addEventListener("click", (h) => {
8760
8760
  h.preventDefault();
8761
8761
  const p = e.cloneNode(!0), b = p.querySelector(".result-tool");
8762
- b && b.remove(), p.querySelectorAll(".link-view, .link-download").forEach((g) => {
8763
- g.remove();
8762
+ b && b.remove(), p.querySelectorAll(".link-view, .link-download").forEach((m) => {
8763
+ m.remove();
8764
8764
  }), p.style.position = "fixed", p.style.left = "-9999px", document.body.appendChild(p);
8765
8765
  const _ = p.innerText.trim();
8766
- document.body.removeChild(p), navigator.clipboard.writeText(_), u.innerHTML = `
8766
+ document.body.removeChild(p), navigator.clipboard.writeText(_), d.innerHTML = `
8767
8767
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
8768
8768
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path stroke="none" d="M0 0h24v24H0z" /><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2 2 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" /><path d="M11 14l2 2l4 -4" />
8769
8769
  </svg>
8770
8770
  <span>${this.out("Copied")}</span>
8771
8771
  `, setTimeout(() => {
8772
- u.innerHTML = `
8772
+ d.innerHTML = `
8773
8773
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
8774
8774
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
8775
8775
  </svg>
@@ -8818,8 +8818,8 @@ class yn {
8818
8818
  r && clearTimeout(r), r = setTimeout(() => {
8819
8819
  let o = null;
8820
8820
  const a = () => {
8821
- const d = e.offsetTop;
8822
- d === o ? (n(), s()) : (o = d, requestAnimationFrame(a));
8821
+ const u = e.offsetTop;
8822
+ u === o ? (n(), s()) : (o = u, requestAnimationFrame(a));
8823
8823
  };
8824
8824
  a();
8825
8825
  }, 200);
@@ -8866,66 +8866,66 @@ class yn {
8866
8866
  let o = 1;
8867
8867
  i.elements && i.elements.forEach((l) => {
8868
8868
  if (l.type === "spacer") {
8869
- const g = document.createElement("div");
8870
- g.className = "form-spacer", l.spacerHeight && !isNaN(parseFloat(l.spacerHeight)) && (g.style.height = l.spacerHeight + "px"), l.displayInOutput || r.appendChild(g);
8869
+ const m = document.createElement("div");
8870
+ m.className = "form-spacer", l.spacerHeight && !isNaN(parseFloat(l.spacerHeight)) && (m.style.height = l.spacerHeight + "px"), l.displayInOutput || r.appendChild(m);
8871
8871
  return;
8872
8872
  }
8873
8873
  if (l.type === "separator") {
8874
- const g = document.createElement("hr");
8875
- g.style.borderTopColor = l.color, l.displayInOutput || r.appendChild(g);
8874
+ const m = document.createElement("hr");
8875
+ m.style.borderTopColor = l.color, l.displayInOutput || r.appendChild(m);
8876
8876
  return;
8877
8877
  }
8878
8878
  if (l.type === "html") {
8879
8879
  if (l.html) {
8880
- const g = document.createElement("div");
8881
- g.innerHTML = l.html, l.displayInOutput || r.appendChild(g);
8880
+ const m = document.createElement("div");
8881
+ m.innerHTML = l.html, l.displayInOutput || r.appendChild(m);
8882
8882
  }
8883
8883
  return;
8884
8884
  }
8885
8885
  if (l.type === "heading") {
8886
- const g = document.createElement(l.heading || "h2");
8887
- g.innerHTML = l.headingText || this.out("Your Heading Here!"), l.displayInOutput || r.appendChild(g);
8886
+ const m = document.createElement(l.heading || "h2");
8887
+ m.innerHTML = l.headingText || this.out("Your Heading Here!"), l.displayInOutput || r.appendChild(m);
8888
8888
  return;
8889
8889
  }
8890
8890
  if (l.type === "paragraph") {
8891
- const g = document.createElement("p");
8892
- g.innerHTML = l.paragraphText || this.out("Your paragraph content here!"), l.displayInOutput || r.appendChild(g);
8891
+ const m = document.createElement("p");
8892
+ m.innerHTML = l.paragraphText || this.out("Your paragraph content here!"), l.displayInOutput || r.appendChild(m);
8893
8893
  return;
8894
8894
  }
8895
8895
  if (l.type === "media") {
8896
8896
  if (l.tag === "video") {
8897
- const g = document.createElement("video");
8898
- g.style.width = "100%", g.style.height = "auto", g.controls = !0;
8897
+ const m = document.createElement("video");
8898
+ m.style.width = "100%", m.style.height = "auto", m.controls = !0;
8899
8899
  var h = document.createElement("source");
8900
- h.src = l.url, h.type = "video/mp4", g.appendChild(h), l.displayInOutput || r.appendChild(g);
8900
+ h.src = l.url, h.type = "video/mp4", m.appendChild(h), l.displayInOutput || r.appendChild(m);
8901
8901
  } else if (l.tag === "audio") {
8902
- const g = document.createElement("audio");
8903
- g.controls = !0;
8902
+ const m = document.createElement("audio");
8903
+ m.controls = !0;
8904
8904
  let v = document.createElement("source");
8905
- v.src = l.url, v.type = "audio/mp3", g.appendChild(v), l.displayInOutput || r.appendChild(g);
8905
+ v.src = l.url, v.type = "audio/mp3", m.appendChild(v), l.displayInOutput || r.appendChild(m);
8906
8906
  } else if (l.tag === "img") {
8907
- const g = document.createElement("img");
8908
- g.src = l.url, g.setAttribute("alt", this.out("Output Image")), l.displayInOutput || r.appendChild(g);
8907
+ const m = document.createElement("img");
8908
+ m.src = l.url, m.setAttribute("alt", this.out("Output Image")), l.displayInOutput || r.appendChild(m);
8909
8909
  }
8910
8910
  return;
8911
8911
  }
8912
8912
  if (l.type === "image") {
8913
- const g = document.createElement("img");
8914
- g.src = l.url, g.setAttribute("alt", this.out("Output Image")), l.displayInOutput || r.appendChild(g);
8913
+ const m = document.createElement("img");
8914
+ m.src = l.url, m.setAttribute("alt", this.out("Output Image")), l.displayInOutput || r.appendChild(m);
8915
8915
  return;
8916
8916
  }
8917
8917
  if (l.type === "video") {
8918
- const g = document.createElement("video");
8919
- g.style.width = "100%", g.style.height = "auto", g.controls = !0;
8918
+ const m = document.createElement("video");
8919
+ m.style.width = "100%", m.style.height = "auto", m.controls = !0;
8920
8920
  let v = document.createElement("source");
8921
- v.src = l.url, v.type = "video/mp4", g.appendChild(v), l.displayInOutput || r.appendChild(g);
8921
+ v.src = l.url, v.type = "video/mp4", m.appendChild(v), l.displayInOutput || r.appendChild(m);
8922
8922
  return;
8923
8923
  }
8924
8924
  if (l.type === "audio") {
8925
- const g = document.createElement("audio");
8926
- g.controls = !0;
8925
+ const m = document.createElement("audio");
8926
+ m.controls = !0;
8927
8927
  let v = document.createElement("source");
8928
- v.src = l.url, v.type = "audio/mp3", g.appendChild(v), l.displayInOutput || r.appendChild(g);
8928
+ v.src = l.url, v.type = "audio/mp3", m.appendChild(v), l.displayInOutput || r.appendChild(m);
8929
8929
  return;
8930
8930
  }
8931
8931
  const p = document.createElement("div");
@@ -8933,73 +8933,73 @@ class yn {
8933
8933
  const b = l.type;
8934
8934
  let w = l.name;
8935
8935
  if (r.querySelector(`[name="${w}"]`) && (o++, w = w + "_" + o), b === "short-text") {
8936
- let g = this.getId();
8936
+ let m = this.getId();
8937
8937
  const v = document.createElement("label");
8938
- if (v.setAttribute("for", `short_text_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8939
- const m = document.createElement("div");
8940
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
8938
+ if (v.setAttribute("for", `short_text_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8939
+ const g = document.createElement("div");
8940
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
8941
8941
  }
8942
8942
  const f = document.createElement("input");
8943
- f.id = `short_text_label_${g}`, f.type = "text", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8943
+ f.id = `short_text_label_${m}`, f.type = "text", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8944
8944
  }
8945
8945
  if (b === "long-text") {
8946
- let g = this.getId();
8946
+ let m = this.getId();
8947
8947
  const v = document.createElement("label");
8948
- if (v.setAttribute("for", `long_text_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8949
- const m = document.createElement("div");
8950
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
8948
+ if (v.setAttribute("for", `long_text_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8949
+ const g = document.createElement("div");
8950
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
8951
8951
  }
8952
8952
  const f = document.createElement("textarea");
8953
- f.id = `long_text_label_${g}`, f.name = w, f.value = l.value || "", f.className = "inp-base", f.style.height = l.height + "px", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8953
+ f.id = `long_text_label_${m}`, f.name = w, f.value = l.value || "", f.className = "inp-base", f.style.height = l.height + "px", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8954
8954
  }
8955
8955
  if (b === "number") {
8956
- let g = this.getId();
8956
+ let m = this.getId();
8957
8957
  const v = document.createElement("label");
8958
- if (v.setAttribute("for", `number_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8959
- const m = document.createElement("div");
8960
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
8958
+ if (v.setAttribute("for", `number_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8959
+ const g = document.createElement("div");
8960
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
8961
8961
  }
8962
8962
  const f = document.createElement("input");
8963
- f.id = `number_label_${g}`, f.type = "number", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8963
+ f.id = `number_label_${m}`, f.type = "number", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
8964
8964
  }
8965
8965
  if (b === "slider") {
8966
8966
  p.classList.add("input-slider");
8967
- let g = this.getId();
8967
+ let m = this.getId();
8968
8968
  const v = document.createElement("label");
8969
- if (v.setAttribute("for", `number_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8969
+ if (v.setAttribute("for", `number_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8970
8970
  const E = document.createElement("div");
8971
8971
  E.className = "field-note", E.innerHTML = l.fieldNote, p.appendChild(E);
8972
8972
  }
8973
8973
  const f = document.createElement("div");
8974
8974
  f.className = "slider-container", p.appendChild(f);
8975
- const m = document.createElement("div");
8976
- m.className = "slider-values", f.appendChild(m);
8975
+ const g = document.createElement("div");
8976
+ g.className = "slider-values", f.appendChild(g);
8977
8977
  const y = document.createElement("span");
8978
- m.appendChild(y), y.innerText = l.minValue;
8978
+ g.appendChild(y), y.innerText = l.minValue;
8979
8979
  const k = document.createElement("span");
8980
- m.appendChild(k), k.innerText = l.maxValue;
8980
+ g.appendChild(k), k.innerText = l.maxValue;
8981
8981
  const x = document.createElement("input");
8982
- x.id = `number_label_${g}`, x.type = "range", x.name = w, x.setAttribute("min", l.minValue), x.setAttribute("max", l.maxValue), x.setAttribute("step", l.step), x.setAttribute("value", l.value || 0), f.appendChild(x);
8982
+ x.id = `number_label_${m}`, x.type = "range", x.name = w, x.setAttribute("min", l.minValue), x.setAttribute("max", l.maxValue), x.setAttribute("step", l.step), x.setAttribute("value", l.value || 0), f.appendChild(x);
8983
8983
  const S = document.createElement("div");
8984
8984
  S.className = "current-value", f.appendChild(S), f.querySelector(".current-value").textContent = l.value || 0, x.addEventListener("input", () => {
8985
8985
  f.querySelector(".current-value").textContent = x.value;
8986
8986
  });
8987
8987
  }
8988
8988
  if (b === "select") {
8989
- let g = this.getId();
8989
+ let m = this.getId();
8990
8990
  const v = document.createElement("div");
8991
- if (v.id = `radio_group_label_${g}`, v.className = "field-label-normal", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8992
- const m = document.createElement("div");
8993
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
8991
+ if (v.id = `radio_group_label_${m}`, v.className = "field-label-normal", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
8992
+ const g = document.createElement("div");
8993
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
8994
8994
  }
8995
8995
  const f = document.createElement("div");
8996
- if (f.setAttribute("aria-labelledby", `radio_group_label_${g}`), f.setAttribute("role", "group"), f.className = "div-options", p.appendChild(f), l.choices && l.choices.forEach((m, y) => {
8997
- let k = m;
8998
- l.choicesText && (k = l.choicesText[y] || m);
8996
+ if (f.setAttribute("aria-labelledby", `radio_group_label_${m}`), f.setAttribute("role", "group"), f.className = "div-options", p.appendChild(f), l.choices && l.choices.forEach((g, y) => {
8997
+ let k = g;
8998
+ l.choicesText && (k = l.choicesText[y] || g);
8999
8999
  const x = document.createElement("label");
9000
- x.setAttribute("for", `${g}_${y}`), x.className = "option-label", f.appendChild(x);
9000
+ x.setAttribute("for", `${m}_${y}`), x.className = "option-label", f.appendChild(x);
9001
9001
  const S = document.createElement("input");
9002
- S.type = "radio", S.className = "peer", S.id = `${g}_${y}`, S.name = w, S.value = m, x.appendChild(S), y === l.selected && (S.checked = !0);
9002
+ S.type = "radio", S.className = "peer", S.id = `${m}_${y}`, S.name = w, S.value = g, x.appendChild(S), y === l.selected && (S.checked = !0);
9003
9003
  const E = document.createElement("span");
9004
9004
  E.className = "peer-span-rounded", x.appendChild(E);
9005
9005
  const L = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';
@@ -9007,16 +9007,16 @@ class yn {
9007
9007
  const M = document.createElement("span");
9008
9008
  M.innerText = k, x.appendChild(M), S.addEventListener("change", this.changeListener);
9009
9009
  }), l.showOtherItem) {
9010
- const m = document.createElement("label");
9011
- m.setAttribute("for", g + "_other"), m.className = "option-label", f.appendChild(m);
9010
+ const g = document.createElement("label");
9011
+ g.setAttribute("for", m + "_other"), g.className = "option-label", f.appendChild(g);
9012
9012
  const y = document.createElement("input");
9013
- y.type = "radio", y.className = "peer", y.id = g + "_other", y.name = w, y.value = "other", m.appendChild(y);
9013
+ y.type = "radio", y.className = "peer", y.id = m + "_other", y.name = w, y.value = "other", g.appendChild(y);
9014
9014
  const k = document.createElement("span");
9015
- k.className = "peer-span-rounded", m.appendChild(k);
9015
+ k.className = "peer-span-rounded", g.appendChild(k);
9016
9016
  const x = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';
9017
9017
  k.innerHTML = x;
9018
9018
  const S = document.createElement("span");
9019
- S.innerText = l.otherText, m.appendChild(S);
9019
+ S.innerText = l.otherText, g.appendChild(S);
9020
9020
  const E = document.createElement("div");
9021
9021
  p.appendChild(E);
9022
9022
  const L = document.createElement("input");
@@ -9024,20 +9024,20 @@ class yn {
9024
9024
  }
9025
9025
  }
9026
9026
  if (b === "multi-select") {
9027
- let g = this.getId();
9027
+ let m = this.getId();
9028
9028
  const v = document.createElement("div");
9029
- if (v.id = `checkbox_group_label_${g}`, v.className = "field-label-normal", v.innerHTML = l.title + (l.isRequired ? ` <span class="text-red-500" aria-hidden="true">*</span><span style="position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap;">(${this.out("required")})</span>` : ""), p.appendChild(v), l.fieldNote) {
9030
- const m = document.createElement("div");
9031
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9029
+ if (v.id = `checkbox_group_label_${m}`, v.className = "field-label-normal", v.innerHTML = l.title + (l.isRequired ? ` <span class="text-red-500" aria-hidden="true">*</span><span style="position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap;">(${this.out("required")})</span>` : ""), p.appendChild(v), l.fieldNote) {
9030
+ const g = document.createElement("div");
9031
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9032
9032
  }
9033
9033
  const f = document.createElement("div");
9034
- if (f.setAttribute("aria-labelledby", `checkbox_group_label_${g}`), f.setAttribute("role", "group"), f.className = "div-options", p.appendChild(f), l.choices && l.choices.forEach((m, y) => {
9035
- let k = m;
9036
- l.choicesText && (k = l.choicesText[y] || m);
9034
+ if (f.setAttribute("aria-labelledby", `checkbox_group_label_${m}`), f.setAttribute("role", "group"), f.className = "div-options", p.appendChild(f), l.choices && l.choices.forEach((g, y) => {
9035
+ let k = g;
9036
+ l.choicesText && (k = l.choicesText[y] || g);
9037
9037
  const x = document.createElement("label");
9038
- x.setAttribute("for", `${g}_${y}`), x.className = "option-label", f.appendChild(x);
9038
+ x.setAttribute("for", `${m}_${y}`), x.className = "option-label", f.appendChild(x);
9039
9039
  const S = document.createElement("input");
9040
- S.type = "checkbox", S.className = "peer", S.id = `${g}_${y}`, S.name = w + "[]", S.value = m, x.appendChild(S);
9040
+ S.type = "checkbox", S.className = "peer", S.id = `${m}_${y}`, S.name = w + "[]", S.value = g, x.appendChild(S);
9041
9041
  const E = document.createElement("span");
9042
9042
  E.className = "peer-span-square", x.appendChild(E);
9043
9043
  const L = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
@@ -9047,18 +9047,18 @@ class yn {
9047
9047
  const M = document.createElement("span");
9048
9048
  M.innerText = k, x.appendChild(M), S.addEventListener("change", this.changeListener);
9049
9049
  }), l.showOtherItem) {
9050
- const m = document.createElement("label");
9051
- m.setAttribute("for", g + "_other"), m.className = "option-label", f.appendChild(m);
9050
+ const g = document.createElement("label");
9051
+ g.setAttribute("for", m + "_other"), g.className = "option-label", f.appendChild(g);
9052
9052
  const y = document.createElement("input");
9053
- y.type = "checkbox", y.className = "peer", y.id = g + "_other", y.name = w, y.value = "other", m.appendChild(y);
9053
+ y.type = "checkbox", y.className = "peer", y.id = m + "_other", y.name = w, y.value = "other", g.appendChild(y);
9054
9054
  const k = document.createElement("span");
9055
- k.className = "peer-span-square", m.appendChild(k);
9055
+ k.className = "peer-span-square", g.appendChild(k);
9056
9056
  const x = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
9057
9057
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />
9058
9058
  </svg>`;
9059
9059
  k.innerHTML = x;
9060
9060
  const S = document.createElement("span");
9061
- S.innerText = l.otherText, m.appendChild(S);
9061
+ S.innerText = l.otherText, g.appendChild(S);
9062
9062
  const E = document.createElement("div");
9063
9063
  p.appendChild(E);
9064
9064
  const L = document.createElement("input");
@@ -9066,18 +9066,18 @@ class yn {
9066
9066
  }
9067
9067
  }
9068
9068
  if (b === "switch") {
9069
- let g = this.getId();
9069
+ let m = this.getId();
9070
9070
  const v = document.createElement("label");
9071
- if (v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), v.id = `switch_${g}`, p.appendChild(v), l.fieldNote) {
9071
+ if (v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), v.id = `switch_${m}`, p.appendChild(v), l.fieldNote) {
9072
9072
  const x = document.createElement("div");
9073
9073
  x.className = "field-note", x.innerHTML = l.fieldNote, p.appendChild(x);
9074
9074
  }
9075
9075
  const f = document.createElement("div");
9076
- f.className = "switch", f.tabIndex = 0, f.role = "switch", f.setAttribute("aria-labelledby", `switch_${g}`), f.setAttribute("aria-checked", "false"), f.setAttribute("data-checked", "false"), p.appendChild(f);
9077
- const m = document.createElement("div");
9078
- m.className = "switch-thumb", f.appendChild(m);
9076
+ f.className = "switch", f.tabIndex = 0, f.role = "switch", f.setAttribute("aria-labelledby", `switch_${m}`), f.setAttribute("aria-checked", "false"), f.setAttribute("data-checked", "false"), p.appendChild(f);
9077
+ const g = document.createElement("div");
9078
+ g.className = "switch-thumb", f.appendChild(g);
9079
9079
  const y = document.createElement("input");
9080
- y.id = `switch_input_${g}`, y.setAttribute("aria-hidden", "true"), y.type = "text", y.name = w, y.style.cssText = "position:absolute;bottom:0px;left:25px;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;", y.setAttribute("tabindex", "-1"), l.isRequired && (y.setAttribute("required", "required"), y.setCustomValidity(this.out("Please toggle this switch to proceed.")), f.setAttribute("aria-required", "true")), p.appendChild(y), l.value === "true" ? (f.setAttribute("aria-checked", "true"), f.setAttribute("data-checked", "true"), y.value = "true", l.isRequired && y.setCustomValidity("")) : (f.setAttribute("aria-checked", "false"), f.setAttribute("data-checked", "false"), y.value = "false", l.isRequired && y.setCustomValidity(this.out("Please toggle this switch to proceed."))), v.addEventListener("click", () => {
9080
+ y.id = `switch_input_${m}`, y.setAttribute("aria-hidden", "true"), y.type = "text", y.name = w, y.style.cssText = "position:absolute;bottom:0px;left:25px;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;", y.setAttribute("tabindex", "-1"), l.isRequired && (y.setAttribute("required", "required"), y.setCustomValidity(this.out("Please toggle this switch to proceed.")), f.setAttribute("aria-required", "true")), p.appendChild(y), l.value === "true" ? (f.setAttribute("aria-checked", "true"), f.setAttribute("data-checked", "true"), y.value = "true", l.isRequired && y.setCustomValidity("")) : (f.setAttribute("aria-checked", "false"), f.setAttribute("data-checked", "false"), y.value = "false", l.isRequired && y.setCustomValidity(this.out("Please toggle this switch to proceed."))), v.addEventListener("click", () => {
9081
9081
  f.focus();
9082
9082
  });
9083
9083
  const k = () => {
@@ -9093,18 +9093,18 @@ class yn {
9093
9093
  });
9094
9094
  }
9095
9095
  if (b === "dropdown") {
9096
- let g = this.getId();
9096
+ let m = this.getId();
9097
9097
  const v = document.createElement("label");
9098
- if (v.setAttribute("for", `dropdown_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9098
+ if (v.setAttribute("for", `dropdown_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9099
9099
  const M = document.createElement("div");
9100
9100
  M.className = "field-note", M.innerHTML = l.fieldNote, p.appendChild(M);
9101
9101
  }
9102
9102
  const f = document.createElement("div");
9103
9103
  f.className = "relative", p.appendChild(f);
9104
- const m = document.createElement("div");
9105
- m.className = "relative inline-block", f.appendChild(m);
9104
+ const g = document.createElement("div");
9105
+ g.className = "relative inline-block", f.appendChild(g);
9106
9106
  const y = document.createElement("select");
9107
- y.id = `dropdown_${g}`, y.name = w, l.isRequired && y.setAttribute("required", "required"), m.appendChild(y);
9107
+ y.id = `dropdown_${m}`, y.name = w, l.isRequired && y.setAttribute("required", "required"), g.appendChild(y);
9108
9108
  const k = document.createElement("option");
9109
9109
  if (k.setAttribute("selected", "selected"), k.setAttribute("disabled", "disabled"), k.value = "", k.innerText = l.placeholder, y.appendChild(k), l.choices && l.choices.forEach((M, C) => {
9110
9110
  let D = M;
@@ -9116,14 +9116,14 @@ class yn {
9116
9116
  M.value = "other", M.innerText = l.otherText, y.appendChild(M);
9117
9117
  }
9118
9118
  const x = document.createElement("div");
9119
- x.className = "select-arrow", m.appendChild(x), this.appendHtml(x, `
9119
+ x.className = "select-arrow", g.appendChild(x), this.appendHtml(x, `
9120
9120
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
9121
9121
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
9122
9122
  </svg>
9123
9123
  `);
9124
9124
  const S = document.createElement("input");
9125
- S.type = "text", S.id = `input_other_${g}`, S.name = w + "_other", S.className = "input-other hidden inp-base", p.appendChild(S);
9126
- const E = p.querySelector(`#dropdown_${g}`), L = p.querySelector(`#input_other_${g}`);
9125
+ S.type = "text", S.id = `input_other_${m}`, S.name = w + "_other", S.className = "input-other hidden inp-base", p.appendChild(S);
9126
+ const E = p.querySelector(`#dropdown_${m}`), L = p.querySelector(`#input_other_${m}`);
9127
9127
  E.addEventListener("change", () => {
9128
9128
  E.value === "other" ? (L.classList.remove("hidden"), L.focus()) : L.classList.add("hidden");
9129
9129
  const M = this.getFormValues();
@@ -9131,65 +9131,65 @@ class yn {
9131
9131
  }), S.addEventListener("input", this.inputListener);
9132
9132
  }
9133
9133
  if (b === "date") {
9134
- let g = this.getId();
9134
+ let m = this.getId();
9135
9135
  const v = document.createElement("label");
9136
- if (v.setAttribute("for", `date_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9137
- const m = document.createElement("div");
9138
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9136
+ if (v.setAttribute("for", `date_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9137
+ const g = document.createElement("div");
9138
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9139
9139
  }
9140
9140
  const f = document.createElement("input");
9141
- f.id = `date_${g}`, f.type = "date", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9141
+ f.id = `date_${m}`, f.type = "date", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9142
9142
  }
9143
9143
  if (b === "time") {
9144
- let g = this.getId();
9144
+ let m = this.getId();
9145
9145
  const v = document.createElement("label");
9146
- if (v.setAttribute("for", `time_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9147
- const m = document.createElement("div");
9148
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9146
+ if (v.setAttribute("for", `time_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9147
+ const g = document.createElement("div");
9148
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9149
9149
  }
9150
9150
  const f = document.createElement("input");
9151
- f.id = `time_${g}`, f.type = "time", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9151
+ f.id = `time_${m}`, f.type = "time", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9152
9152
  }
9153
9153
  if (b === "datetime") {
9154
- let g = this.getId();
9154
+ let m = this.getId();
9155
9155
  const v = document.createElement("label");
9156
- if (v.setAttribute("for", `datetime_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9157
- const m = document.createElement("div");
9158
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9156
+ if (v.setAttribute("for", `datetime_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9157
+ const g = document.createElement("div");
9158
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9159
9159
  }
9160
9160
  const f = document.createElement("input");
9161
- f.id = `datetime_${g}`, f.type = "datetime-local", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9161
+ f.id = `datetime_${m}`, f.type = "datetime-local", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("change", this.changeListener);
9162
9162
  }
9163
9163
  if (b === "color") {
9164
- let g = this.getId();
9164
+ let m = this.getId();
9165
9165
  const v = document.createElement("label");
9166
- if (v.setAttribute("for", `color_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9167
- const m = document.createElement("div");
9168
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9166
+ if (v.setAttribute("for", `color_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9167
+ const g = document.createElement("div");
9168
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9169
9169
  }
9170
9170
  const f = document.createElement("input");
9171
- f.id = `color_${g}`, f.type = "color", f.name = w, f.value = l.value || "", f.className = "input-color", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9171
+ f.id = `color_${m}`, f.type = "color", f.name = w, f.value = l.value || "", f.className = "input-color", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9172
9172
  }
9173
9173
  if (b === "file" || b === "multifile") {
9174
- let g = this.getId();
9174
+ let m = this.getId();
9175
9175
  const v = document.createElement("label");
9176
- if (v.setAttribute("for", `file_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9176
+ if (v.setAttribute("for", `file_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9177
9177
  const I = document.createElement("div");
9178
9178
  I.className = "field-note", I.innerHTML = l.fieldNote, p.appendChild(I);
9179
9179
  }
9180
9180
  const f = document.createElement("div");
9181
9181
  f.className = "file-input-wrapper", b === "file" && f.setAttribute("aria-label", this.out(this.settings.fileUploadText)), b === "multifile" && f.setAttribute("aria-label", this.out(this.settings.multiFileUploadText)), p.appendChild(f);
9182
- const m = document.createElement("input");
9183
- m.id = `input_url_label_${g}`, m.type = "text", m.name = w + "__url", m.value = l.value || "", m.className = "inp-base input-file-url", m.placeholder = l.placeholder || this.out("Enter URL."), p.appendChild(m), m.addEventListener("input", () => {
9182
+ const g = document.createElement("input");
9183
+ g.id = `input_url_label_${m}`, g.type = "text", g.name = w + "__url", g.value = l.value || "", g.className = "inp-base input-file-url", g.placeholder = l.placeholder || this.out("Enter URL."), p.appendChild(g), g.addEventListener("input", () => {
9184
9184
  const I = p.querySelector(".btn-clearfile");
9185
- I && I.click(), this.inputListener(), m.value !== "" ? l.isRequired && y.removeAttribute("required") : l.isRequired && y.setAttribute("required", "required"), rt(m.value), this.clearSelectedFiles();
9186
- }), l.useURL ? m.style.display = "" : m.style.display = "none";
9185
+ I && I.click(), this.inputListener(), g.value !== "" ? l.isRequired && y.removeAttribute("required") : l.isRequired && y.setAttribute("required", "required"), rt(g.value), this.clearSelectedFiles();
9186
+ }), l.useURL ? g.style.display = "" : g.style.display = "none";
9187
9187
  const y = document.createElement("input");
9188
- y.id = `file_${g}`, y.type = "file", b === "multifile" && (y.multiple = !0), y.name = w, l.isRequired && y.setAttribute("required", "required"), y.className = "peer", f.appendChild(y);
9188
+ y.id = `file_${m}`, y.type = "file", b === "multifile" && (y.multiple = !0), y.name = w, l.isRequired && y.setAttribute("required", "required"), y.className = "peer", f.appendChild(y);
9189
9189
  const k = document.createElement("div");
9190
9190
  k.className = "file-drop-area", f.appendChild(k);
9191
9191
  const x = document.createElement("div");
9192
- x.className = "file-controls", x.id = `drag_message_${g}`, f.appendChild(x);
9192
+ x.className = "file-controls", x.id = `drag_message_${m}`, f.appendChild(x);
9193
9193
  let S;
9194
9194
  (!l.source || l.source && l.source === "local" || l.source && l.source === "local_and_camera") && (S = document.createElement("div"), S.className = "file-drop-info", b === "file" && (S.innerHTML = this.out(this.settings.fileUploadText)), b === "multifile" && (S.innerHTML = this.out(this.settings.multiFileUploadText)), x.appendChild(S));
9195
9195
  let E;
@@ -9209,7 +9209,7 @@ class yn {
9209
9209
  const M = document.createElement("div");
9210
9210
  M.className = "file-preview-container", f.appendChild(M);
9211
9211
  const C = document.createElement("div");
9212
- C.className = "file-drop-info-highlight", C.id = `file_name_${g}`, f.appendChild(C), E && E.addEventListener("click", (I) => {
9212
+ C.className = "file-drop-info-highlight", C.id = `file_name_${m}`, f.appendChild(C), E && E.addEventListener("click", (I) => {
9213
9213
  I.preventDefault(), y.click();
9214
9214
  }), f.classList.add("disabledrop"), (!l.source || l.source && l.source === "local" || l.source && l.source === "local_and_camera") && (f.classList.remove("disabledrop"), f.addEventListener("dragover", (I) => {
9215
9215
  I.preventDefault(), Array.from(I.dataTransfer.items).some((se) => se.kind === "file") && f.classList.add("drag-over");
@@ -9412,7 +9412,7 @@ class yn {
9412
9412
  this.clearSelectedFiles();
9413
9413
  });
9414
9414
  const Me = () => {
9415
- this.photoBlob[w] = null, P.style.display = "none", P.getContext("2d").clearRect(0, 0, P.width, P.height), m.value !== "" ? l.isRequired && y.removeAttribute("required") : l.isRequired && y.setAttribute("required", "required"), de.style.display = "none", U && (U.style.display = "none"), F.style.display = "none", x.style.display = "", C.style.display = "";
9415
+ this.photoBlob[w] = null, P.style.display = "none", P.getContext("2d").clearRect(0, 0, P.width, P.height), g.value !== "" ? l.isRequired && y.removeAttribute("required") : l.isRequired && y.setAttribute("required", "required"), de.style.display = "none", U && (U.style.display = "none"), F.style.display = "none", x.style.display = "", C.style.display = "";
9416
9416
  };
9417
9417
  de.addEventListener("click", () => {
9418
9418
  Me();
@@ -9437,7 +9437,7 @@ class yn {
9437
9437
  </svg>
9438
9438
  `, C.appendChild(K), K.addEventListener("click", (j) => {
9439
9439
  let ke = K.closest(".form-field").querySelector(".img-preview");
9440
- ke && ke.remove(), m.value = "", y.value = "", C.innerHTML = "", S.innerText = this.out(this.settings.fileUploadText), l.useImageMask && q.clearImage();
9440
+ ke && ke.remove(), g.value = "", y.value = "", C.innerHTML = "", S.innerText = this.out(this.settings.fileUploadText), l.useImageMask && q.clearImage();
9441
9441
  const Oe = document.querySelector(".formview-container .submit-container");
9442
9442
  Oe && setTimeout(() => {
9443
9443
  this.stickyElement(Oe);
@@ -9470,7 +9470,7 @@ class yn {
9470
9470
  }
9471
9471
  q.loadImage(I);
9472
9472
  }
9473
- Me(), m.value = "", C.innerHTML = "";
9473
+ Me(), g.value = "", C.innerHTML = "";
9474
9474
  const se = document.createElement("div");
9475
9475
  se.innerText = I.name, C.appendChild(se);
9476
9476
  const ce = document.createElement("button");
@@ -9546,41 +9546,41 @@ class yn {
9546
9546
  };
9547
9547
  }
9548
9548
  if (b === "email") {
9549
- let g = this.getId();
9549
+ let m = this.getId();
9550
9550
  const v = document.createElement("label");
9551
- if (v.setAttribute("for", `email_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9552
- const m = document.createElement("div");
9553
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9551
+ if (v.setAttribute("for", `email_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9552
+ const g = document.createElement("div");
9553
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9554
9554
  }
9555
9555
  const f = document.createElement("input");
9556
- f.id = `email_label_${g}`, f.type = "email", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9556
+ f.id = `email_label_${m}`, f.type = "email", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9557
9557
  }
9558
9558
  if (b === "phone") {
9559
- let g = this.getId();
9559
+ let m = this.getId();
9560
9560
  const v = document.createElement("label");
9561
- if (v.setAttribute("for", `phone_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9562
- const m = document.createElement("div");
9563
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9561
+ if (v.setAttribute("for", `phone_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9562
+ const g = document.createElement("div");
9563
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9564
9564
  }
9565
9565
  const f = document.createElement("input");
9566
- f.id = `phone_label_${g}`, f.type = "tel", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9566
+ f.id = `phone_label_${m}`, f.type = "tel", f.name = w, f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9567
9567
  }
9568
9568
  if (b === "url") {
9569
- let g = this.getId();
9569
+ let m = this.getId();
9570
9570
  const v = document.createElement("label");
9571
- if (v.setAttribute("for", `url_label_${g}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9572
- const m = document.createElement("div");
9573
- m.className = "field-note", m.innerHTML = l.fieldNote, p.appendChild(m);
9571
+ if (v.setAttribute("for", `url_label_${m}`), v.className = "field-label", v.innerHTML = l.title + (l.isRequired ? ' <span class="text-red-500" aria-hidden="true">*</span>' : ""), p.appendChild(v), l.fieldNote) {
9572
+ const g = document.createElement("div");
9573
+ g.className = "field-note", g.innerHTML = l.fieldNote, p.appendChild(g);
9574
9574
  }
9575
9575
  const f = document.createElement("input");
9576
- f.id = `url_label_${g}`, f.type = "url", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9576
+ f.id = `url_label_${m}`, f.type = "url", f.name = w, f.value = l.value || "", f.className = "inp-base", f.placeholder = l.placeholder, l.isRequired && f.setAttribute("required", "required"), p.appendChild(f), f.addEventListener("input", this.inputListener);
9577
9577
  }
9578
9578
  if (b === "hidden") {
9579
- let g = this.getId();
9579
+ let m = this.getId();
9580
9580
  const v = document.createElement("label");
9581
- v.setAttribute("for", `hidden_label_${g}`), v.className = "field-label hidden", v.innerText = l.title, p.appendChild(v);
9581
+ v.setAttribute("for", `hidden_label_${m}`), v.className = "field-label hidden", v.innerText = l.title, p.appendChild(v);
9582
9582
  const f = document.createElement("input");
9583
- f.id = `hidden_label_${g}`, f.type = "hidden", f.name = w, f.value = l.value, p.appendChild(f);
9583
+ f.id = `hidden_label_${m}`, f.type = "hidden", f.name = w, f.value = l.value, p.appendChild(f);
9584
9584
  }
9585
9585
  });
9586
9586
  const a = r.closest("[data-site-token]");
@@ -9595,13 +9595,13 @@ class yn {
9595
9595
  if ("hideReset" in i && (h = i.hideReset), !h) {
9596
9596
  const _ = document.createElement("button");
9597
9597
  _.className = "btn-resetform";
9598
- const g = i.resetText || this.settings.resetText;
9599
- _.innerText = g, l.appendChild(_), _.addEventListener("click", (f) => {
9598
+ const m = i.resetText || this.settings.resetText;
9599
+ _.innerText = m, l.appendChild(_), _.addEventListener("click", (f) => {
9600
9600
  f.preventDefault();
9601
- const m = _.closest("form");
9602
- m && (m.reset(), m.querySelectorAll(".btn-clearfile").forEach((x) => {
9601
+ const g = _.closest("form");
9602
+ g && (g.reset(), g.querySelectorAll(".btn-clearfile").forEach((x) => {
9603
9603
  x.click();
9604
- }), m.querySelectorAll(".slider-container").forEach((x) => {
9604
+ }), g.querySelectorAll(".slider-container").forEach((x) => {
9605
9605
  const S = x.querySelector("input");
9606
9606
  x.querySelector(".current-value").textContent = S.value;
9607
9607
  }));
@@ -9620,8 +9620,8 @@ class yn {
9620
9620
  let w = this.getId();
9621
9621
  const _ = document.createElement("label");
9622
9622
  _.setAttribute("for", `short_text_label_${w}`), _.className = "field-label", _.innerHTML = l, b.appendChild(_);
9623
- const g = document.createElement("input");
9624
- if (g.id = `short_text_label_${w}`, g.type = "text", g.name = h, g.autocomplete = "off", g.setAttribute("aria-hidden", "true"), g.setAttribute("tabindex", "-1"), g.className = "inp-base", b.appendChild(g), this.settings.captchaContainer) {
9623
+ const m = document.createElement("input");
9624
+ if (m.id = `short_text_label_${w}`, m.type = "text", m.name = h, m.autocomplete = "off", m.setAttribute("aria-hidden", "true"), m.setAttribute("tabindex", "-1"), m.className = "inp-base", b.appendChild(m), this.settings.captchaContainer) {
9625
9625
  const v = this.settings.captchaContainerClassName, f = document.createElement("div");
9626
9626
  f.className = "captcha-container", v && f.classList.add(v), r.appendChild(f);
9627
9627
  }
@@ -9644,48 +9644,48 @@ class yn {
9644
9644
  }));
9645
9645
  }), (i.fullWidthButton || !1) && S.classList.add("w-full");
9646
9646
  }
9647
- const m = document.createElement("button");
9648
- m.className = "btn-submitform";
9647
+ const g = document.createElement("button");
9648
+ g.className = "btn-submitform";
9649
9649
  const y = i.submitText;
9650
- m.innerText = y, v.appendChild(m), (i.fullWidthButton || !1) && m.classList.add("w-full"), this.settings.alwaysVisibleSubmit && v.classList.add("always-visible"), this.stickyElement(v), m.addEventListener("click", async (S) => {
9650
+ g.innerText = y, v.appendChild(g), (i.fullWidthButton || !1) && g.classList.add("w-full"), this.settings.alwaysVisibleSubmit && v.classList.add("always-visible"), this.stickyElement(v), g.addEventListener("click", async (S) => {
9651
9651
  this.trigger("submit", S);
9652
9652
  });
9653
9653
  const x = r.closest("form");
9654
9654
  x ? x.addEventListener("submit", async (S) => {
9655
9655
  this.steps && this.steps.length > 0 && (S.preventDefault(), S.stopImmediatePropagation(), this.process());
9656
- }) : m.addEventListener("click", async (S) => {
9656
+ }) : g.addEventListener("click", async (S) => {
9657
9657
  this.steps && this.steps.length > 0 && (S.preventDefault(), this.process());
9658
9658
  });
9659
9659
  }
9660
9660
  }
9661
- let d, u;
9662
- this.settings.resultSelector && (d = document.querySelector(this.settings.resultSelector), d.classList.add("result-wrapper"), d.innerHTML = "", u = document.createElement("div"), u.classList.add("result-container"), d.appendChild(u)), i.elements && d && i.elements.forEach((l) => {
9661
+ let u, d;
9662
+ this.settings.resultSelector && (u = document.querySelector(this.settings.resultSelector), u.classList.add("result-wrapper"), u.innerHTML = "", d = document.createElement("div"), d.classList.add("result-container"), u.appendChild(d)), i.elements && u && i.elements.forEach((l) => {
9663
9663
  if (l.displayInOutput) {
9664
9664
  if (l.type === "spacer") {
9665
9665
  const p = document.createElement("div");
9666
- p.className = "form-spacer", l.spacerHeight && !isNaN(parseFloat(l.spacerHeight)) && (p.style.height = l.spacerHeight + "px"), u.appendChild(p);
9666
+ p.className = "form-spacer", l.spacerHeight && !isNaN(parseFloat(l.spacerHeight)) && (p.style.height = l.spacerHeight + "px"), d.appendChild(p);
9667
9667
  return;
9668
9668
  }
9669
9669
  if (l.type === "separator") {
9670
9670
  const p = document.createElement("hr");
9671
- p.style.borderTopColor = l.color, u.appendChild(p);
9671
+ p.style.borderTopColor = l.color, d.appendChild(p);
9672
9672
  return;
9673
9673
  }
9674
9674
  if (l.type === "html") {
9675
9675
  if (l.html) {
9676
9676
  const p = document.createElement("div");
9677
- p.innerHTML = l.html, u.appendChild(p);
9677
+ p.innerHTML = l.html, d.appendChild(p);
9678
9678
  }
9679
9679
  return;
9680
9680
  }
9681
9681
  if (l.type === "heading") {
9682
9682
  const p = document.createElement(l.heading || "h2");
9683
- p.innerHTML = l.headingText || this.out("Your Heading Here!"), u.appendChild(p);
9683
+ p.innerHTML = l.headingText || this.out("Your Heading Here!"), d.appendChild(p);
9684
9684
  return;
9685
9685
  }
9686
9686
  if (l.type === "paragraph") {
9687
9687
  const p = document.createElement("p");
9688
- p.innerHTML = l.paragraphText || this.out("Your paragraph content here!"), u.appendChild(p);
9688
+ p.innerHTML = l.paragraphText || this.out("Your paragraph content here!"), d.appendChild(p);
9689
9689
  return;
9690
9690
  }
9691
9691
  if (l.type === "media") {
@@ -9693,35 +9693,35 @@ class yn {
9693
9693
  const p = document.createElement("video");
9694
9694
  p.style.width = "100%", p.style.height = "auto", p.controls = !0;
9695
9695
  var h = document.createElement("source");
9696
- h.src = l.url, h.type = "video/mp4", p.appendChild(h), u.appendChild(p);
9696
+ h.src = l.url, h.type = "video/mp4", p.appendChild(h), d.appendChild(p);
9697
9697
  } else if (l.tag === "audio") {
9698
9698
  const p = document.createElement("audio");
9699
9699
  p.controls = !0;
9700
9700
  let b = document.createElement("source");
9701
- b.src = l.url, b.type = "audio/mp3", p.appendChild(b), u.appendChild(p);
9701
+ b.src = l.url, b.type = "audio/mp3", p.appendChild(b), d.appendChild(p);
9702
9702
  } else if (l.tag === "img") {
9703
9703
  const p = document.createElement("img");
9704
- p.src = l.url, p.setAttribute("alt", this.out("Output Image")), u.appendChild(p);
9704
+ p.src = l.url, p.setAttribute("alt", this.out("Output Image")), d.appendChild(p);
9705
9705
  }
9706
9706
  return;
9707
9707
  }
9708
9708
  if (l.type === "image") {
9709
9709
  const p = document.createElement("img");
9710
- p.src = l.url, p.setAttribute("alt", this.out("Output Image")), u.appendChild(p);
9710
+ p.src = l.url, p.setAttribute("alt", this.out("Output Image")), d.appendChild(p);
9711
9711
  return;
9712
9712
  }
9713
9713
  if (l.type === "video") {
9714
9714
  const p = document.createElement("video");
9715
9715
  p.style.width = "100%", p.style.height = "auto", p.controls = !0;
9716
9716
  let b = document.createElement("source");
9717
- b.src = l.url, b.type = "video/mp4", p.appendChild(b), u.appendChild(p);
9717
+ b.src = l.url, b.type = "video/mp4", p.appendChild(b), d.appendChild(p);
9718
9718
  return;
9719
9719
  }
9720
9720
  if (l.type === "audio") {
9721
9721
  const p = document.createElement("audio");
9722
9722
  p.controls = !0;
9723
9723
  let b = document.createElement("source");
9724
- b.src = l.url, b.type = "audio/mp3", p.appendChild(b), u.appendChild(p);
9724
+ b.src = l.url, b.type = "audio/mp3", p.appendChild(b), d.appendChild(p);
9725
9725
  return;
9726
9726
  }
9727
9727
  }
@@ -9733,15 +9733,15 @@ class yn {
9733
9733
  let s = localStorage.getItem("_results_html");
9734
9734
  const r = document.querySelector(this.settings.resultSelector);
9735
9735
  r.innerHTML = s, this.addResultTool(), r.querySelectorAll(".link-download").forEach((a) => {
9736
- a.addEventListener("click", async (d) => {
9737
- d.preventDefault();
9738
- const u = d.target.href;
9736
+ a.addEventListener("click", async (u) => {
9737
+ u.preventDefault();
9738
+ const d = u.target.href;
9739
9739
  try {
9740
- const l = await fetch(u, {
9740
+ const l = await fetch(d, {
9741
9741
  mode: "cors"
9742
9742
  });
9743
9743
  if (!l.ok) throw new Error("Failed to fetch the image.");
9744
- const h = await l.blob(), p = u.substring(u.lastIndexOf("/") + 1), b = document.createElement("a");
9744
+ const h = await l.blob(), p = d.substring(d.lastIndexOf("/") + 1), b = document.createElement("a");
9745
9745
  b.href = URL.createObjectURL(h), b.download = p, b.click(), URL.revokeObjectURL(b.href);
9746
9746
  } catch (l) {
9747
9747
  console.error("Error downloading the image:", l);
@@ -9816,15 +9816,15 @@ class yn {
9816
9816
  let r = [], o = [];
9817
9817
  if (this.settings.scrapeProvider === "firecrawl" && s.forEach((a) => {
9818
9818
  if (a.success) {
9819
- const d = a.metadata.title, u = a.markdown, l = a.metadata.url;
9819
+ const u = a.metadata.title, d = a.markdown, l = a.metadata.url;
9820
9820
  r.push(l), n += `
9821
9821
 
9822
9822
 
9823
- ## ${d}
9823
+ ## ${u}
9824
9824
 
9825
9825
  Source: ${l}
9826
9826
 
9827
- ${u}
9827
+ ${d}
9828
9828
 
9829
9829
 
9830
9830
  ----------------
@@ -9832,24 +9832,24 @@ class yn {
9832
9832
 
9833
9833
  `;
9834
9834
  } else {
9835
- let d = a.url;
9836
- if (d) {
9837
- const u = a.url;
9838
- o.push(u);
9835
+ let u = a.url;
9836
+ if (u) {
9837
+ const d = a.url;
9838
+ o.push(d);
9839
9839
  } else
9840
- d = a.url.link, o.push(d);
9840
+ u = a.url.link, o.push(u);
9841
9841
  }
9842
9842
  }), this.settings.scrapeProvider === "scrapingbee")
9843
9843
  for (let a = 0; a < s.length; a++) {
9844
- let d = e[a];
9845
- r.push(d);
9846
- let u = s[a];
9844
+ let u = e[a];
9845
+ r.push(u);
9846
+ let d = s[a];
9847
9847
  n += `
9848
9848
 
9849
9849
 
9850
- ## ${d}
9850
+ ## ${u}
9851
9851
 
9852
- ${u}
9852
+ ${d}
9853
9853
 
9854
9854
 
9855
9855
  ----------------
@@ -9939,26 +9939,26 @@ ${e}`);
9939
9939
  this.settings.consoleLog && console.log(r);
9940
9940
  let o = [], a = [];
9941
9941
  if (r.url && r.needscrape && this.settings.scrapeUrl) {
9942
- let d = document.createElement("p");
9943
- d.innerHTML = this.out("Fetching data from the web..."), n.appendChild(d);
9944
- let u = [];
9945
- r.url && u.push(r.url), r.url2 && u.push(r.url2), r.url3 && u.push(r.url3), r.url4 && u.push(r.url4), r.url5 && u.push(r.url5), r.url6 && u.push(r.url6), r.url7 && u.push(r.url7), r.url8 && u.push(r.url8);
9946
- let l = await this.scrapeUrls(u);
9942
+ let u = document.createElement("p");
9943
+ u.innerHTML = this.out("Fetching data from the web..."), n.appendChild(u);
9944
+ let d = [];
9945
+ r.url && d.push(r.url), r.url2 && d.push(r.url2), r.url3 && d.push(r.url3), r.url4 && d.push(r.url4), r.url5 && d.push(r.url5), r.url6 && d.push(r.url6), r.url7 && d.push(r.url7), r.url8 && d.push(r.url8);
9946
+ let l = await this.scrapeUrls(d);
9947
9947
  s += l.data, o = l.urls, a = l.failed;
9948
9948
  } else if (this.settings.searchUrl && this.settings.scrapeUrl) {
9949
- let d = document.createElement("p");
9950
- d.innerHTML = this.out("Searching the web.."), n.appendChild(d);
9951
- let u = await this.search(e);
9949
+ let u = document.createElement("p");
9950
+ u.innerHTML = this.out("Searching the web.."), n.appendChild(u);
9951
+ let d = await this.search(e);
9952
9952
  const l = this.settings.scrapeExclude;
9953
- let h = u.filter((g) => {
9954
- let v = new URL(g.link).hostname;
9953
+ let h = d.filter((m) => {
9954
+ let v = new URL(m.link).hostname;
9955
9955
  return !l.some((f) => v.includes(f));
9956
9956
  });
9957
9957
  const p = this.settings.scrapeLimit, b = h.slice(0, p);
9958
- n.innerHTML = "", d = document.createElement("p"), d.innerHTML = this.out("Getting more information..."), n.appendChild(d);
9958
+ n.innerHTML = "", u = document.createElement("p"), u.innerHTML = this.out("Getting more information..."), n.appendChild(u);
9959
9959
  let w = [];
9960
- for (let g = 0; g < b.length; g++)
9961
- w.push(u[g].link);
9960
+ for (let m = 0; m < b.length; m++)
9961
+ w.push(d[m].link);
9962
9962
  let _ = await this.scrapeUrls(w);
9963
9963
  s += _.data, o = _.urls, a = _.failed;
9964
9964
  }
@@ -10022,8 +10022,8 @@ ${e}`);
10022
10022
  return;
10023
10023
  }
10024
10024
  let t = !1, n = !1;
10025
- this.steps.forEach((m) => {
10026
- m.prompt.trim().startsWith("{") && (t = !0), m.tools && (m.tools.image || m.tools.video || m.tools.audio) && (t = !0), m.tools && m.tools.search && (n = !0);
10025
+ this.steps.forEach((g) => {
10026
+ g.prompt.trim().startsWith("{") && (t = !0), g.tools && (g.tools.image || g.tools.video || g.tools.audio) && (t = !0), g.tools && g.tools.search && (n = !0);
10027
10027
  });
10028
10028
  let s;
10029
10029
  if (t && this.settings.disableMediaGeneration) {
@@ -10062,8 +10062,8 @@ ${e}`);
10062
10062
  r = this.element;
10063
10063
  let o = r.querySelector(".btn-submitform"), a = o.innerHTML;
10064
10064
  this.tokenInput = 0, this.tokenOutput = 0;
10065
- let d = !1;
10066
- if (e != null && (d = !0), this.singleStep = d, d || (this.filesUploaded = {}), this.isNormal && !d) {
10065
+ let u = !1;
10066
+ if (e != null && (u = !0), this.singleStep = u, u || (this.filesUploaded = {}), this.isNormal && !u) {
10067
10067
  if (this.isMediaGenerating) {
10068
10068
  alert(this.out("The media generation process cannot be aborted."));
10069
10069
  return;
@@ -10071,9 +10071,9 @@ ${e}`);
10071
10071
  this.abort(), o.innerHTML = a, o.removeAttribute("disabled"), this.isGenerating = !1;
10072
10072
  return;
10073
10073
  }
10074
- if (this.isNormal && d || this.isSingle && !d || this.isSingle && d)
10074
+ if (this.isNormal && u || this.isSingle && !u || this.isSingle && u)
10075
10075
  return;
10076
- this.isNormal = !1, this.isSingle = !1, d ? (o.innerHTML = `
10076
+ this.isNormal = !1, this.isSingle = !1, u ? (o.innerHTML = `
10077
10077
  <span class="loading-icon">
10078
10078
  <svg class="animate-spin" style="margin: 0;margin-right: 0.6rem;width: 1rem;height: 1rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
10079
10079
  <circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
@@ -10089,19 +10089,19 @@ ${e}`);
10089
10089
  </span>
10090
10090
  ${this.out("Abort")}
10091
10091
  `, this.isNormal = !0), this.isGenerating = !0;
10092
- let u = (m, y) => {
10093
- if (m === void 0) return "";
10094
- if (!isNaN(m)) return m;
10095
- let k = m;
10096
- return y && y.trim().startsWith("{") && (k = JSON.stringify(m).slice(1, -1)), k;
10092
+ let d = (g, y) => {
10093
+ if (g === void 0) return "";
10094
+ if (!isNaN(g)) return g;
10095
+ let k = g;
10096
+ return y && y.trim().startsWith("{") && (k = JSON.stringify(g).slice(1, -1)), k;
10097
10097
  };
10098
10098
  i.innerHTML = "";
10099
10099
  let l = JSON.parse(JSON.stringify(this.steps)), h = this.getFormValues();
10100
10100
  if (!h) return;
10101
10101
  if (!(h && Object.keys(h).length === 0)) {
10102
- for (const m of l) {
10103
- let y = m.prompt;
10104
- if (m.provider === "google") {
10102
+ for (const g of l) {
10103
+ let y = g.prompt;
10104
+ if (g.provider === "google") {
10105
10105
  for (const x of h)
10106
10106
  if (x.value instanceof FileList && x.value.length > 0) {
10107
10107
  const E = x.value[0];
@@ -10116,27 +10116,27 @@ ${e}`);
10116
10116
  y = y.replaceAll(`{{${x.name}}}`, L), y = y.replaceAll(`{{${x.name.toUpperCase()}}}`, L);
10117
10117
  }
10118
10118
  }
10119
- m.prompt = y;
10119
+ g.prompt = y;
10120
10120
  }
10121
- l.forEach((m) => {
10122
- let y = m.prompt;
10121
+ l.forEach((g) => {
10122
+ let y = g.prompt;
10123
10123
  h.forEach((k) => {
10124
10124
  if (k.value === void 0 && (k.value = ""), typeof k.value == "object" && Array.isArray(k.value)) {
10125
10125
  const x = k.value.join(", ");
10126
10126
  y = y.replaceAll(`{{${k.name}}}`, x), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, x);
10127
- } else k.value instanceof FileList || typeof k.value == "string" && k.value.indexOf("base64") !== -1 ? (y = y.replaceAll(`{{${k.name}}}`, k.name), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, k.name)) : (y = y.replaceAll(`{{${k.name}}}`, u(k.value, m.prompt)), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, u(k.value, m.prompt)));
10128
- }), m.prompt = y;
10129
- }), l.forEach((m) => {
10130
- let y = m.context;
10127
+ } else k.value instanceof FileList || typeof k.value == "string" && k.value.indexOf("base64") !== -1 ? (y = y.replaceAll(`{{${k.name}}}`, k.name), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, k.name)) : (y = y.replaceAll(`{{${k.name}}}`, d(k.value, g.prompt)), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, d(k.value, g.prompt)));
10128
+ }), g.prompt = y;
10129
+ }), l.forEach((g) => {
10130
+ let y = g.context;
10131
10131
  h.forEach((k) => {
10132
10132
  if (k.value || (k.value = ""), typeof k.value == "object" && Array.isArray(k.value)) {
10133
10133
  const x = k.value.join(", ");
10134
10134
  y = y.replaceAll(`{{${k.name}}}`, x), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, x);
10135
- } else k.value instanceof FileList || typeof k.value == "string" && k.value.indexOf("base64") !== -1 ? (y = y.replaceAll(`{{${k.name}}}`, k.name), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, k.name)) : (y = y.replaceAll(`{{${k.name}}}`, u(k.value, m.prompt)), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, u(k.value, m.prompt)));
10136
- }), m.context = y;
10135
+ } else k.value instanceof FileList || typeof k.value == "string" && k.value.indexOf("base64") !== -1 ? (y = y.replaceAll(`{{${k.name}}}`, k.name), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, k.name)) : (y = y.replaceAll(`{{${k.name}}}`, d(k.value, g.prompt)), y = y.replaceAll(`{{${k.name.toUpperCase()}}}`, d(k.value, g.prompt)));
10136
+ }), g.context = y;
10137
10137
  });
10138
10138
  }
10139
- const p = async (m, y, k, x, S, E, L, M) => {
10139
+ const p = async (g, y, k, x, S, E, L, M) => {
10140
10140
  const C = document.createElement("div");
10141
10141
  C.classList.add("result-container"), i.appendChild(C), C.innerHTML = `
10142
10142
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 20" width="27" height="20" fill="currentColor">
@@ -10152,13 +10152,13 @@ ${e}`);
10152
10152
  </svg>
10153
10153
  `;
10154
10154
  let D = !1, O;
10155
- if (m.trim().startsWith("{"))
10155
+ if (g.trim().startsWith("{"))
10156
10156
  try {
10157
- O = JSON.parse(m), O && typeof O == "object" && (D = !0);
10157
+ O = JSON.parse(g), O && typeof O == "object" && (D = !0);
10158
10158
  } catch {
10159
10159
  return C.innerHTML = `<p>${this.out("Incorrect JSON format.")}</p>`, !1;
10160
10160
  }
10161
- (L && (L.image || L.video || L.audio) || D) && (d || (o.innerHTML = `&nbsp;
10161
+ (L && (L.image || L.video || L.audio) || D) && (u || (o.innerHTML = `&nbsp;
10162
10162
  <span class="loading-icon" style="width:60px;display:flex;align-items:center;justify-content:center">
10163
10163
  <svg class="animate-spin" style="margin: 0;width: 1.25rem;height: 1.25rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
10164
10164
  <circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
@@ -10168,12 +10168,12 @@ ${e}`);
10168
10168
  &nbsp;
10169
10169
  `, o.setAttribute("disabled", "")));
10170
10170
  let $ = "", R = "", q;
10171
- if (L && L.search && (q = await this.getRelevantInfo(m, y, C), q.data !== "" && (y += `
10171
+ if (L && L.search && (q = await this.getRelevantInfo(g, y, C), q.data !== "" && (y += `
10172
10172
  Use the following information to answer the request:
10173
10173
 
10174
10174
  ${q.data}
10175
10175
  `)), L && (L.image || L.video || L.audio) || D) {
10176
- const A = await this.media.generate(m, y, k, x, L, C, M);
10176
+ const A = await this.media.generate(g, y, k, x, L, C, M);
10177
10177
  return this.needCleanup = !0, this.settings.consoleLog && console.log(A), A.mediaGenerated ? {
10178
10178
  media: A.output,
10179
10179
  media2: A.output2,
@@ -10182,7 +10182,7 @@ ${q.data}
10182
10182
  }
10183
10183
  if (this.settings.assistantId) {
10184
10184
  if (this.settings.assistantStreamUrl)
10185
- await this.assistantStream(m, y, S, E, async (A) => {
10185
+ await this.assistantStream(g, y, S, E, async (A) => {
10186
10186
  if (!(A && typeof A == "object")) {
10187
10187
  if ($ += A, !M) {
10188
10188
  const T = z.parse($);
@@ -10196,7 +10196,7 @@ ${q.data}
10196
10196
  }, 10);
10197
10197
  }), M && (C.innerHTML = "", C.remove()), this.outputHtml += `<div class="result-container">${R}</div>`;
10198
10198
  else if (this.settings.assistantUrl) {
10199
- let A = await this.assistant(m, y, S, E);
10199
+ let A = await this.assistant(g, y, S, E);
10200
10200
  if (!A)
10201
10201
  return !1;
10202
10202
  if ($ = A, M)
@@ -10218,7 +10218,7 @@ ${q.data}
10218
10218
  await new Promise((W) => setTimeout(W, 50));
10219
10219
  }
10220
10220
  };
10221
- await this.sendStream(m, y, S, x, E, async (U) => {
10221
+ await this.sendStream(g, y, S, x, E, async (U) => {
10222
10222
  $ += U, A += U, await P(U);
10223
10223
  }), await new Promise((U) => {
10224
10224
  const F = setInterval(() => {
@@ -10226,7 +10226,7 @@ ${q.data}
10226
10226
  }, 10);
10227
10227
  }), M && (C.innerHTML = "", C.remove()), this.outputHtml += `<div class="result-container">${T}</div>`;
10228
10228
  } else {
10229
- let A = await this.send(m, y, S, x, E);
10229
+ let A = await this.send(g, y, S, x, E);
10230
10230
  if (!A)
10231
10231
  return !1;
10232
10232
  if ($ = A, M)
@@ -10250,16 +10250,16 @@ ${q.data}
10250
10250
  }
10251
10251
  }
10252
10252
  return this.payloads.push({
10253
- prompt: m,
10253
+ prompt: g,
10254
10254
  context: y
10255
10255
  }), this.output.push($), {
10256
10256
  media: [],
10257
10257
  markdown: $
10258
10258
  };
10259
10259
  };
10260
- d || await (async (m) => {
10260
+ u || await (async (g) => {
10261
10261
  this.previousResults = [], this.outputHtml = "";
10262
- for (let y = 0; y < m.length; y++) {
10262
+ for (let y = 0; y < g.length; y++) {
10263
10263
  if (!this.isGenerating)
10264
10264
  return;
10265
10265
  let {
@@ -10271,15 +10271,15 @@ ${q.data}
10271
10271
  functs: M,
10272
10272
  tools: C,
10273
10273
  hideOutput: D
10274
- } = m[y];
10274
+ } = g[y];
10275
10275
  S = S || "", x = x || "", L = L || "You are an assistant", M = M || [];
10276
10276
  let O = k;
10277
10277
  this.previousResults.forEach((R, q) => {
10278
10278
  const A = `{{output_step_${q + 1}}}`;
10279
- O = O.replace(new RegExp(A, "g"), u(R, k)), O = O.replace(new RegExp(A.toUpperCase(), "g"), u(R, k));
10279
+ O = O.replace(new RegExp(A, "g"), d(R, k)), O = O.replace(new RegExp(A.toUpperCase(), "g"), d(R, k));
10280
10280
  }), k = O, k = k.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g, " ").trim(), this.settings.consoleLog && console.log(k), O = x, this.previousResults.forEach((R, q) => {
10281
10281
  const A = `{{output_step_${q + 1}}}`;
10282
- O = O.replace(new RegExp(A, "g"), u(R, k)), O = O.replace(new RegExp(A.toUpperCase(), "g"), u(R, k));
10282
+ O = O.replace(new RegExp(A, "g"), d(R, k)), O = O.replace(new RegExp(A.toUpperCase(), "g"), d(R, k));
10283
10283
  }), x = O, x = x.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g, " ").trim();
10284
10284
  let $ = await p(k, x, S, E, L, M, C, D);
10285
10285
  if (!$)
@@ -10290,7 +10290,7 @@ ${q.data}
10290
10290
  } else
10291
10291
  this.previousResults.push($.markdown);
10292
10292
  }
10293
- })(l), d && (e === 0 && (this.previousResults = []), await (async (y, k) => {
10293
+ })(l), u && (e === 0 && (this.previousResults = []), await (async (y, k) => {
10294
10294
  if (!this.isGenerating)
10295
10295
  return;
10296
10296
  let {
@@ -10322,9 +10322,9 @@ ${q.data}
10322
10322
  })(l, e)), o.innerHTML = a, o.removeAttribute("disabled"), this.isGenerating = !1;
10323
10323
  const w = this.calculateCost();
10324
10324
  this.settings.onUsage && this.settings.onUsage(w), this.trigger("usage", w), this.isNormal = !1, this.isSingle = !1;
10325
- const _ = (m, y = 100) => {
10325
+ const _ = (g, y = 100) => {
10326
10326
  const k = document.createElement("div");
10327
- if (k.innerHTML = m, k.querySelector("video"))
10327
+ if (k.innerHTML = g, k.querySelector("video"))
10328
10328
  return "Video";
10329
10329
  if (k.querySelector("img"))
10330
10330
  return "Image";
@@ -10332,21 +10332,21 @@ ${q.data}
10332
10332
  return "Audio";
10333
10333
  const x = k.textContent.trim();
10334
10334
  return x.length > y ? x.substring(0, y) + "..." : x;
10335
- }, g = Object.keys(this.filesUploaded).length === 0 && this.filesUploaded.constructor === Object;
10336
- if (this.needCleanup && !g) {
10335
+ }, m = Object.keys(this.filesUploaded).length === 0 && this.filesUploaded.constructor === Object;
10336
+ if (this.needCleanup && !m) {
10337
10337
  this.settings.consoleLog && (console.log("Cleanup"), console.log(this.filesUploaded));
10338
- let m = {
10338
+ let g = {
10339
10339
  "Content-Type": "application/json",
10340
10340
  ...this.settings.headers
10341
10341
  };
10342
10342
  await fetch(this.settings.cleanup, {
10343
10343
  method: "POST",
10344
- headers: m,
10344
+ headers: g,
10345
10345
  body: JSON.stringify(this.filesUploaded)
10346
10346
  });
10347
10347
  }
10348
10348
  let v = this.outputHtml;
10349
- this.mediaGenerated = this.mediaGenerated.filter((m) => v.indexOf(m) !== -1), this.trigger("resultReady", {
10349
+ this.mediaGenerated = this.mediaGenerated.filter((g) => v.indexOf(g) !== -1), this.trigger("resultReady", {
10350
10350
  previewText: _(v),
10351
10351
  markdown: this.previousResults,
10352
10352
  html: v,
@@ -10354,8 +10354,8 @@ ${q.data}
10354
10354
  // return the collected generated media from all steps
10355
10355
  input: this.payloads,
10356
10356
  output: this.output
10357
- }), this.settings.saveResults && (localStorage.setItem("_results", JSON.stringify(this.previousResults)), localStorage.setItem("_results_html", v)), this.addResultTool(), i.querySelectorAll(".link-download").forEach((m) => {
10358
- m.addEventListener("click", async (y) => {
10357
+ }), this.settings.saveResults && (localStorage.setItem("_results", JSON.stringify(this.previousResults)), localStorage.setItem("_results_html", v)), this.addResultTool(), i.querySelectorAll(".link-download").forEach((g) => {
10358
+ g.addEventListener("click", async (y) => {
10359
10359
  y.preventDefault();
10360
10360
  const k = y.target.href;
10361
10361
  try {
@@ -10406,66 +10406,66 @@ ${q.data}
10406
10406
  let {
10407
10407
  name: o,
10408
10408
  type: a,
10409
- value: d,
10410
- checked: u,
10409
+ value: u,
10410
+ checked: d,
10411
10411
  files: l
10412
10412
  } = r;
10413
10413
  if (a === "checkbox")
10414
- o = o.replace("[]", ""), u && (t[o] = t[o] || [], d === "other" && (d = e.querySelector(`[name="${o + "_other"}"]`).value), t[o].push(d));
10414
+ o = o.replace("[]", ""), d && (t[o] = t[o] || [], u === "other" && (u = e.querySelector(`[name="${o + "_other"}"]`).value), t[o].push(u));
10415
10415
  else if (a === "radio")
10416
- u && (d === "other" && (d = e.querySelector(`[name="${o + "_other"}"]`).value), t[o] = d);
10416
+ d && (u === "other" && (u = e.querySelector(`[name="${o + "_other"}"]`).value), t[o] = u);
10417
10417
  else if (a === "select-one")
10418
- d === "other" && (d = e.querySelector(`[name="${o + "_other"}"]`).value), t[o] = d;
10418
+ u === "other" && (u = e.querySelector(`[name="${o + "_other"}"]`).value), t[o] = u;
10419
10419
  else if (a === "file")
10420
10420
  t[o] = l;
10421
10421
  else if (a === "select-multiple") {
10422
10422
  const h = Array.from(r.selectedOptions);
10423
10423
  t[o] = h.map((p) => p.value);
10424
10424
  } else if (a === "color") {
10425
- t[o] = d;
10426
- const h = this.hexToRgb(d);
10425
+ t[o] = u;
10426
+ const h = this.hexToRgb(u);
10427
10427
  t[o + "_red"] = h.red, t[o + "_green"] = h.green, t[o + "_blue"] = h.blue;
10428
10428
  } else
10429
- t[o] = d;
10429
+ t[o] = u;
10430
10430
  });
10431
10431
  let n = [];
10432
10432
  return this.json.elements.forEach((r) => {
10433
- let o = r.title, a = r.name, d = r.type;
10433
+ let o = r.title, a = r.name, u = r.type;
10434
10434
  if (a === "") return;
10435
- let u = t[a], l = {
10435
+ let d = t[a], l = {
10436
10436
  questions: o,
10437
10437
  name: a,
10438
- value: u,
10439
- type: d
10438
+ value: d,
10439
+ type: u
10440
10440
  };
10441
10441
  n.push(l);
10442
10442
  let h = a + "__url";
10443
- u = t[h], u && (l = {
10443
+ d = t[h], d && (l = {
10444
10444
  questions: o,
10445
10445
  name: h,
10446
- value: u
10447
- }, n.push(l)), r.useImageMask && (a = a + "_mask", u = t[a], l = {
10446
+ value: d
10447
+ }, n.push(l)), r.useImageMask && (a = a + "_mask", d = t[a], l = {
10448
10448
  questions: o,
10449
10449
  name: a,
10450
- value: u
10450
+ value: d
10451
10451
  }, n.push(l));
10452
10452
  let p = a + "_red";
10453
- u = t[p], u !== void 0 && (l = {
10453
+ d = t[p], d !== void 0 && (l = {
10454
10454
  questions: o,
10455
10455
  name: p,
10456
- value: u
10456
+ value: d
10457
10457
  }, n.push(l));
10458
10458
  let b = a + "_green";
10459
- u = t[b], u !== void 0 && (l = {
10459
+ d = t[b], d !== void 0 && (l = {
10460
10460
  questions: o,
10461
10461
  name: b,
10462
- value: u
10462
+ value: d
10463
10463
  }, n.push(l));
10464
10464
  let w = a + "_blue";
10465
- u = t[w], u !== void 0 && (l = {
10465
+ d = t[w], d !== void 0 && (l = {
10466
10466
  questions: o,
10467
10467
  name: w,
10468
- value: u
10468
+ value: d
10469
10469
  }, n.push(l));
10470
10470
  }), this.settings.consoleLog && console.log(n), n;
10471
10471
  }
@@ -10487,7 +10487,7 @@ ${q.data}
10487
10487
  this.controller = new AbortController(), this.signal = this.controller.signal;
10488
10488
  let r = 0.6, o = 0.9, a = 1;
10489
10489
  s || (s = []), n = n || this.settings.model, s.length > 0 && (n = this.settings.model2);
10490
- const d = {
10490
+ const u = {
10491
10491
  question: e,
10492
10492
  context: i,
10493
10493
  system: t,
@@ -10499,15 +10499,15 @@ ${q.data}
10499
10499
  customData: this.settings.customData
10500
10500
  };
10501
10501
  try {
10502
- let u = {
10502
+ let d = {
10503
10503
  "Content-Type": "application/json",
10504
10504
  ...this.settings.headers
10505
10505
  }, h = await (await fetch(this.settings.sendCommandUrl, {
10506
10506
  signal: this.signal,
10507
10507
  // Abort
10508
10508
  method: "POST",
10509
- headers: u,
10510
- body: JSON.stringify(d)
10509
+ headers: d,
10510
+ body: JSON.stringify(u)
10511
10511
  })).json();
10512
10512
  if (h.error)
10513
10513
  return console.log(`Error:
@@ -10519,22 +10519,22 @@ ${q.data}
10519
10519
  }), p;
10520
10520
  } else
10521
10521
  return h.answer;
10522
- } catch (u) {
10523
- return u.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", u), !1;
10522
+ } catch (d) {
10523
+ return d.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", d), !1;
10524
10524
  }
10525
10525
  }
10526
10526
  async sendStream(e, i, t, n, s, r) {
10527
10527
  this.controller = new AbortController(), this.signal = this.controller.signal;
10528
- let o = 0.6, a = 0.9, d = 1;
10528
+ let o = 0.6, a = 0.9, u = 1;
10529
10529
  s || (s = []), n = n || this.settings.model;
10530
- const u = {
10530
+ const d = {
10531
10531
  question: e,
10532
10532
  context: i,
10533
10533
  system: t,
10534
10534
  functs: s,
10535
10535
  temperature: o,
10536
10536
  topP: a,
10537
- num: d,
10537
+ num: u,
10538
10538
  model: n,
10539
10539
  customData: this.settings.customData
10540
10540
  };
@@ -10548,7 +10548,7 @@ ${q.data}
10548
10548
  // Abort
10549
10549
  method: "POST",
10550
10550
  headers: l,
10551
- body: JSON.stringify(u)
10551
+ body: JSON.stringify(d)
10552
10552
  });
10553
10553
  if (!h.ok)
10554
10554
  return console.error("Error:", h.statusText), !1;
@@ -10556,19 +10556,19 @@ ${q.data}
10556
10556
  let w = "", _ = !1;
10557
10557
  for (; !_; ) {
10558
10558
  const {
10559
- done: g,
10559
+ done: m,
10560
10560
  value: v
10561
10561
  } = await p.read();
10562
- if (_ = g, _) break;
10562
+ if (_ = m, _) break;
10563
10563
  const f = b.decode(v, {
10564
10564
  stream: !0
10565
10565
  });
10566
10566
  w += f;
10567
- const m = w.split(`
10567
+ const g = w.split(`
10568
10568
  `);
10569
10569
  w = "";
10570
10570
  let y = 0, k = 0;
10571
- for (const x of m)
10571
+ for (const x of g)
10572
10572
  if (x.trim() !== "" && x.startsWith("data:")) {
10573
10573
  const S = x.slice(5).trim();
10574
10574
  if (S === "[DONE]") {
@@ -10599,7 +10599,7 @@ ${q.data}
10599
10599
  n || (n = []);
10600
10600
  let a = this.settings.model;
10601
10601
  n.length > 0 && (a = this.settings.model2);
10602
- const d = {
10602
+ const u = {
10603
10603
  assistantId: this.settings.assistantId,
10604
10604
  question: e,
10605
10605
  context: i,
@@ -10612,27 +10612,27 @@ ${q.data}
10612
10612
  customData: this.settings.customData
10613
10613
  };
10614
10614
  try {
10615
- let u = {
10615
+ let d = {
10616
10616
  "Content-Type": "application/json",
10617
10617
  ...this.settings.headers
10618
10618
  }, h = await (await fetch(this.settings.assistantUrl, {
10619
10619
  signal: this.signal,
10620
10620
  // Abort
10621
10621
  method: "POST",
10622
- headers: u,
10623
- body: JSON.stringify(d)
10622
+ headers: d,
10623
+ body: JSON.stringify(u)
10624
10624
  })).json();
10625
10625
  return h.error ? (console.log(`Error:
10626
10626
  ` + h.error), !1) : (h.usage && (this.tokenInput += h.usage.prompt_tokens, this.tokenOutput += h.usage.completion_tokens), h.answer.content[0].text.value);
10627
- } catch (u) {
10628
- return u.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", u), !1;
10627
+ } catch (d) {
10628
+ return d.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", d), !1;
10629
10629
  }
10630
10630
  }
10631
10631
  async assistantStream(e, i, t, n, s) {
10632
10632
  this.controller = new AbortController(), this.signal = this.controller.signal;
10633
10633
  let r = 0.6, o = 0.9, a = 1;
10634
10634
  n || (n = []);
10635
- const d = {
10635
+ const u = {
10636
10636
  assistantId: this.settings.assistantId,
10637
10637
  question: e,
10638
10638
  context: i,
@@ -10645,7 +10645,7 @@ ${q.data}
10645
10645
  customData: this.settings.customData
10646
10646
  };
10647
10647
  try {
10648
- let u = {
10648
+ let d = {
10649
10649
  "Content-Type": "application/json",
10650
10650
  ...this.settings.headers
10651
10651
  };
@@ -10653,8 +10653,8 @@ ${q.data}
10653
10653
  signal: this.signal,
10654
10654
  // Abort
10655
10655
  method: "POST",
10656
- headers: u,
10657
- body: JSON.stringify(d)
10656
+ headers: d,
10657
+ body: JSON.stringify(u)
10658
10658
  });
10659
10659
  if (!l.ok)
10660
10660
  return console.error("Error:", l.statusText), !1;
@@ -10663,20 +10663,20 @@ ${q.data}
10663
10663
  for (; !w; ) {
10664
10664
  const {
10665
10665
  done: _,
10666
- value: g
10666
+ value: m
10667
10667
  } = await h.read();
10668
10668
  if (w = _, w) break;
10669
- const v = p.decode(g, {
10669
+ const v = p.decode(m, {
10670
10670
  stream: !0
10671
10671
  });
10672
10672
  b += v;
10673
10673
  const f = b.split(`
10674
10674
  `);
10675
10675
  b = "";
10676
- for (const m of f)
10677
- if (m.trim() !== "")
10678
- if (m.startsWith("data:")) {
10679
- const y = m.slice(5).trim();
10676
+ for (const g of f)
10677
+ if (g.trim() !== "")
10678
+ if (g.startsWith("data:")) {
10679
+ const y = g.slice(5).trim();
10680
10680
  y === "[DONE]" && this.settings.consoleLog && console.log("Stream completed.");
10681
10681
  try {
10682
10682
  const k = JSON.parse(y);
@@ -10685,18 +10685,18 @@ ${q.data}
10685
10685
  s && s(x);
10686
10686
  }
10687
10687
  } catch {
10688
- b += m + `
10688
+ b += g + `
10689
10689
  `;
10690
10690
  }
10691
10691
  } else {
10692
- const y = JSON.parse(m);
10692
+ const y = JSON.parse(g);
10693
10693
  this.tokenInput += y.prompt_tokens, this.tokenOutput += y.completion_tokens;
10694
10694
  break;
10695
10695
  }
10696
10696
  }
10697
10697
  return !0;
10698
- } catch (u) {
10699
- return u.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", u), !1;
10698
+ } catch (d) {
10699
+ return d.name === "AbortError" ? this.settings.consoleLog && console.log("Request aborted by user.") : console.error("Error:", d), !1;
10700
10700
  }
10701
10701
  }
10702
10702
  hexToRgb(e) {
@@ -10743,7 +10743,34 @@ ${q.data}
10743
10743
  return i || e;
10744
10744
  }
10745
10745
  }
10746
- class vn {
10746
+ const vn = 3e3;
10747
+ function wn(c = document) {
10748
+ const e = Date.now(), i = /* @__PURE__ */ new WeakSet(), t = /* @__PURE__ */ new WeakSet(), n = (u) => !!(u && u.matches && u.matches("form[data-cb-protect]") && !u.closest('[contenteditable="true"], .is-builder')), s = (u) => u && u.form instanceof HTMLFormElement ? u.form : u && u.closest ? u.closest("form") : null, r = (u) => {
10749
+ if (!u.isTrusted) return;
10750
+ const d = s(u.target);
10751
+ n(d) && i.add(d);
10752
+ }, o = (u) => {
10753
+ const d = u.target;
10754
+ if (!n(d)) return;
10755
+ const l = (d.getAttribute("data-cb-protect") || "").split(/\s+/);
10756
+ if (l.includes("typed") && !i.has(d)) {
10757
+ u.preventDefault(), u.stopImmediatePropagation();
10758
+ return;
10759
+ }
10760
+ const h = vn - (Date.now() - e);
10761
+ if (l.includes("wait") && h > 0 && (u.preventDefault(), u.stopImmediatePropagation(), i.has(d) && !t.has(d))) {
10762
+ t.add(d);
10763
+ const p = u.submitter && u.submitter.form === d ? u.submitter : null;
10764
+ setTimeout(() => {
10765
+ t.delete(d), d.isConnected && d.requestSubmit(p || void 0);
10766
+ }, h);
10767
+ }
10768
+ }, a = ["keydown", "pointerdown", "click", "input", "change"];
10769
+ return a.forEach((u) => c.addEventListener(u, r, !0)), c.addEventListener("submit", o, !0), () => {
10770
+ a.forEach((u) => c.removeEventListener(u, r, !0)), c.removeEventListener("submit", o, !0);
10771
+ };
10772
+ }
10773
+ class xn {
10747
10774
  constructor(e = {}) {
10748
10775
  const i = {
10749
10776
  skin: "light"
@@ -10751,7 +10778,7 @@ class vn {
10751
10778
  this.settings = { ...i, ...e }, window.Glide = Ms, window.FormViewer = yn;
10752
10779
  }
10753
10780
  init() {
10754
- this.blockInit();
10781
+ this.formGuardOff || (this.formGuardOff = wn()), this.blockInit();
10755
10782
  const e = {
10756
10783
  touchNavigation: !0,
10757
10784
  selector: ".glightbox",
@@ -10783,13 +10810,13 @@ class vn {
10783
10810
  if (i) {
10784
10811
  const o = i.closest("[data-gallery]");
10785
10812
  let a = [];
10786
- o ? a = o.querySelectorAll(".is-lightbox") : document.querySelectorAll(".is-lightbox,.block-click").forEach((u) => {
10787
- u.closest("[data-gallery]") || a.push(u);
10788
- }), a.forEach((d, u) => {
10789
- let l = d.getAttribute("href");
10790
- l || (l = d.getAttribute("data-modal-url")), n.push({
10813
+ o ? a = o.querySelectorAll(".is-lightbox") : document.querySelectorAll(".is-lightbox,.block-click").forEach((d) => {
10814
+ d.closest("[data-gallery]") || a.push(d);
10815
+ }), a.forEach((u, d) => {
10816
+ let l = u.getAttribute("href");
10817
+ l || (l = u.getAttribute("data-modal-url")), n.push({
10791
10818
  href: l
10792
- }), e === l && (s = u);
10819
+ }), e === l && (s = d);
10793
10820
  });
10794
10821
  }
10795
10822
  const r = document.activeElement;
@@ -10889,32 +10916,32 @@ class vn {
10889
10916
  let r = [];
10890
10917
  const o = s.attributes;
10891
10918
  for (let a = 0; a < o.length; a++) {
10892
- let u = o[a].name.match(/^data--h-(\d+)$/);
10893
- if (u) {
10894
- const l = parseInt(u[1], 10);
10919
+ let d = o[a].name.match(/^data--h-(\d+)$/);
10920
+ if (d) {
10921
+ const l = parseInt(d[1], 10);
10895
10922
  r.push(l);
10896
10923
  }
10897
10924
  }
10898
- r = [...new Set(r)], r.sort((a, d) => d - a);
10925
+ r = [...new Set(r)], r.sort((a, u) => u - a);
10899
10926
  for (let a = 0; a < r.length; a++) {
10900
- const d = r[a];
10927
+ const u = r[a];
10901
10928
  if (a === 0) {
10902
- if (n > d) {
10903
- let u = s.getAttribute("data--h");
10904
- u ? s.style.height = u : s.style.height = "";
10929
+ if (n > u) {
10930
+ let d = s.getAttribute("data--h");
10931
+ d ? s.style.height = d : s.style.height = "";
10905
10932
  }
10906
10933
  } else {
10907
- const u = r[a - 1];
10908
- if (u >= n && n > d) {
10909
- let l = s.getAttribute("data--h-" + u);
10934
+ const d = r[a - 1];
10935
+ if (d >= n && n > u) {
10936
+ let l = s.getAttribute("data--h-" + d);
10910
10937
  l && (s.style.height = l);
10911
10938
  }
10912
10939
  }
10913
10940
  }
10914
10941
  if (r.length > 0 && r[r.length - 1] >= n) {
10915
- const d = r[r.length - 1];
10916
- let u = s.getAttribute("data--h-" + d);
10917
- u && (s.style.height = u);
10942
+ const u = r[r.length - 1];
10943
+ let d = s.getAttribute("data--h-" + u);
10944
+ d && (s.style.height = d);
10918
10945
  }
10919
10946
  }), document.querySelectorAll(".is-block").forEach((s) => {
10920
10947
  if (!s.classList.contains("locked")) {
@@ -10925,29 +10952,29 @@ class vn {
10925
10952
  let r = [];
10926
10953
  const o = s.attributes;
10927
10954
  for (let a = 0; a < o.length; a++) {
10928
- const d = o[a].name;
10929
- let u = d.match(/^data--t-(\d+)$/);
10930
- if (u) {
10931
- const l = parseInt(u[1], 10);
10955
+ const u = o[a].name;
10956
+ let d = u.match(/^data--t-(\d+)$/);
10957
+ if (d) {
10958
+ const l = parseInt(d[1], 10);
10932
10959
  r.push(l);
10933
10960
  }
10934
- if (u = d.match(/^data--w-(\d+)$/), u) {
10935
- const l = parseInt(u[1], 10);
10961
+ if (d = u.match(/^data--w-(\d+)$/), d) {
10962
+ const l = parseInt(d[1], 10);
10936
10963
  r.push(l);
10937
10964
  }
10938
- if (u = d.match(/^data--transform-(\d+)$/), u) {
10939
- const l = parseInt(u[1], 10);
10965
+ if (d = u.match(/^data--transform-(\d+)$/), d) {
10966
+ const l = parseInt(d[1], 10);
10940
10967
  r.push(l);
10941
10968
  }
10942
10969
  }
10943
- r = [...new Set(r)], r.sort((a, d) => d - a);
10970
+ r = [...new Set(r)], r.sort((a, u) => u - a);
10944
10971
  for (let a = 0; a < r.length; a++) {
10945
- const d = r[a];
10972
+ const u = r[a];
10946
10973
  if (a === 0)
10947
- n > d && e.apply(s, 1e4, t);
10974
+ n > u && e.apply(s, 1e4, t);
10948
10975
  else {
10949
- const u = r[a - 1];
10950
- u >= n && n > d && e.apply(s, u, t);
10976
+ const d = r[a - 1];
10977
+ d >= n && n > u && e.apply(s, d, t);
10951
10978
  }
10952
10979
  }
10953
10980
  if (r.length > 0) {
@@ -10966,9 +10993,9 @@ class vn {
10966
10993
  o && o.remove();
10967
10994
  let a = "";
10968
10995
  if (r) {
10969
- const d = r.split(",");
10970
- let u = d[0].trim(), l = d[1].trim();
10971
- d.length === 3 ? a = `
10996
+ const u = r.split(",");
10997
+ let d = u[0].trim(), l = u[1].trim();
10998
+ u.length === 3 ? a = `
10972
10999
  <style id="__css_pagesize">
10973
11000
  .is-page {
10974
11001
  position: relative;
@@ -10977,15 +11004,15 @@ class vn {
10977
11004
  flex-direction: column;
10978
11005
  }
10979
11006
  .is-page {
10980
- ${(u === "100%" || u === "100vw") && (l === "100%" || l === "100vh") ? "" : "margin-top: 150px;"}
11007
+ ${(d === "100%" || d === "100vw") && (l === "100%" || l === "100vh") ? "" : "margin-top: 150px;"}
10981
11008
  }
10982
11009
  .is-box {
10983
11010
  width: 100%;
10984
- max-width: ${u};
11011
+ max-width: ${d};
10985
11012
  height: ${l};
10986
11013
  margin: 0 auto;
10987
11014
  }
10988
- ${(u === "100%" || u === "100vw") && (l === "100%" || l === "100vh") ? `
11015
+ ${(d === "100%" || d === "100vw") && (l === "100%" || l === "100vh") ? `
10989
11016
  @media print {
10990
11017
  .is-page {
10991
11018
  margin-top: 0;
@@ -11009,7 +11036,7 @@ class vn {
11009
11036
  gap: 0;
11010
11037
  }
11011
11038
  .is-box {
11012
- width: ${u};
11039
+ width: ${d};
11013
11040
  height: ${l};
11014
11041
  }
11015
11042
  .hide-on-print {
@@ -11017,7 +11044,7 @@ class vn {
11017
11044
  }
11018
11045
  }
11019
11046
  @page {
11020
- size:${u} ${l};;
11047
+ size:${d} ${l};;
11021
11048
  margin: 0;
11022
11049
  }
11023
11050
  `}
@@ -11035,7 +11062,7 @@ class vn {
11035
11062
  flex-direction: column;
11036
11063
  }
11037
11064
  .is-box {
11038
- width: ${u};
11065
+ width: ${d};
11039
11066
  height: ${l};
11040
11067
  }
11041
11068
  @media print {
@@ -11045,7 +11072,7 @@ class vn {
11045
11072
  gap: 0;
11046
11073
  }
11047
11074
  .is-box {
11048
- width: ${u};
11075
+ width: ${d};
11049
11076
  height: ${l};
11050
11077
  }
11051
11078
  .hide-on-print {
@@ -11053,7 +11080,7 @@ class vn {
11053
11080
  }
11054
11081
  }
11055
11082
  @page {
11056
- size:${u} ${l};
11083
+ size:${d} ${l};
11057
11084
  margin: 0;
11058
11085
  }
11059
11086
  </style>
@@ -11074,11 +11101,11 @@ class vn {
11074
11101
  this.Block.renderPageCss(e);
11075
11102
  }
11076
11103
  destroy() {
11077
- this.glightbox && (this.glightbox.destroy(), this.glightbox = null), document.querySelectorAll(".is-lightbox,.block-click").forEach((i) => {
11104
+ this.formGuardOff && (this.formGuardOff(), this.formGuardOff = null), this.glightbox && (this.glightbox.destroy(), this.glightbox = null), document.querySelectorAll(".is-lightbox,.block-click").forEach((i) => {
11078
11105
  i._lightboxHandler && (i.removeEventListener("click", i._lightboxHandler), delete i._lightboxHandler);
11079
11106
  }), this.resize && window.removeEventListener("resize", this.resize);
11080
11107
  }
11081
11108
  }
11082
11109
  export {
11083
- vn as default
11110
+ xn as default
11084
11111
  };