@sanity/vision 6.10.0-next.9 → 6.10.0

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.
@@ -1,6 +1,6 @@
1
- import { t as visionLocaleNamespace } from "./i18n-DWd7qwtK.js";
1
+ import { t as visionLocaleNamespace } from "./i18n-B53Bf56u.js";
2
2
  import { Component, Fragment, Suspense, use, useEffect, useImperativeHandle, useRef, useState } from "react";
3
- import { ContextMenuButton, Translate, UserAvatar, getReleaseIdFromReleaseDocumentId, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
3
+ import { ContextMenuButton, Translate, UserAvatar, VARIANTS_STUDIO_CLIENT_OPTIONS, getReleaseIdFromReleaseDocumentId, getVariantTitle, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
4
4
  import { IntentLink } from "sanity/router";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { Badge, Box, Button, Card, Container, Dialog, Flex, Grid, Heading, Hotkeys, Inline, Label, Select, Spinner, Stack, Tab, TabList, Text, TextInput, rem, useClickOutsideEvent, useTheme, useTheme_v2 } from "@sanity/ui";
@@ -290,6 +290,13 @@ function hasPinnedPerspective({ selectedPerspectiveName }) {
290
290
  function getActivePerspective({ visionPerspective, perspectiveStack, scheduledDraftsStack }) {
291
291
  return visionPerspective === "pinnedRelease" ? perspectiveStack : visionPerspective === "scheduledDrafts" ? scheduledDraftsStack : visionPerspective;
292
292
  }
293
+ /**
294
+ * The navbar variant is only sent with Vision queries when the virtual "Pinned release"
295
+ * perspective is selected. Other Vision perspectives stay local and do not attach a variant.
296
+ */
297
+ function getActiveVariant(visionPerspective, selectedVariantName) {
298
+ if (visionPerspective === "pinnedRelease") return selectedVariantName;
299
+ }
293
300
  function encodeQueryString(query, params = {}, options = {}) {
294
301
  let searchParams = new URLSearchParams();
295
302
  searchParams.set("query", query);
@@ -297,6 +304,21 @@ function encodeQueryString(query, params = {}, options = {}) {
297
304
  for (let [key, value] of Object.entries(options)) value && searchParams.set(key, `${value}`);
298
305
  return `?${searchParams}`;
299
306
  }
307
+ function acceptsNativePaste(node) {
308
+ let element = node;
309
+ return (element?.tagName === "INPUT" || element?.tagName === "TEXTAREA") && element?.readOnly === !1;
310
+ }
311
+ /**
312
+ * Whether a paste seen by Vision's `document` level listener was meant for Vision. The listener is
313
+ * global, so it also observes pastes aimed at unrelated elements such as the Studio search field.
314
+ *
315
+ * Uses the dispatch path rather than `event.target`, because CodeMirror handles the paste and
316
+ * re-renders the pasted line before the event reaches `document`, detaching the original target.
317
+ */
318
+ function isVisionPasteTarget(root, event) {
319
+ let path = event.composedPath(), [target] = path;
320
+ return acceptsNativePaste(target) ? !1 : target === window.document || target === window.document.body || root !== null && path.includes(root);
321
+ }
300
322
  function isPlainObject(obj) {
301
323
  return !!obj && typeof obj == "object" && Object.prototype.toString.call(obj) === "[object Object]";
302
324
  }
@@ -1638,94 +1660,121 @@ function _temp$3(o) {
1638
1660
  return !o;
1639
1661
  }
1640
1662
  const PinnedReleasePerspectiveOption = (t0) => {
1641
- let $ = c(11), { pinnedPerspective, t } = t0, name = typeof pinnedPerspective.selectedPerspective == "object" ? pinnedPerspective.selectedPerspective.metadata.title : pinnedPerspective.selectedPerspectiveName, t1;
1642
- $[0] !== pinnedPerspective || $[1] !== t ? (t1 = hasPinnedPerspective(pinnedPerspective) ? `(${t("settings.perspectives.pinned-release-label")})` : t("settings.perspectives.pinned-release-label"), $[0] = pinnedPerspective, $[1] = t, $[2] = t1) : t1 = $[2];
1643
- let label = t1, t2;
1644
- $[3] !== label || $[4] !== name ? (t2 = [name, label].filter(_temp$2), $[3] = label, $[4] = name, $[5] = t2) : t2 = $[5];
1645
- let text = t2.join(" "), t3;
1646
- $[6] === pinnedPerspective ? t3 = $[7] : (t3 = hasPinnedPerspective(pinnedPerspective), $[6] = pinnedPerspective, $[7] = t3);
1647
- let t4 = !t3, t5;
1648
- return $[8] !== t4 || $[9] !== text ? (t5 = /* @__PURE__ */ jsx("option", {
1663
+ let $ = c(15), { pinnedPerspective, t } = t0, name = typeof pinnedPerspective.selectedPerspective == "object" ? pinnedPerspective.selectedPerspective.metadata.title : pinnedPerspective.selectedPerspectiveName, t1;
1664
+ $[0] !== pinnedPerspective.selectedVariant || $[1] !== pinnedPerspective.selectedVariantName ? (t1 = pinnedPerspective.selectedVariant ? getVariantTitle(pinnedPerspective.selectedVariant) : pinnedPerspective.selectedVariantName, $[0] = pinnedPerspective.selectedVariant, $[1] = pinnedPerspective.selectedVariantName, $[2] = t1) : t1 = $[2];
1665
+ let variantTitle = t1, t2;
1666
+ $[3] !== pinnedPerspective || $[4] !== t ? (t2 = hasPinnedPerspective(pinnedPerspective) ? `(${t("settings.perspectives.pinned-release-label")})` : t("settings.perspectives.pinned-release-label"), $[3] = pinnedPerspective, $[4] = t, $[5] = t2) : t2 = $[5];
1667
+ let label = t2, t3 = variantTitle ? `· ${variantTitle}` : void 0, t4;
1668
+ $[6] !== label || $[7] !== name || $[8] !== t3 ? (t4 = [
1669
+ name,
1670
+ t3,
1671
+ label
1672
+ ].filter(_temp$2), $[6] = label, $[7] = name, $[8] = t3, $[9] = t4) : t4 = $[9];
1673
+ let text = t4.join(" "), t5;
1674
+ $[10] === pinnedPerspective ? t5 = $[11] : (t5 = hasPinnedPerspective(pinnedPerspective), $[10] = pinnedPerspective, $[11] = t5);
1675
+ let t6 = !t5, t7;
1676
+ return $[12] !== t6 || $[13] !== text ? (t7 = /* @__PURE__ */ jsx("option", {
1649
1677
  value: "pinnedRelease",
1650
- disabled: t4,
1678
+ disabled: t6,
1651
1679
  children: text
1652
- }), $[8] = t4, $[9] = text, $[10] = t5) : t5 = $[10], t5;
1680
+ }), $[12] = t6, $[13] = text, $[14] = t7) : t7 = $[14], t7;
1653
1681
  };
1654
1682
  function VisionGuiHeader(t0) {
1655
- let $ = c(68), { onChangeDataset, dataset, customApiVersion, apiVersion, onChangeApiVersion, datasets, customApiVersionElementRef, onCustomApiVersionChange, isValidApiVersion, onChangePerspective, url, perspective, isScheduledDraftsEnabled } = t0, pinnedPerspective = usePerspective(), { t } = useTranslation(visionLocaleNamespace), operationUrlElement = useRef(null), t1;
1656
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
1683
+ let $ = c(81), { onChangeDataset, dataset, customApiVersion, apiVersion, onChangeApiVersion, datasets, customApiVersionElementRef, onCustomApiVersionChange, isValidApiVersion, onChangePerspective, url, perspective, isScheduledDraftsEnabled } = t0, pinnedPerspective = usePerspective(), t1;
1684
+ $[0] !== perspective || $[1] !== pinnedPerspective.selectedVariantName ? (t1 = getActiveVariant(perspective, pinnedPerspective.selectedVariantName), $[0] = perspective, $[1] = pinnedPerspective.selectedVariantName, $[2] = t1) : t1 = $[2];
1685
+ let isApiVersionLocked = !!t1, { t } = useTranslation(visionLocaleNamespace), operationUrlElement = useRef(null), t2;
1686
+ $[3] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
1657
1687
  let el = operationUrlElement.current;
1658
1688
  if (el) try {
1659
1689
  el.select(), document.execCommand("copy");
1660
1690
  } catch {
1661
1691
  console.error("Unable to copy to clipboard :(");
1662
1692
  }
1663
- }, $[0] = t1) : t1 = $[0];
1664
- let handleCopyUrl = t1, t2;
1665
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [
1693
+ }, $[3] = t2) : t2 = $[3];
1694
+ let handleCopyUrl = t2, t3;
1695
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [
1666
1696
  1,
1667
1697
  4,
1668
1698
  8,
1669
1699
  12
1670
- ], $[1] = t2) : t2 = $[1];
1671
- let t3;
1672
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [1, 2], $[2] = t3) : t3 = $[2];
1700
+ ], $[4] = t3) : t3 = $[4];
1673
1701
  let t4;
1674
- $[3] === t ? t4 = $[4] : (t4 = t("settings.dataset-label"), $[3] = t, $[4] = t4);
1702
+ $[5] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [1, 2], $[5] = t4) : t4 = $[5];
1675
1703
  let t5;
1676
- $[5] === t4 ? t5 = $[6] : (t5 = /* @__PURE__ */ jsx(Card, {
1704
+ $[6] === t ? t5 = $[7] : (t5 = t("settings.dataset-label"), $[6] = t, $[7] = t5);
1705
+ let t6;
1706
+ $[8] === t5 ? t6 = $[9] : (t6 = /* @__PURE__ */ jsx(Card, {
1677
1707
  paddingTop: 2,
1678
1708
  paddingBottom: 3,
1679
- children: /* @__PURE__ */ jsx(StyledLabel, { children: t4 })
1680
- }), $[5] = t4, $[6] = t5);
1681
- let t6;
1682
- $[7] === datasets ? t6 = $[8] : (t6 = datasets.map(_temp2$2), $[7] = datasets, $[8] = t6);
1709
+ children: /* @__PURE__ */ jsx(StyledLabel, { children: t5 })
1710
+ }), $[8] = t5, $[9] = t6);
1683
1711
  let t7;
1684
- $[9] !== dataset || $[10] !== onChangeDataset || $[11] !== t6 ? (t7 = /* @__PURE__ */ jsx(Select, {
1712
+ $[10] === datasets ? t7 = $[11] : (t7 = datasets.map(_temp2$2), $[10] = datasets, $[11] = t7);
1713
+ let t8;
1714
+ $[12] !== dataset || $[13] !== onChangeDataset || $[14] !== t7 ? (t8 = /* @__PURE__ */ jsx(Select, {
1685
1715
  value: dataset,
1686
1716
  onChange: onChangeDataset,
1687
- children: t6
1688
- }), $[9] = dataset, $[10] = onChangeDataset, $[11] = t6, $[12] = t7) : t7 = $[12];
1689
- let t8;
1690
- $[13] !== t5 || $[14] !== t7 ? (t8 = /* @__PURE__ */ jsx(Box, {
1691
- padding: 1,
1692
- gridColumn: t3,
1693
- children: /* @__PURE__ */ jsxs(Stack, { children: [t5, t7] })
1694
- }), $[13] = t5, $[14] = t7, $[15] = t8) : t8 = $[15];
1717
+ children: t7
1718
+ }), $[12] = dataset, $[13] = onChangeDataset, $[14] = t7, $[15] = t8) : t8 = $[15];
1695
1719
  let t9;
1696
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = [1, 2], $[16] = t9) : t9 = $[16];
1720
+ $[16] !== t6 || $[17] !== t8 ? (t9 = /* @__PURE__ */ jsx(Box, {
1721
+ padding: 1,
1722
+ gridColumn: t4,
1723
+ children: /* @__PURE__ */ jsxs(Stack, { children: [t6, t8] })
1724
+ }), $[16] = t6, $[17] = t8, $[18] = t9) : t9 = $[18];
1697
1725
  let t10;
1698
- $[17] === t ? t10 = $[18] : (t10 = t("settings.api-version-label"), $[17] = t, $[18] = t10);
1726
+ $[19] === Symbol.for("react.memo_cache_sentinel") ? (t10 = [1, 2], $[19] = t10) : t10 = $[19];
1699
1727
  let t11;
1700
- $[19] === t10 ? t11 = $[20] : (t11 = /* @__PURE__ */ jsx(Card, {
1728
+ $[20] === t ? t11 = $[21] : (t11 = t("settings.api-version-label"), $[20] = t, $[21] = t11);
1729
+ let t12;
1730
+ $[22] === t11 ? t12 = $[23] : (t12 = /* @__PURE__ */ jsx(Card, {
1701
1731
  paddingTop: 2,
1702
1732
  paddingBottom: 3,
1703
- children: /* @__PURE__ */ jsx(StyledLabel, { children: t10 })
1704
- }), $[19] = t10, $[20] = t11);
1705
- let t12 = customApiVersion === !1 ? apiVersion : "other", t13;
1706
- $[21] === Symbol.for("react.memo_cache_sentinel") ? (t13 = API_VERSIONS.map(_temp3$1), $[21] = t13) : t13 = $[21];
1733
+ children: /* @__PURE__ */ jsx(StyledLabel, { children: t11 })
1734
+ }), $[22] = t11, $[23] = t12);
1735
+ let t13;
1736
+ $[24] === t ? t13 = $[25] : (t13 = t("settings.api-version-locked-for-variant"), $[24] = t, $[25] = t13);
1707
1737
  let t14;
1708
- $[22] === t ? t14 = $[23] : (t14 = t("settings.other-api-version-label"), $[22] = t, $[23] = t14);
1709
- let t15;
1710
- $[24] === t14 ? t15 = $[25] : (t15 = /* @__PURE__ */ jsx("option", {
1738
+ $[26] === t13 ? t14 = $[27] : (t14 = /* @__PURE__ */ jsx(Text, {
1739
+ size: 1,
1740
+ children: t13
1741
+ }), $[26] = t13, $[27] = t14);
1742
+ let t15 = !isApiVersionLocked, t16 = customApiVersion === !1 ? apiVersion : "other", t17;
1743
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t17 = API_VERSIONS.map(_temp3$1), $[28] = t17) : t17 = $[28];
1744
+ let t18;
1745
+ $[29] === t ? t18 = $[30] : (t18 = t("settings.other-api-version-label"), $[29] = t, $[30] = t18);
1746
+ let t19;
1747
+ $[31] === t18 ? t19 = $[32] : (t19 = /* @__PURE__ */ jsx("option", {
1711
1748
  value: "other",
1712
- children: t14
1713
- }, "other"), $[24] = t14, $[25] = t15);
1714
- let t16;
1715
- $[26] !== onChangeApiVersion || $[27] !== t12 || $[28] !== t15 ? (t16 = /* @__PURE__ */ jsxs(Select, {
1716
- "data-testid": "api-version-selector",
1717
- value: t12,
1718
- onChange: onChangeApiVersion,
1719
- children: [t13, t15]
1720
- }), $[26] = onChangeApiVersion, $[27] = t12, $[28] = t15, $[29] = t16) : t16 = $[29];
1721
- let t17;
1722
- $[30] !== t11 || $[31] !== t16 ? (t17 = /* @__PURE__ */ jsx(Box, {
1749
+ children: t18
1750
+ }, "other"), $[31] = t18, $[32] = t19);
1751
+ let t20;
1752
+ $[33] !== isApiVersionLocked || $[34] !== onChangeApiVersion || $[35] !== t16 || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsx(Box, {
1753
+ "data-testid": "api-version-selector-wrap",
1754
+ children: /* @__PURE__ */ jsxs(Select, {
1755
+ "data-testid": "api-version-selector",
1756
+ value: t16,
1757
+ onChange: onChangeApiVersion,
1758
+ disabled: isApiVersionLocked,
1759
+ children: [t17, t19]
1760
+ })
1761
+ }), $[33] = isApiVersionLocked, $[34] = onChangeApiVersion, $[35] = t16, $[36] = t19, $[37] = t20) : t20 = $[37];
1762
+ let t21;
1763
+ $[38] !== t14 || $[39] !== t15 || $[40] !== t20 ? (t21 = /* @__PURE__ */ jsx(Tooltip, {
1764
+ content: t14,
1765
+ disabled: t15,
1766
+ placement: "bottom",
1767
+ portal: !0,
1768
+ children: t20
1769
+ }), $[38] = t14, $[39] = t15, $[40] = t20, $[41] = t21) : t21 = $[41];
1770
+ let t22;
1771
+ $[42] !== t12 || $[43] !== t21 ? (t22 = /* @__PURE__ */ jsx(Box, {
1723
1772
  padding: 1,
1724
- gridColumn: t9,
1725
- children: /* @__PURE__ */ jsxs(Stack, { children: [t11, t16] })
1726
- }), $[30] = t11, $[31] = t16, $[32] = t17) : t17 = $[32];
1727
- let t18;
1728
- $[33] !== customApiVersion || $[34] !== customApiVersionElementRef || $[35] !== isValidApiVersion || $[36] !== onCustomApiVersionChange || $[37] !== t ? (t18 = customApiVersion !== !1 && /* @__PURE__ */ jsx(Box, {
1773
+ gridColumn: t10,
1774
+ children: /* @__PURE__ */ jsxs(Stack, { children: [t12, t21] })
1775
+ }), $[42] = t12, $[43] = t21, $[44] = t22) : t22 = $[44];
1776
+ let t23;
1777
+ $[45] !== customApiVersion || $[46] !== customApiVersionElementRef || $[47] !== isApiVersionLocked || $[48] !== isValidApiVersion || $[49] !== onCustomApiVersionChange || $[50] !== t ? (t23 = !isApiVersionLocked && customApiVersion !== !1 && /* @__PURE__ */ jsx(Box, {
1729
1778
  padding: 1,
1730
1779
  gridColumn: [1, 2],
1731
1780
  children: /* @__PURE__ */ jsxs(Stack, { children: [/* @__PURE__ */ jsx(Card, {
@@ -1742,25 +1791,25 @@ function VisionGuiHeader(t0) {
1742
1791
  customValidity: isValidApiVersion ? void 0 : t("settings.error.invalid-api-version"),
1743
1792
  maxLength: 11
1744
1793
  })] })
1745
- }), $[33] = customApiVersion, $[34] = customApiVersionElementRef, $[35] = isValidApiVersion, $[36] = onCustomApiVersionChange, $[37] = t, $[38] = t18) : t18 = $[38];
1746
- let t19;
1747
- $[39] === Symbol.for("react.memo_cache_sentinel") ? (t19 = [1, 2], $[39] = t19) : t19 = $[39];
1748
- let t20;
1749
- $[40] === t ? t20 = $[41] : (t20 = t("settings.perspective-label"), $[40] = t, $[41] = t20);
1750
- let t21;
1751
- $[42] === t20 ? t21 = $[43] : (t21 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(StyledLabel, { children: t20 }) }), $[42] = t20, $[43] = t21);
1752
- let t22;
1753
- $[44] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[44] = t22) : t22 = $[44];
1754
- let t23;
1755
- $[45] === t21 ? t23 = $[46] : (t23 = /* @__PURE__ */ jsx(Card, {
1794
+ }), $[45] = customApiVersion, $[46] = customApiVersionElementRef, $[47] = isApiVersionLocked, $[48] = isValidApiVersion, $[49] = onCustomApiVersionChange, $[50] = t, $[51] = t23) : t23 = $[51];
1795
+ let t24;
1796
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t24 = [1, 2], $[52] = t24) : t24 = $[52];
1797
+ let t25;
1798
+ $[53] === t ? t25 = $[54] : (t25 = t("settings.perspective-label"), $[53] = t, $[54] = t25);
1799
+ let t26;
1800
+ $[55] === t25 ? t26 = $[56] : (t26 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(StyledLabel, { children: t25 }) }), $[55] = t25, $[56] = t26);
1801
+ let t27;
1802
+ $[57] === Symbol.for("react.memo_cache_sentinel") ? (t27 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[57] = t27) : t27 = $[57];
1803
+ let t28;
1804
+ $[58] === t26 ? t28 = $[59] : (t28 = /* @__PURE__ */ jsx(Card, {
1756
1805
  paddingBottom: 1,
1757
1806
  children: /* @__PURE__ */ jsxs(Inline, {
1758
1807
  gap: 1,
1759
- children: [t21, t22]
1808
+ children: [t26, t27]
1760
1809
  })
1761
- }), $[45] = t21, $[46] = t23);
1762
- let t24 = perspective || "default", t25;
1763
- $[47] !== isScheduledDraftsEnabled || $[48] !== pinnedPerspective || $[49] !== t ? (t25 = SUPPORTED_PERSPECTIVES.map((perspectiveName) => perspectiveName === "pinnedRelease" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1810
+ }), $[58] = t26, $[59] = t28);
1811
+ let t29 = perspective || "default", t30;
1812
+ $[60] !== isScheduledDraftsEnabled || $[61] !== pinnedPerspective || $[62] !== t ? (t30 = SUPPORTED_PERSPECTIVES.map((perspectiveName) => perspectiveName === "pinnedRelease" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1764
1813
  /* @__PURE__ */ jsx(PinnedReleasePerspectiveOption, {
1765
1814
  pinnedPerspective,
1766
1815
  t
@@ -1773,21 +1822,22 @@ function VisionGuiHeader(t0) {
1773
1822
  ] }, "pinnedRelease") : perspectiveName === "scheduledDrafts" ? isScheduledDraftsEnabled ? /* @__PURE__ */ jsx("option", {
1774
1823
  value: "scheduledDrafts",
1775
1824
  children: t("settings.perspectives.scheduled-drafts")
1776
- }, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[47] = isScheduledDraftsEnabled, $[48] = pinnedPerspective, $[49] = t, $[50] = t25) : t25 = $[50];
1777
- let t26;
1778
- $[51] !== onChangePerspective || $[52] !== t24 || $[53] !== t25 ? (t26 = /* @__PURE__ */ jsx(Select, {
1779
- value: t24,
1825
+ }, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[60] = isScheduledDraftsEnabled, $[61] = pinnedPerspective, $[62] = t, $[63] = t30) : t30 = $[63];
1826
+ let t31;
1827
+ $[64] !== onChangePerspective || $[65] !== t29 || $[66] !== t30 ? (t31 = /* @__PURE__ */ jsx(Select, {
1828
+ "data-testid": "perspective-selector",
1829
+ value: t29,
1780
1830
  onChange: onChangePerspective,
1781
- children: t25
1782
- }), $[51] = onChangePerspective, $[52] = t24, $[53] = t25, $[54] = t26) : t26 = $[54];
1783
- let t27;
1784
- $[55] !== t23 || $[56] !== t26 ? (t27 = /* @__PURE__ */ jsx(Box, {
1831
+ children: t30
1832
+ }), $[64] = onChangePerspective, $[65] = t29, $[66] = t30, $[67] = t31) : t31 = $[67];
1833
+ let t32;
1834
+ $[68] !== t28 || $[69] !== t31 ? (t32 = /* @__PURE__ */ jsx(Box, {
1785
1835
  padding: 1,
1786
- gridColumn: t19,
1787
- children: /* @__PURE__ */ jsxs(Stack, { children: [t23, t26] })
1788
- }), $[55] = t23, $[56] = t26, $[57] = t27) : t27 = $[57];
1789
- let t28;
1790
- $[58] !== customApiVersion || $[59] !== t || $[60] !== url ? (t28 = typeof url == "string" ? /* @__PURE__ */ jsx(Box, {
1836
+ gridColumn: t24,
1837
+ children: /* @__PURE__ */ jsxs(Stack, { children: [t28, t31] })
1838
+ }), $[68] = t28, $[69] = t31, $[70] = t32) : t32 = $[70];
1839
+ let t33;
1840
+ $[71] !== customApiVersion || $[72] !== t || $[73] !== url ? (t33 = typeof url == "string" ? /* @__PURE__ */ jsx(Box, {
1791
1841
  padding: 1,
1792
1842
  flex: 1,
1793
1843
  gridColumn: [1, customApiVersion === !1 ? 6 : 4],
@@ -1815,6 +1865,7 @@ function VisionGuiHeader(t0) {
1815
1865
  children: [/* @__PURE__ */ jsx(Box, {
1816
1866
  flex: 1,
1817
1867
  children: /* @__PURE__ */ jsx(TextInput, {
1868
+ "data-testid": "vision-query-url",
1818
1869
  readOnly: !0,
1819
1870
  type: "url",
1820
1871
  ref: operationUrlElement,
@@ -1831,22 +1882,22 @@ function VisionGuiHeader(t0) {
1831
1882
  })
1832
1883
  })]
1833
1884
  })] })
1834
- }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[58] = customApiVersion, $[59] = t, $[60] = url, $[61] = t28) : t28 = $[61];
1835
- let t29;
1836
- return $[62] !== t17 || $[63] !== t18 || $[64] !== t27 || $[65] !== t28 || $[66] !== t8 ? (t29 = /* @__PURE__ */ jsx(Header, {
1885
+ }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[71] = customApiVersion, $[72] = t, $[73] = url, $[74] = t33) : t33 = $[74];
1886
+ let t34;
1887
+ return $[75] !== t22 || $[76] !== t23 || $[77] !== t32 || $[78] !== t33 || $[79] !== t9 ? (t34 = /* @__PURE__ */ jsx(Header, {
1837
1888
  paddingX: 3,
1838
1889
  paddingY: 2,
1839
1890
  children: /* @__PURE__ */ jsxs(Grid, {
1840
- gridTemplateColumns: t2,
1891
+ gridTemplateColumns: t3,
1841
1892
  children: [
1842
- t8,
1843
- t17,
1844
- t18,
1845
- t27,
1846
- t28
1893
+ t9,
1894
+ t22,
1895
+ t23,
1896
+ t32,
1897
+ t33
1847
1898
  ]
1848
1899
  })
1849
- }), $[62] = t17, $[63] = t18, $[64] = t27, $[65] = t28, $[66] = t8, $[67] = t29) : t29 = $[67], t29;
1900
+ }), $[75] = t22, $[76] = t23, $[77] = t32, $[78] = t33, $[79] = t9, $[80] = t34) : t34 = $[80], t34;
1850
1901
  }
1851
1902
  function _temp3$1(version) {
1852
1903
  return /* @__PURE__ */ jsx("option", { children: version }, version);
@@ -2223,9 +2274,9 @@ function VisionGuiResult(t0) {
2223
2274
  function nodeContains(node, other) {
2224
2275
  return !node || !other ? !1 : node === other || !!(node.compareDocumentPosition(other) & 16);
2225
2276
  }
2226
- const sanityUrl = /\/(vX|v1|v\d{4}-\d\d-\d\d)\/.*?(?:query|listen)\/(.*?)\?(.*)/, isRunHotkey = (event) => isHotkey("ctrl+enter", event) || isHotkey("mod+enter", event);
2277
+ const sanityUrl = /\/(vX|v1|v\d{4}-\d\d-\d\d)\/.*?(?:query|listen)\/(.*?)\?(.*)/, VARIANTS_API_VERSION = prefixApiVersion(VARIANTS_STUDIO_CLIENT_OPTIONS.apiVersion), isRunHotkey = (event) => isHotkey("ctrl+enter", event) || isHotkey("mod+enter", event);
2227
2278
  function VisionGui(props) {
2228
- let $ = c(209), { datasets, config, projectId, defaultDataset } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack } = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
2279
+ let $ = c(225), { datasets, config, projectId, defaultDataset } = props, toast = useToast(), { t } = useTranslation(visionLocaleNamespace), { perspectiveStack, selectedVariantName } = usePerspective(), isScheduledDraftsEnabled = useScheduledDraftsEnabled(), { data: t0 } = useActiveReleases(), t1;
2229
2280
  $[0] === t0 ? t1 = $[1] : (t1 = t0 === void 0 ? [] : t0, $[0] = t0, $[1] = t1);
2230
2281
  let releases = t1, isDraftModelEnabled = useWorkspace().document.drafts.enabled, editorQueryRef = useRef(null), editorParamsRef = useRef(null), visionRootRef = useRef(null), customApiVersionElementRef = useRef(null), querySubscriptionRef = useRef(void 0), listenSubscriptionRef = useRef(void 0), t2;
2231
2282
  $[2] === projectId ? t2 = $[3] : (t2 = () => getLocalStorage(projectId || "default"), $[2] = projectId, $[3] = t2);
@@ -2241,80 +2292,88 @@ function VisionGui(props) {
2241
2292
  $[14] === localStorage ? t7 = $[15] : (t7 = localStorage.get("perspective", void 0), $[14] = localStorage, $[15] = t7);
2242
2293
  let storedPerspective = t7, t8;
2243
2294
  $[16] !== datasets || $[17] !== defaultDataset || $[18] !== storedDataset ? (t8 = () => datasets.includes(storedDataset) ? storedDataset : datasets.includes(defaultDataset) ? defaultDataset : datasets[0], $[16] = datasets, $[17] = defaultDataset, $[18] = storedDataset, $[19] = t8) : t8 = $[19];
2244
- let [dataset, setDataset] = useState(t8), t9;
2245
- $[20] === storedApiVersion ? t9 = $[21] : (t9 = () => API_VERSIONS.includes(storedApiVersion) ? storedApiVersion : DEFAULT_API_VERSION, $[20] = storedApiVersion, $[21] = t9);
2246
- let [apiVersion, setApiVersion] = useState(t9), t10;
2247
- $[22] === storedApiVersion ? t10 = $[23] : (t10 = () => !API_VERSIONS.includes(storedApiVersion) && storedApiVersion, $[22] = storedApiVersion, $[23] = t10);
2248
- let [customApiVersion, setCustomApiVersion] = useState(t10), [perspective, setPerspectiveState] = useState(storedPerspective || "raw"), t11;
2249
- $[24] === customApiVersion ? t11 = $[25] : (t11 = !customApiVersion || validateApiVersion(customApiVersion), $[24] = customApiVersion, $[25] = t11);
2250
- let isValidApiVersion = t11, [url, setUrl] = useState(void 0), t12;
2251
- $[26] === storedQuery ? t12 = $[27] : (t12 = () => typeof storedQuery == "string" ? storedQuery : "", $[26] = storedQuery, $[27] = t12);
2252
- let [query, setQuery] = useState(t12), [rawParams, setRawParams] = useState(storedParams), t13;
2253
- $[28] !== rawParams || $[29] !== t ? (t13 = parseParams(rawParams, t), $[28] = rawParams, $[29] = t, $[30] = t13) : t13 = $[30];
2254
- let params = t13, [queryResult, setQueryResult] = useState(void 0), t14;
2255
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t14 = [], $[31] = t14) : t14 = $[31];
2256
- let [listenMutations, setListenMutations] = useState(t14), [error, setError] = useState(void 0), [queryTime, setQueryTime] = useState(void 0), [e2eTime, setE2eTime] = useState(void 0), [queryInProgress, setQueryInProgress] = useState(!1), [listenInProgress, setListenInProgress] = useState(!1), [isQueryRecallCollapsed, setIsQueryRecallCollapsed] = useState(!1), t15;
2257
- $[32] === Symbol.for("react.memo_cache_sentinel") ? (t15 = { visionRootRef }, $[32] = t15) : t15 = $[32];
2258
- let { paneSizeOptions, isNarrowBreakpoint } = usePaneSize(t15), t16;
2295
+ let [dataset, setDataset] = useState(t8), [perspective, setPerspectiveState] = useState(storedPerspective || "raw"), t9;
2296
+ $[20] !== perspective || $[21] !== selectedVariantName ? (t9 = getActiveVariant(perspective, selectedVariantName), $[20] = perspective, $[21] = selectedVariantName, $[22] = t9) : t9 = $[22];
2297
+ let activeVariant = t9, t10;
2298
+ $[23] !== activeVariant || $[24] !== storedApiVersion ? (t10 = () => activeVariant ? VARIANTS_API_VERSION : API_VERSIONS.includes(storedApiVersion) ? storedApiVersion : DEFAULT_API_VERSION, $[23] = activeVariant, $[24] = storedApiVersion, $[25] = t10) : t10 = $[25];
2299
+ let [apiVersion, setApiVersion] = useState(t10), t11;
2300
+ $[26] !== activeVariant || $[27] !== storedApiVersion ? (t11 = () => activeVariant || API_VERSIONS.includes(storedApiVersion) ? !1 : storedApiVersion, $[26] = activeVariant, $[27] = storedApiVersion, $[28] = t11) : t11 = $[28];
2301
+ let [customApiVersion, setCustomApiVersion] = useState(t11), t12;
2302
+ $[29] === customApiVersion ? t12 = $[30] : (t12 = !customApiVersion || validateApiVersion(customApiVersion), $[29] = customApiVersion, $[30] = t12);
2303
+ let isValidApiVersion = t12, [url, setUrl] = useState(void 0), t13;
2304
+ $[31] === storedQuery ? t13 = $[32] : (t13 = () => typeof storedQuery == "string" ? storedQuery : "", $[31] = storedQuery, $[32] = t13);
2305
+ let [query, setQuery] = useState(t13), [rawParams, setRawParams] = useState(storedParams), t14;
2306
+ $[33] !== rawParams || $[34] !== t ? (t14 = parseParams(rawParams, t), $[33] = rawParams, $[34] = t, $[35] = t14) : t14 = $[35];
2307
+ let params = t14, [queryResult, setQueryResult] = useState(void 0), t15;
2308
+ $[36] === Symbol.for("react.memo_cache_sentinel") ? (t15 = [], $[36] = t15) : t15 = $[36];
2309
+ let [listenMutations, setListenMutations] = useState(t15), [error, setError] = useState(void 0), [queryTime, setQueryTime] = useState(void 0), [e2eTime, setE2eTime] = useState(void 0), [queryInProgress, setQueryInProgress] = useState(!1), [listenInProgress, setListenInProgress] = useState(!1), [isQueryRecallCollapsed, setIsQueryRecallCollapsed] = useState(!1), t16;
2310
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t16 = { visionRootRef }, $[37] = t16) : t16 = $[37];
2311
+ let { paneSizeOptions, isNarrowBreakpoint } = usePaneSize(t16), t17;
2259
2312
  bb0: {
2260
2313
  if (!isScheduledDraftsEnabled) {
2261
- t16 = void 0;
2314
+ t17 = void 0;
2262
2315
  break bb0;
2263
2316
  }
2264
- let t17;
2265
- if ($[33] !== isDraftModelEnabled || $[34] !== releases) {
2266
- let scheduledDraftReleases = releases.filter(_temp$1), releaseIds = sortReleases(scheduledDraftReleases).map(_temp2$1), t18;
2267
- $[36] === isDraftModelEnabled ? t18 = $[37] : (t18 = isDraftModelEnabled ? ["drafts"] : ["published"], $[36] = isDraftModelEnabled, $[37] = t18);
2268
- let defaultPerspective = t18;
2269
- t17 = [...releaseIds, ...defaultPerspective], $[33] = isDraftModelEnabled, $[34] = releases, $[35] = t17;
2270
- } else t17 = $[35];
2271
- t16 = t17;
2317
+ let t18;
2318
+ if ($[38] !== isDraftModelEnabled || $[39] !== releases) {
2319
+ let scheduledDraftReleases = releases.filter(_temp$1), releaseIds = sortReleases(scheduledDraftReleases).map(_temp2$1), t19;
2320
+ $[41] === isDraftModelEnabled ? t19 = $[42] : (t19 = isDraftModelEnabled ? ["drafts"] : ["published"], $[41] = isDraftModelEnabled, $[42] = t19);
2321
+ let defaultPerspective = t19;
2322
+ t18 = [...releaseIds, ...defaultPerspective], $[38] = isDraftModelEnabled, $[39] = releases, $[40] = t18;
2323
+ } else t18 = $[40];
2324
+ t17 = t18;
2272
2325
  }
2273
- let scheduledDraftsStack = t16, t17 = isValidApiVersion && customApiVersion ? customApiVersion : apiVersion, t18;
2274
- $[38] === t17 ? t18 = $[39] : (t18 = { apiVersion: t17 }, $[38] = t17, $[39] = t18);
2326
+ let scheduledDraftsStack = t17, userApiVersion = activeVariant ? VARIANTS_API_VERSION : isValidApiVersion && customApiVersion ? customApiVersion : apiVersion, t18;
2327
+ $[43] === userApiVersion ? t18 = $[44] : (t18 = { apiVersion: userApiVersion }, $[43] = userApiVersion, $[44] = t18);
2275
2328
  let _client = useClient(t18), t19;
2276
- $[40] !== _client || $[41] !== apiVersion || $[42] !== customApiVersion || $[43] !== dataset || $[44] !== isValidApiVersion || $[45] !== perspective || $[46] !== perspectiveStack || $[47] !== scheduledDraftsStack ? (t19 = _client.withConfig({
2277
- apiVersion: isValidApiVersion && customApiVersion ? customApiVersion : apiVersion,
2329
+ $[45] !== _client || $[46] !== activeVariant || $[47] !== dataset || $[48] !== perspective || $[49] !== perspectiveStack || $[50] !== scheduledDraftsStack || $[51] !== userApiVersion ? (t19 = _client.withConfig({
2330
+ apiVersion: userApiVersion,
2278
2331
  perspective: getActivePerspective({
2279
2332
  visionPerspective: perspective,
2280
2333
  perspectiveStack,
2281
2334
  scheduledDraftsStack
2282
2335
  }),
2283
2336
  dataset,
2337
+ variant: activeVariant,
2284
2338
  allowReconfigure: !0
2285
- }), $[40] = _client, $[41] = apiVersion, $[42] = customApiVersion, $[43] = dataset, $[44] = isValidApiVersion, $[45] = perspective, $[46] = perspectiveStack, $[47] = scheduledDraftsStack, $[48] = t19) : t19 = $[48];
2339
+ }), $[45] = _client, $[46] = activeVariant, $[47] = dataset, $[48] = perspective, $[49] = perspectiveStack, $[50] = scheduledDraftsStack, $[51] = userApiVersion, $[52] = t19) : t19 = $[52];
2286
2340
  let client = t19, t20;
2287
- $[49] === Symbol.for("react.memo_cache_sentinel") ? (t20 = () => {
2341
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t20 = () => {
2288
2342
  querySubscriptionRef.current &&= (querySubscriptionRef.current.unsubscribe(), void 0);
2289
- }, $[49] = t20) : t20 = $[49];
2343
+ }, $[53] = t20) : t20 = $[53];
2290
2344
  let cancelQuerySubscription = t20, t21;
2291
- $[50] === Symbol.for("react.memo_cache_sentinel") ? (t21 = () => {
2345
+ $[54] === Symbol.for("react.memo_cache_sentinel") ? (t21 = () => {
2292
2346
  listenSubscriptionRef.current &&= (listenSubscriptionRef.current.unsubscribe(), void 0);
2293
- }, $[50] = t21) : t21 = $[50];
2347
+ }, $[54] = t21) : t21 = $[54];
2294
2348
  let cancelListenerSubscription = t21, t22;
2295
- $[51] !== apiVersion || $[52] !== client || $[53] !== customApiVersion || $[54] !== dataset || $[55] !== isValidApiVersion || $[56] !== localStorage || $[57] !== params.parsed || $[58] !== perspective || $[59] !== perspectiveStack || $[60] !== query || $[61] !== queryInProgress || $[62] !== scheduledDraftsStack || $[63] !== t ? (t22 = (options) => {
2349
+ $[55] !== apiVersion || $[56] !== client || $[57] !== customApiVersion || $[58] !== dataset || $[59] !== isValidApiVersion || $[60] !== localStorage || $[61] !== params.parsed || $[62] !== perspective || $[63] !== perspectiveStack || $[64] !== query || $[65] !== queryInProgress || $[66] !== scheduledDraftsStack || $[67] !== selectedVariantName || $[68] !== t ? (t22 = (options) => {
2296
2350
  if (queryInProgress) {
2297
2351
  cancelQuerySubscription(), cancelListenerSubscription(), setQueryInProgress(!1);
2298
2352
  return;
2299
2353
  }
2300
- let context = {
2354
+ let visionPerspective = options && "perspective" in options ? options.perspective : perspective, queryVariant = getActiveVariant(visionPerspective, selectedVariantName), context = {
2301
2355
  query: options?.query || query,
2302
2356
  dataset: options?.dataset || dataset,
2303
2357
  params: parseParams(JSON.stringify(options?.params || params.parsed, null, 2), t),
2304
2358
  perspective: getActivePerspective({
2305
- visionPerspective: options && "perspective" in options ? options.perspective : perspective,
2359
+ visionPerspective,
2306
2360
  perspectiveStack,
2307
2361
  scheduledDraftsStack
2308
2362
  }),
2309
- apiVersion: options?.apiVersion || (customApiVersion && isValidApiVersion ? customApiVersion : apiVersion)
2363
+ apiVersion: options?.apiVersion || (queryVariant ? VARIANTS_API_VERSION : customApiVersion && isValidApiVersion ? customApiVersion : apiVersion),
2364
+ variant: queryVariant
2310
2365
  };
2311
2366
  localStorage.set("query", context.query), localStorage.set("params", context.params.raw), cancelListenerSubscription();
2312
2367
  let hasQuery = context.query.trim().length > 0;
2313
2368
  if (setQueryInProgress(!context.params.error && hasQuery), setListenInProgress(!1), setListenMutations([]), setError(context.params.error ? Error(context.params.error) : void 0), setQueryResult(void 0), setQueryTime(void 0), setE2eTime(void 0), context.params.error || !hasQuery) return;
2314
- let urlQueryOpts = { perspective: context.perspective ?? [] }, ctxClient = client.withConfig({
2369
+ let urlQueryOpts = {
2370
+ perspective: context.perspective ?? [],
2371
+ ...context.variant ? { variant: context.variant } : {}
2372
+ }, ctxClient = client.withConfig({
2315
2373
  apiVersion: context.apiVersion,
2316
2374
  dataset: context.dataset,
2317
- perspective: context.perspective
2375
+ perspective: context.perspective,
2376
+ variant: context.variant
2318
2377
  }), newUrl = ctxClient.getUrl(ctxClient.getDataUrl("query", encodeQueryString(context.query, context.params.parsed, urlQueryOpts)));
2319
2378
  setUrl(newUrl);
2320
2379
  let queryStart = Date.now();
@@ -2329,41 +2388,44 @@ function VisionGui(props) {
2329
2388
  setError(err), setQueryInProgress(!1);
2330
2389
  }
2331
2390
  });
2332
- }, $[51] = apiVersion, $[52] = client, $[53] = customApiVersion, $[54] = dataset, $[55] = isValidApiVersion, $[56] = localStorage, $[57] = params.parsed, $[58] = perspective, $[59] = perspectiveStack, $[60] = query, $[61] = queryInProgress, $[62] = scheduledDraftsStack, $[63] = t, $[64] = t22) : t22 = $[64];
2391
+ }, $[55] = apiVersion, $[56] = client, $[57] = customApiVersion, $[58] = dataset, $[59] = isValidApiVersion, $[60] = localStorage, $[61] = params.parsed, $[62] = perspective, $[63] = perspectiveStack, $[64] = query, $[65] = queryInProgress, $[66] = scheduledDraftsStack, $[67] = selectedVariantName, $[68] = t, $[69] = t22) : t22 = $[69];
2333
2392
  let handleQueryExecution = t22, t23;
2334
- $[65] !== handleQueryExecution || $[66] !== localStorage ? (t23 = (newPerspective) => {
2393
+ $[70] !== handleQueryExecution || $[71] !== localStorage ? (t23 = (newPerspective) => {
2335
2394
  newPerspective !== void 0 && !isSupportedPerspective(newPerspective) || (setPerspectiveState(newPerspective), localStorage.set("perspective", newPerspective), handleQueryExecution({ perspective: newPerspective }));
2336
- }, $[65] = handleQueryExecution, $[66] = localStorage, $[67] = t23) : t23 = $[67];
2395
+ }, $[70] = handleQueryExecution, $[71] = localStorage, $[72] = t23) : t23 = $[72];
2337
2396
  let setPerspective = t23, t24;
2338
- $[68] !== handleQueryExecution || $[69] !== localStorage ? (t24 = (evt) => {
2397
+ $[73] !== handleQueryExecution || $[74] !== localStorage ? (t24 = (evt) => {
2339
2398
  let newDataset = evt.target.value;
2340
2399
  localStorage.set("dataset", newDataset), setDataset(newDataset), handleQueryExecution({ dataset: newDataset });
2341
- }, $[68] = handleQueryExecution, $[69] = localStorage, $[70] = t24) : t24 = $[70];
2400
+ }, $[73] = handleQueryExecution, $[74] = localStorage, $[75] = t24) : t24 = $[75];
2342
2401
  let handleChangeDataset = t24, t25;
2343
- $[71] !== handleQueryExecution || $[72] !== localStorage ? (t25 = (evt_0) => {
2344
- let newApiVersion = evt_0.target.value;
2345
- if (newApiVersion?.toLowerCase() === "other") {
2402
+ $[76] !== handleQueryExecution || $[77] !== localStorage ? (t25 = (newApiVersion) => {
2403
+ if (newApiVersion.toLowerCase() === "other") {
2346
2404
  setCustomApiVersion("v"), customApiVersionElementRef.current?.focus();
2347
2405
  return;
2348
2406
  }
2349
2407
  setApiVersion(newApiVersion), setCustomApiVersion(!1), localStorage.set("apiVersion", newApiVersion), handleQueryExecution({ apiVersion: newApiVersion });
2350
- }, $[71] = handleQueryExecution, $[72] = localStorage, $[73] = t25) : t25 = $[73];
2351
- let handleChangeApiVersion = t25, t26;
2352
- $[74] !== handleQueryExecution || $[75] !== localStorage ? (t26 = (evt_1) => {
2408
+ }, $[76] = handleQueryExecution, $[77] = localStorage, $[78] = t25) : t25 = $[78];
2409
+ let changeApiVersion = t25, t26;
2410
+ $[79] === changeApiVersion ? t26 = $[80] : (t26 = (evt_0) => {
2411
+ changeApiVersion(evt_0.target.value);
2412
+ }, $[79] = changeApiVersion, $[80] = t26);
2413
+ let handleChangeApiVersion = t26, t27;
2414
+ $[81] !== handleQueryExecution || $[82] !== localStorage ? (t27 = (evt_1) => {
2353
2415
  let newCustomApiVersion = evt_1.target.value || "";
2354
2416
  setCustomApiVersion(newCustomApiVersion || "v"), validateApiVersion(newCustomApiVersion) && (setApiVersion(newCustomApiVersion), localStorage.set("apiVersion", newCustomApiVersion), handleQueryExecution({ apiVersion: newCustomApiVersion }));
2355
- }, $[74] = handleQueryExecution, $[75] = localStorage, $[76] = t26) : t26 = $[76];
2356
- let handleCustomApiVersionChange = t26, t27;
2357
- $[77] === setPerspective ? t27 = $[78] : (t27 = (evt_2) => {
2417
+ }, $[81] = handleQueryExecution, $[82] = localStorage, $[83] = t27) : t27 = $[83];
2418
+ let handleCustomApiVersionChange = t27, t28;
2419
+ $[84] === setPerspective ? t28 = $[85] : (t28 = (evt_2) => {
2358
2420
  let newPerspective_0 = evt_2.target.value;
2359
2421
  setPerspective(newPerspective_0 === "default" ? void 0 : newPerspective_0);
2360
- }, $[77] = setPerspective, $[78] = t27);
2361
- let handleChangePerspective = t27, t28;
2362
- $[79] === Symbol.for("react.memo_cache_sentinel") ? (t28 = (evt_3) => {
2422
+ }, $[84] = setPerspective, $[85] = t28);
2423
+ let handleChangePerspective = t28, t29;
2424
+ $[86] === Symbol.for("react.memo_cache_sentinel") ? (t29 = (evt_3) => {
2363
2425
  evt_3.type === "mutation" && setListenMutations((prevMutations) => prevMutations.length === 50 ? [evt_3, ...prevMutations.slice(0, 49)] : [evt_3, ...prevMutations]);
2364
- }, $[79] = t28) : t28 = $[79];
2365
- let handleListenerEvent = t28, t29;
2366
- $[80] !== client || $[81] !== listenInProgress || $[82] !== localStorage || $[83] !== params.error || $[84] !== params.parsed || $[85] !== params.raw || $[86] !== query ? (t29 = () => {
2426
+ }, $[86] = t29) : t29 = $[86];
2427
+ let handleListenerEvent = t29, t30;
2428
+ $[87] !== client || $[88] !== listenInProgress || $[89] !== localStorage || $[90] !== params.error || $[91] !== params.parsed || $[92] !== params.raw || $[93] !== query ? (t30 = () => {
2367
2429
  if (listenInProgress) {
2368
2430
  cancelListenerSubscription(), setListenInProgress(!1);
2369
2431
  return;
@@ -2378,13 +2440,13 @@ function VisionGui(props) {
2378
2440
  setError(err_0), setListenInProgress(!1);
2379
2441
  }
2380
2442
  }));
2381
- }, $[80] = client, $[81] = listenInProgress, $[82] = localStorage, $[83] = params.error, $[84] = params.parsed, $[85] = params.raw, $[86] = query, $[87] = t29) : t29 = $[87];
2382
- let handleListenExecution = t29, t30;
2383
- $[88] === localStorage ? t30 = $[89] : (t30 = (value) => {
2443
+ }, $[87] = client, $[88] = listenInProgress, $[89] = localStorage, $[90] = params.error, $[91] = params.parsed, $[92] = params.raw, $[93] = query, $[94] = t30) : t30 = $[94];
2444
+ let handleListenExecution = t30, t31;
2445
+ $[95] === localStorage ? t31 = $[96] : (t31 = (value) => {
2384
2446
  setRawParams(value), localStorage.set("params", value);
2385
- }, $[88] = localStorage, $[89] = t30);
2386
- let handleParamsChange = t30, t31;
2387
- $[90] !== apiVersion || $[91] !== dataset || $[92] !== datasets || $[93] !== perspective || $[94] !== toast ? (t31 = (data) => {
2447
+ }, $[95] = localStorage, $[96] = t31);
2448
+ let handleParamsChange = t31, t32;
2449
+ $[97] !== apiVersion || $[98] !== dataset || $[99] !== datasets || $[100] !== perspective || $[101] !== toast ? (t32 = (data) => {
2388
2450
  let match = data.match(sanityUrl);
2389
2451
  if (!match) return null;
2390
2452
  let [, usedApiVersion, usedDataset, urlQuery] = match, parts = parseApiQueryString(new URLSearchParams(urlQuery));
@@ -2407,9 +2469,9 @@ function VisionGui(props) {
2407
2469
  perspective: newPerspective_1 || perspective,
2408
2470
  url: data
2409
2471
  };
2410
- }, $[90] = apiVersion, $[91] = dataset, $[92] = datasets, $[93] = perspective, $[94] = toast, $[95] = t31) : t31 = $[95];
2411
- let getStateFromUrl = t31, t32;
2412
- $[96] !== handleQueryExecution || $[97] !== localStorage ? (t32 = (parsedUrlObj) => {
2472
+ }, $[97] = apiVersion, $[98] = dataset, $[99] = datasets, $[100] = perspective, $[101] = toast, $[102] = t32) : t32 = $[102];
2473
+ let getStateFromUrl = t32, t33;
2474
+ $[103] !== handleQueryExecution || $[104] !== localStorage ? (t33 = (parsedUrlObj) => {
2413
2475
  setDataset(parsedUrlObj.dataset), setQuery(parsedUrlObj.query), setRawParams(parsedUrlObj.rawParams), setApiVersion(parsedUrlObj.apiVersion), parsedUrlObj.customApiVersion && setCustomApiVersion(parsedUrlObj.customApiVersion), setPerspectiveState(parsedUrlObj.perspective), setUrl(parsedUrlObj.url), editorQueryRef.current?.resetEditorContent(parsedUrlObj.query), editorParamsRef.current?.resetEditorContent(parsedUrlObj.rawParams), localStorage.merge({
2414
2476
  query: parsedUrlObj.query,
2415
2477
  params: parsedUrlObj.rawParams,
@@ -2417,56 +2479,67 @@ function VisionGui(props) {
2417
2479
  apiVersion: parsedUrlObj.customApiVersion || parsedUrlObj.apiVersion,
2418
2480
  perspective: parsedUrlObj.perspective
2419
2481
  }), handleQueryExecution(parsedUrlObj);
2420
- }, $[96] = handleQueryExecution, $[97] = localStorage, $[98] = t32) : t32 = $[98];
2421
- let setStateFromParsedUrl = t32, t33;
2422
- $[99] !== getStateFromUrl || $[100] !== setStateFromParsedUrl || $[101] !== toast ? (t33 = (evt_4) => {
2423
- if (!evt_4.clipboardData) return;
2424
- let data_0 = evt_4.clipboardData.getData("text/plain");
2425
- evt_4.preventDefault();
2426
- let urlState = getStateFromUrl(data_0);
2427
- urlState && (setStateFromParsedUrl(urlState), toast.push({
2482
+ }, $[103] = handleQueryExecution, $[104] = localStorage, $[105] = t33) : t33 = $[105];
2483
+ let setStateFromParsedUrl = t33, t34;
2484
+ $[106] !== getStateFromUrl || $[107] !== setStateFromParsedUrl || $[108] !== toast ? (t34 = (evt_4) => {
2485
+ if (!evt_4.clipboardData || !isVisionPasteTarget(visionRootRef.current, evt_4)) return;
2486
+ let urlState = getStateFromUrl(evt_4.clipboardData.getData("text/plain"));
2487
+ urlState && (evt_4.preventDefault(), setStateFromParsedUrl(urlState), toast.push({
2428
2488
  closable: !0,
2429
2489
  id: "vision-paste",
2430
2490
  status: "info",
2431
2491
  title: "Parsed URL to query"
2432
2492
  }));
2433
- }, $[99] = getStateFromUrl, $[100] = setStateFromParsedUrl, $[101] = toast, $[102] = t33) : t33 = $[102];
2434
- let handlePaste = t33, t34;
2435
- $[103] !== handleQueryExecution || $[104] !== params.valid ? (t34 = (event) => {
2493
+ }, $[106] = getStateFromUrl, $[107] = setStateFromParsedUrl, $[108] = toast, $[109] = t34) : t34 = $[109];
2494
+ let handlePaste = t34, t35;
2495
+ $[110] !== handleQueryExecution || $[111] !== params.valid ? (t35 = (event) => {
2436
2496
  let isWithinRoot = visionRootRef.current && nodeContains(visionRootRef.current, event.target);
2437
2497
  isRunHotkey(event) && isWithinRoot && params.valid && (handleQueryExecution(), event.preventDefault(), event.stopPropagation());
2438
- }, $[103] = handleQueryExecution, $[104] = params.valid, $[105] = t34) : t34 = $[105];
2439
- let handleKeyDown = t34, t35, t36;
2440
- $[106] !== handleKeyDown || $[107] !== handlePaste ? (t35 = () => (window.document.addEventListener("paste", handlePaste), window.document.addEventListener("keydown", handleKeyDown), () => {
2498
+ }, $[110] = handleQueryExecution, $[111] = params.valid, $[112] = t35) : t35 = $[112];
2499
+ let handleKeyDown = t35, t36, t37;
2500
+ $[113] !== handleKeyDown || $[114] !== handlePaste ? (t36 = () => (window.document.addEventListener("paste", handlePaste), window.document.addEventListener("keydown", handleKeyDown), () => {
2441
2501
  window.document.removeEventListener("paste", handlePaste), window.document.removeEventListener("keydown", handleKeyDown);
2442
- }), t36 = [handleKeyDown, handlePaste], $[106] = handleKeyDown, $[107] = handlePaste, $[108] = t35, $[109] = t36) : (t35 = $[108], t36 = $[109]), useEffect(t35, t36);
2443
- let t37, t38;
2444
- $[110] === Symbol.for("react.memo_cache_sentinel") ? (t37 = () => () => {
2502
+ }), t37 = [handleKeyDown, handlePaste], $[113] = handleKeyDown, $[114] = handlePaste, $[115] = t36, $[116] = t37) : (t36 = $[115], t37 = $[116]), useEffect(t36, t37);
2503
+ let t38, t39;
2504
+ $[117] === Symbol.for("react.memo_cache_sentinel") ? (t38 = () => () => {
2445
2505
  cancelQuerySubscription(), cancelListenerSubscription();
2446
- }, t38 = [cancelQuerySubscription, cancelListenerSubscription], $[110] = t37, $[111] = t38) : (t37 = $[110], t38 = $[111]), useEffect(t37, t38);
2447
- let t39;
2448
- $[112] === setPerspective ? t39 = $[113] : (t39 = (stack) => {
2506
+ }, t39 = [cancelQuerySubscription, cancelListenerSubscription], $[117] = t38, $[118] = t39) : (t38 = $[117], t39 = $[118]), useEffect(t38, t39);
2507
+ let t40;
2508
+ $[119] !== changeApiVersion || $[120] !== perspective ? (t40 = () => {
2509
+ perspective === "pinnedRelease" && changeApiVersion(VARIANTS_API_VERSION);
2510
+ }, $[119] = changeApiVersion, $[120] = perspective, $[121] = t40) : t40 = $[121];
2511
+ let handleStudioVariantChange = useEffectEvent(t40), t41;
2512
+ $[122] !== activeVariant || $[123] !== handleStudioVariantChange ? (t41 = () => {
2513
+ activeVariant && handleStudioVariantChange();
2514
+ }, $[122] = activeVariant, $[123] = handleStudioVariantChange, $[124] = t41) : t41 = $[124];
2515
+ let t42;
2516
+ $[125] === activeVariant ? t42 = $[126] : (t42 = [activeVariant], $[125] = activeVariant, $[126] = t42), useEffect(t41, t42);
2517
+ let t43;
2518
+ $[127] === setPerspective ? t43 = $[128] : (t43 = (stack) => {
2449
2519
  stack.length > 0 && setPerspective("pinnedRelease");
2450
- }, $[112] = setPerspective, $[113] = t39);
2451
- let handleStudioPerspectiveChange = useEffectEvent(t39), t40;
2452
- $[114] !== handleStudioPerspectiveChange || $[115] !== perspectiveStack ? (t40 = () => {
2520
+ }, $[127] = setPerspective, $[128] = t43);
2521
+ let handleStudioPerspectiveChange = useEffectEvent(t43), t44;
2522
+ $[129] !== handleStudioPerspectiveChange || $[130] !== perspectiveStack ? (t44 = () => {
2453
2523
  handleStudioPerspectiveChange(perspectiveStack);
2454
- }, $[114] = handleStudioPerspectiveChange, $[115] = perspectiveStack, $[116] = t40) : t40 = $[116];
2455
- let t41;
2456
- $[117] === perspectiveStack ? t41 = $[118] : (t41 = [perspectiveStack], $[117] = perspectiveStack, $[118] = t41), useEffect(t40, t41);
2457
- let t42;
2458
- $[119] !== client || $[120] !== perspective || $[121] !== perspectiveStack || $[122] !== scheduledDraftsStack ? (t42 = (queryString, queryParams) => {
2459
- let urlQueryOpts_0 = { perspective: getActivePerspective({
2460
- visionPerspective: perspective,
2461
- perspectiveStack,
2462
- scheduledDraftsStack
2463
- }) ?? [] };
2524
+ }, $[129] = handleStudioPerspectiveChange, $[130] = perspectiveStack, $[131] = t44) : t44 = $[131];
2525
+ let t45;
2526
+ $[132] === perspectiveStack ? t45 = $[133] : (t45 = [perspectiveStack], $[132] = perspectiveStack, $[133] = t45), useEffect(t44, t45);
2527
+ let t46;
2528
+ $[134] !== activeVariant || $[135] !== client || $[136] !== perspective || $[137] !== perspectiveStack || $[138] !== scheduledDraftsStack ? (t46 = (queryString, queryParams) => {
2529
+ let urlQueryOpts_0 = {
2530
+ perspective: getActivePerspective({
2531
+ visionPerspective: perspective,
2532
+ perspectiveStack,
2533
+ scheduledDraftsStack
2534
+ }) ?? [],
2535
+ ...activeVariant ? { variant: activeVariant } : {}
2536
+ };
2464
2537
  return client.getUrl(client.getDataUrl("query", encodeQueryString(queryString, queryParams, urlQueryOpts_0)));
2465
- }, $[119] = client, $[120] = perspective, $[121] = perspectiveStack, $[122] = scheduledDraftsStack, $[123] = t42) : t42 = $[123];
2466
- let generateUrl = t42, t43;
2467
- $[124] !== apiVersion || $[125] !== customApiVersion || $[126] !== dataset || $[127] !== datasets || $[128] !== handleChangeApiVersion || $[129] !== handleChangeDataset || $[130] !== handleChangePerspective || $[131] !== handleCustomApiVersionChange || $[132] !== isScheduledDraftsEnabled || $[133] !== isValidApiVersion || $[134] !== perspective || $[135] !== url ? (t43 = /* @__PURE__ */ jsx(VisionGuiHeader, {
2468
- apiVersion,
2469
- customApiVersion,
2538
+ }, $[134] = activeVariant, $[135] = client, $[136] = perspective, $[137] = perspectiveStack, $[138] = scheduledDraftsStack, $[139] = t46) : t46 = $[139];
2539
+ let generateUrl = t46, t47 = activeVariant ? VARIANTS_API_VERSION : apiVersion, t48 = !activeVariant && customApiVersion, t49;
2540
+ $[140] !== dataset || $[141] !== datasets || $[142] !== handleChangeApiVersion || $[143] !== handleChangeDataset || $[144] !== handleChangePerspective || $[145] !== handleCustomApiVersionChange || $[146] !== isScheduledDraftsEnabled || $[147] !== isValidApiVersion || $[148] !== perspective || $[149] !== t47 || $[150] !== t48 || $[151] !== url ? (t49 = /* @__PURE__ */ jsx(VisionGuiHeader, {
2541
+ apiVersion: t47,
2542
+ customApiVersion: t48,
2470
2543
  dataset,
2471
2544
  datasets,
2472
2545
  onChangeDataset: handleChangeDataset,
@@ -2478,69 +2551,69 @@ function VisionGui(props) {
2478
2551
  url,
2479
2552
  perspective,
2480
2553
  isScheduledDraftsEnabled
2481
- }), $[124] = apiVersion, $[125] = customApiVersion, $[126] = dataset, $[127] = datasets, $[128] = handleChangeApiVersion, $[129] = handleChangeDataset, $[130] = handleChangePerspective, $[131] = handleCustomApiVersionChange, $[132] = isScheduledDraftsEnabled, $[133] = isValidApiVersion, $[134] = perspective, $[135] = url, $[136] = t43) : t43 = $[136];
2482
- let t44 = isQueryRecallCollapsed ? window.innerWidth : window.innerWidth - 275, t45 = isNarrowBreakpoint ? "vertical" : "horizontal", t46 = isNarrowBreakpoint ? paneSizeOptions.defaultSize : paneSizeOptions.minSize, t47 = paneSizeOptions.size, t48 = paneSizeOptions.allowResize, t49 = isNarrowBreakpoint ? paneSizeOptions.minSize : 100, t50 = paneSizeOptions.maxSize, t51;
2483
- $[137] === t ? t51 = $[138] : (t51 = t("query.label"), $[137] = t, $[138] = t51);
2484
- let t52;
2485
- $[139] === t51 ? t52 = $[140] : (t52 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(StyledLabel, {
2554
+ }), $[140] = dataset, $[141] = datasets, $[142] = handleChangeApiVersion, $[143] = handleChangeDataset, $[144] = handleChangePerspective, $[145] = handleCustomApiVersionChange, $[146] = isScheduledDraftsEnabled, $[147] = isValidApiVersion, $[148] = perspective, $[149] = t47, $[150] = t48, $[151] = url, $[152] = t49) : t49 = $[152];
2555
+ let t50 = isQueryRecallCollapsed ? window.innerWidth : window.innerWidth - 275, t51 = isNarrowBreakpoint ? "vertical" : "horizontal", t52 = isNarrowBreakpoint ? paneSizeOptions.defaultSize : paneSizeOptions.minSize, t53 = paneSizeOptions.size, t54 = paneSizeOptions.allowResize, t55 = isNarrowBreakpoint ? paneSizeOptions.minSize : 100, t56 = paneSizeOptions.maxSize, t57;
2556
+ $[153] === t ? t57 = $[154] : (t57 = t("query.label"), $[153] = t, $[154] = t57);
2557
+ let t58;
2558
+ $[155] === t57 ? t58 = $[156] : (t58 = /* @__PURE__ */ jsx(InputBackgroundContainerLeft, { children: /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(StyledLabel, {
2486
2559
  muted: !0,
2487
- children: t51
2488
- }) }) }), $[139] = t51, $[140] = t52);
2489
- let t53;
2490
- $[141] === query ? t53 = $[142] : (t53 = /* @__PURE__ */ jsx(VisionCodeMirror, {
2560
+ children: t57
2561
+ }) }) }), $[155] = t57, $[156] = t58);
2562
+ let t59;
2563
+ $[157] === query ? t59 = $[158] : (t59 = /* @__PURE__ */ jsx(VisionCodeMirror, {
2491
2564
  initialValue: query,
2492
2565
  onChange: setQuery,
2493
2566
  ref: editorQueryRef,
2494
2567
  extensions: groqExtensions
2495
- }), $[141] = query, $[142] = t53);
2496
- let t54;
2497
- $[143] !== t52 || $[144] !== t53 ? (t54 = /* @__PURE__ */ jsx(InputContainer, {
2568
+ }), $[157] = query, $[158] = t59);
2569
+ let t60;
2570
+ $[159] !== t58 || $[160] !== t59 ? (t60 = /* @__PURE__ */ jsx(InputContainer, {
2498
2571
  display: "flex",
2499
2572
  "data-testid": "vision-query-editor",
2500
2573
  children: /* @__PURE__ */ jsxs(Box, {
2501
2574
  flex: 1,
2502
- children: [t52, t53]
2575
+ children: [t58, t59]
2503
2576
  })
2504
- }), $[143] = t52, $[144] = t53, $[145] = t54) : t54 = $[145];
2505
- let t55;
2506
- $[146] !== handleParamsChange || $[147] !== params.error || $[148] !== params.raw || $[149] !== params.valid ? (t55 = /* @__PURE__ */ jsx(ParamsEditor, {
2577
+ }), $[159] = t58, $[160] = t59, $[161] = t60) : t60 = $[161];
2578
+ let t61;
2579
+ $[162] !== handleParamsChange || $[163] !== params.error || $[164] !== params.raw || $[165] !== params.valid ? (t61 = /* @__PURE__ */ jsx(ParamsEditor, {
2507
2580
  value: params.raw,
2508
2581
  onChange: handleParamsChange,
2509
2582
  paramsError: params.error,
2510
2583
  hasValidParams: params.valid,
2511
2584
  editorRef: editorParamsRef
2512
- }), $[146] = handleParamsChange, $[147] = params.error, $[148] = params.raw, $[149] = params.valid, $[150] = t55) : t55 = $[150];
2513
- let t56;
2514
- $[151] !== handleListenExecution || $[152] !== handleQueryExecution || $[153] !== listenInProgress || $[154] !== params.valid || $[155] !== queryInProgress ? (t56 = /* @__PURE__ */ jsx(VisionGuiControls, {
2585
+ }), $[162] = handleParamsChange, $[163] = params.error, $[164] = params.raw, $[165] = params.valid, $[166] = t61) : t61 = $[166];
2586
+ let t62;
2587
+ $[167] !== handleListenExecution || $[168] !== handleQueryExecution || $[169] !== listenInProgress || $[170] !== params.valid || $[171] !== queryInProgress ? (t62 = /* @__PURE__ */ jsx(VisionGuiControls, {
2515
2588
  hasValidParams: params.valid,
2516
2589
  queryInProgress,
2517
2590
  listenInProgress,
2518
2591
  onQueryExecution: handleQueryExecution,
2519
2592
  onListenExecution: handleListenExecution
2520
- }), $[151] = handleListenExecution, $[152] = handleQueryExecution, $[153] = listenInProgress, $[154] = params.valid, $[155] = queryInProgress, $[156] = t56) : t56 = $[156];
2521
- let t57;
2522
- $[157] !== t55 || $[158] !== t56 ? (t57 = /* @__PURE__ */ jsxs(InputContainer, {
2593
+ }), $[167] = handleListenExecution, $[168] = handleQueryExecution, $[169] = listenInProgress, $[170] = params.valid, $[171] = queryInProgress, $[172] = t62) : t62 = $[172];
2594
+ let t63;
2595
+ $[173] !== t61 || $[174] !== t62 ? (t63 = /* @__PURE__ */ jsxs(InputContainer, {
2523
2596
  display: "flex",
2524
- children: [t55, t56]
2525
- }), $[157] = t55, $[158] = t56, $[159] = t57) : t57 = $[159];
2526
- let t58;
2527
- $[160] !== paneSizeOptions.allowResize || $[161] !== paneSizeOptions.maxSize || $[162] !== paneSizeOptions.size || $[163] !== t46 || $[164] !== t49 || $[165] !== t54 || $[166] !== t57 ? (t58 = /* @__PURE__ */ jsx(Box, {
2597
+ children: [t61, t62]
2598
+ }), $[173] = t61, $[174] = t62, $[175] = t63) : t63 = $[175];
2599
+ let t64;
2600
+ $[176] !== paneSizeOptions.allowResize || $[177] !== paneSizeOptions.maxSize || $[178] !== paneSizeOptions.size || $[179] !== t52 || $[180] !== t55 || $[181] !== t60 || $[182] !== t63 ? (t64 = /* @__PURE__ */ jsx(Box, {
2528
2601
  height: "stretch",
2529
2602
  flex: 1,
2530
2603
  children: /* @__PURE__ */ jsxs(SplitPane, {
2531
2604
  className: "sidebarPanes",
2532
2605
  split: "horizontal",
2533
- defaultSize: t46,
2534
- size: t47,
2535
- allowResize: t48,
2536
- minSize: t49,
2537
- maxSize: t50,
2606
+ defaultSize: t52,
2607
+ size: t53,
2608
+ allowResize: t54,
2609
+ minSize: t55,
2610
+ maxSize: t56,
2538
2611
  primary: "first",
2539
- children: [t54, t57]
2612
+ children: [t60, t63]
2540
2613
  })
2541
- }), $[160] = paneSizeOptions.allowResize, $[161] = paneSizeOptions.maxSize, $[162] = paneSizeOptions.size, $[163] = t46, $[164] = t49, $[165] = t54, $[166] = t57, $[167] = t58) : t58 = $[167];
2542
- let t59;
2543
- $[168] !== dataset || $[169] !== e2eTime || $[170] !== error || $[171] !== listenInProgress || $[172] !== listenMutations || $[173] !== queryInProgress || $[174] !== queryResult || $[175] !== queryTime ? (t59 = /* @__PURE__ */ jsx(VisionGuiResult, {
2614
+ }), $[176] = paneSizeOptions.allowResize, $[177] = paneSizeOptions.maxSize, $[178] = paneSizeOptions.size, $[179] = t52, $[180] = t55, $[181] = t60, $[182] = t63, $[183] = t64) : t64 = $[183];
2615
+ let t65;
2616
+ $[184] !== dataset || $[185] !== e2eTime || $[186] !== error || $[187] !== listenInProgress || $[188] !== listenMutations || $[189] !== queryInProgress || $[190] !== queryResult || $[191] !== queryTime ? (t65 = /* @__PURE__ */ jsx(VisionGuiResult, {
2544
2617
  error,
2545
2618
  queryInProgress,
2546
2619
  queryResult,
@@ -2549,83 +2622,83 @@ function VisionGui(props) {
2549
2622
  dataset,
2550
2623
  queryTime,
2551
2624
  e2eTime
2552
- }), $[168] = dataset, $[169] = e2eTime, $[170] = error, $[171] = listenInProgress, $[172] = listenMutations, $[173] = queryInProgress, $[174] = queryResult, $[175] = queryTime, $[176] = t59) : t59 = $[176];
2553
- let t60;
2554
- $[177] !== t45 || $[178] !== t58 || $[179] !== t59 ? (t60 = /* @__PURE__ */ jsx(Box, {
2625
+ }), $[184] = dataset, $[185] = e2eTime, $[186] = error, $[187] = listenInProgress, $[188] = listenMutations, $[189] = queryInProgress, $[190] = queryResult, $[191] = queryTime, $[192] = t65) : t65 = $[192];
2626
+ let t66;
2627
+ $[193] !== t51 || $[194] !== t64 || $[195] !== t65 ? (t66 = /* @__PURE__ */ jsx(Box, {
2555
2628
  height: "stretch",
2556
2629
  flex: 1,
2557
2630
  children: /* @__PURE__ */ jsxs(SplitPane, {
2558
2631
  className: "sidebarPanes",
2559
- split: t45,
2632
+ split: t51,
2560
2633
  minSize: 300,
2561
- children: [t58, t59]
2634
+ children: [t64, t65]
2562
2635
  })
2563
- }), $[177] = t45, $[178] = t58, $[179] = t59, $[180] = t60) : t60 = $[180];
2564
- let t61;
2565
- $[181] === Symbol.for("react.memo_cache_sentinel") ? (t61 = {
2636
+ }), $[193] = t51, $[194] = t64, $[195] = t65, $[196] = t66) : t66 = $[196];
2637
+ let t67;
2638
+ $[197] === Symbol.for("react.memo_cache_sentinel") ? (t67 = {
2566
2639
  position: "absolute",
2567
2640
  left: -32,
2568
2641
  top: "50%",
2569
2642
  transform: "translateY(-50%)",
2570
2643
  zIndex: 100,
2571
2644
  pointerEvents: "auto"
2572
- }, $[181] = t61) : t61 = $[181];
2573
- let t62;
2574
- $[182] === isQueryRecallCollapsed ? t62 = $[183] : (t62 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[182] = isQueryRecallCollapsed, $[183] = t62);
2575
- let t63;
2576
- $[184] === Symbol.for("react.memo_cache_sentinel") ? (t63 = {
2645
+ }, $[197] = t67) : t67 = $[197];
2646
+ let t68;
2647
+ $[198] === isQueryRecallCollapsed ? t68 = $[199] : (t68 = () => setIsQueryRecallCollapsed(!isQueryRecallCollapsed), $[198] = isQueryRecallCollapsed, $[199] = t68);
2648
+ let t69;
2649
+ $[200] === Symbol.for("react.memo_cache_sentinel") ? (t69 = {
2577
2650
  display: "flex",
2578
2651
  alignItems: "center",
2579
2652
  height: "100%"
2580
- }, $[184] = t63) : t63 = $[184];
2581
- let t64;
2582
- $[185] === isQueryRecallCollapsed ? t64 = $[186] : (t64 = /* @__PURE__ */ jsx("div", {
2583
- style: t63,
2653
+ }, $[200] = t69) : t69 = $[200];
2654
+ let t70;
2655
+ $[201] === isQueryRecallCollapsed ? t70 = $[202] : (t70 = /* @__PURE__ */ jsx("div", {
2656
+ style: t69,
2584
2657
  children: jsx(isQueryRecallCollapsed ? ChevronLeftIcon : ChevronRightIcon, {})
2585
- }), $[185] = isQueryRecallCollapsed, $[186] = t64);
2586
- let t65;
2587
- $[187] !== t62 || $[188] !== t64 ? (t65 = /* @__PURE__ */ jsx(Button, {
2658
+ }), $[201] = isQueryRecallCollapsed, $[202] = t70);
2659
+ let t71;
2660
+ $[203] !== t68 || $[204] !== t70 ? (t71 = /* @__PURE__ */ jsx(Button, {
2588
2661
  mode: "ghost",
2589
2662
  padding: 2,
2590
- style: t61,
2591
- onClick: t62,
2592
- children: t64
2593
- }), $[187] = t62, $[188] = t64, $[189] = t65) : t65 = $[189];
2594
- let t66;
2595
- $[190] === params.parsed ? t66 = $[191] : (t66 = params.parsed || {}, $[190] = params.parsed, $[191] = t66);
2596
- let t67;
2597
- $[192] !== generateUrl || $[193] !== getStateFromUrl || $[194] !== query || $[195] !== setStateFromParsedUrl || $[196] !== t66 || $[197] !== url ? (t67 = /* @__PURE__ */ jsx(QueryRecallPaneWrapper, { children: /* @__PURE__ */ jsx(QueryRecall, {
2663
+ style: t67,
2664
+ onClick: t68,
2665
+ children: t70
2666
+ }), $[203] = t68, $[204] = t70, $[205] = t71) : t71 = $[205];
2667
+ let t72;
2668
+ $[206] === params.parsed ? t72 = $[207] : (t72 = params.parsed || {}, $[206] = params.parsed, $[207] = t72);
2669
+ let t73;
2670
+ $[208] !== generateUrl || $[209] !== getStateFromUrl || $[210] !== query || $[211] !== setStateFromParsedUrl || $[212] !== t72 || $[213] !== url ? (t73 = /* @__PURE__ */ jsx(QueryRecallPaneWrapper, { children: /* @__PURE__ */ jsx(QueryRecall, {
2598
2671
  url,
2599
2672
  getStateFromUrl,
2600
2673
  setStateFromParsedUrl,
2601
2674
  currentQuery: query,
2602
- currentParams: t66,
2675
+ currentParams: t72,
2603
2676
  generateUrl
2604
- }) }), $[192] = generateUrl, $[193] = getStateFromUrl, $[194] = query, $[195] = setStateFromParsedUrl, $[196] = t66, $[197] = url, $[198] = t67) : t67 = $[198];
2605
- let t68;
2606
- $[199] !== t65 || $[200] !== t67 ? (t68 = /* @__PURE__ */ jsxs(QueryRecallPaneContainer, { children: [t65, t67] }), $[199] = t65, $[200] = t67, $[201] = t68) : t68 = $[201];
2607
- let t69;
2608
- $[202] !== t44 || $[203] !== t60 || $[204] !== t68 ? (t69 = /* @__PURE__ */ jsx(SplitpaneContainer, {
2677
+ }) }), $[208] = generateUrl, $[209] = getStateFromUrl, $[210] = query, $[211] = setStateFromParsedUrl, $[212] = t72, $[213] = url, $[214] = t73) : t73 = $[214];
2678
+ let t74;
2679
+ $[215] !== t71 || $[216] !== t73 ? (t74 = /* @__PURE__ */ jsxs(QueryRecallPaneContainer, { children: [t71, t73] }), $[215] = t71, $[216] = t73, $[217] = t74) : t74 = $[217];
2680
+ let t75;
2681
+ $[218] !== t50 || $[219] !== t66 || $[220] !== t74 ? (t75 = /* @__PURE__ */ jsx(SplitpaneContainer, {
2609
2682
  flex: "auto",
2610
2683
  children: /* @__PURE__ */ jsxs(SplitPane, {
2611
2684
  minSize: 800,
2612
2685
  defaultSize: window.innerWidth - 275,
2613
- size: t44,
2686
+ size: t50,
2614
2687
  maxSize: -225,
2615
2688
  primary: "first",
2616
- children: [t60, t68]
2689
+ children: [t66, t74]
2617
2690
  })
2618
- }), $[202] = t44, $[203] = t60, $[204] = t68, $[205] = t69) : t69 = $[205];
2619
- let t70;
2620
- return $[206] !== t43 || $[207] !== t69 ? (t70 = /* @__PURE__ */ jsxs(Root, {
2691
+ }), $[218] = t50, $[219] = t66, $[220] = t74, $[221] = t75) : t75 = $[221];
2692
+ let t76;
2693
+ return $[222] !== t49 || $[223] !== t75 ? (t76 = /* @__PURE__ */ jsxs(Root, {
2621
2694
  direction: "column",
2622
2695
  height: "fill",
2623
2696
  ref: visionRootRef,
2624
2697
  sizing: "border",
2625
2698
  overflow: "hidden",
2626
2699
  "data-testid": "vision-root",
2627
- children: [t43, t69]
2628
- }), $[206] = t43, $[207] = t69, $[208] = t70) : t70 = $[208], t70;
2700
+ children: [t49, t75]
2701
+ }), $[222] = t49, $[223] = t75, $[224] = t76) : t76 = $[224], t76;
2629
2702
  }
2630
2703
  function _temp2$1(release_0) {
2631
2704
  return getReleaseIdFromReleaseDocumentId(release_0._id);
@@ -2774,4 +2847,4 @@ function SanityVision(props) {
2774
2847
  }
2775
2848
  export { SanityVision as default };
2776
2849
 
2777
- //# sourceMappingURL=SanityVision-BnC8gWR8.js.map
2850
+ //# sourceMappingURL=SanityVision-DtYJleYV.js.map