@overmap-ai/core 1.0.53-attachment-creation-flows.0 → 1.0.53-component-asset-renames.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.
Files changed (51) hide show
  1. package/dist/constants/ui.d.ts +1 -1
  2. package/dist/enums/ui.d.ts +1 -1
  3. package/dist/overmap-core.js +1418 -1174
  4. package/dist/overmap-core.js.map +1 -1
  5. package/dist/overmap-core.umd.cjs +1365 -1121
  6. package/dist/overmap-core.umd.cjs.map +1 -1
  7. package/dist/sdk/sdk.d.ts +7 -7
  8. package/dist/sdk/services/AgentService.d.ts +6 -32
  9. package/dist/sdk/services/AssetAttachmentService.d.ts +10 -0
  10. package/dist/sdk/services/AssetService.d.ts +11 -0
  11. package/dist/sdk/services/AssetStageCompletionService.d.ts +16 -0
  12. package/dist/sdk/services/AssetStageService.d.ts +11 -0
  13. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +10 -0
  14. package/dist/sdk/services/AssetTypeService.d.ts +9 -0
  15. package/dist/sdk/services/IssueService.d.ts +1 -1
  16. package/dist/sdk/services/MainService.d.ts +4 -11
  17. package/dist/sdk/services/UserFormService.d.ts +2 -2
  18. package/dist/sdk/services/UserFormSubmissionService.d.ts +1 -1
  19. package/dist/sdk/services/index.d.ts +6 -6
  20. package/dist/store/slices/agentsSlice.d.ts +16 -0
  21. package/dist/store/slices/assetSlice.d.ts +63 -0
  22. package/dist/store/slices/assetStageCompletionSlice.d.ts +15 -0
  23. package/dist/store/slices/assetStageSlice.d.ts +32 -0
  24. package/dist/store/slices/assetTypeSlice.d.ts +74 -0
  25. package/dist/store/slices/categorySlice.d.ts +5 -4
  26. package/dist/store/slices/documentSlice.d.ts +7 -7
  27. package/dist/store/slices/formRevisionSlice.d.ts +6 -5
  28. package/dist/store/slices/formSlice.d.ts +7 -7
  29. package/dist/store/slices/formSubmissionSlice.d.ts +2 -2
  30. package/dist/store/slices/index.d.ts +5 -4
  31. package/dist/store/slices/issueSlice.d.ts +5 -4
  32. package/dist/store/slices/projectFileSlice.d.ts +5 -4
  33. package/dist/store/slices/workspaceSlice.d.ts +5 -4
  34. package/dist/store/store.d.ts +16 -13
  35. package/dist/typings/models/agents.d.ts +40 -0
  36. package/dist/typings/models/attachments.d.ts +6 -6
  37. package/dist/typings/models/components.d.ts +11 -7
  38. package/dist/typings/models/forms.d.ts +3 -3
  39. package/dist/typings/models/index.d.ts +1 -0
  40. package/dist/utils/colors.d.ts +1 -1
  41. package/package.json +1 -1
  42. package/dist/sdk/services/ComponentAttachmentService.d.ts +0 -10
  43. package/dist/sdk/services/ComponentService.d.ts +0 -11
  44. package/dist/sdk/services/ComponentStageCompletionService.d.ts +0 -17
  45. package/dist/sdk/services/ComponentStageService.d.ts +0 -11
  46. package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +0 -10
  47. package/dist/sdk/services/ComponentTypeService.d.ts +0 -9
  48. package/dist/store/slices/ComponentStageCompletionSlice.d.ts +0 -27
  49. package/dist/store/slices/componentSlice.d.ts +0 -73
  50. package/dist/store/slices/componentStageSlice.d.ts +0 -42
  51. package/dist/store/slices/componentTypeSlice.d.ts +0 -75
@@ -8,7 +8,7 @@ var _a;
8
8
  import * as React from "react";
9
9
  import React__default, { useState, useEffect, useRef, memo, useMemo, useCallback, createContext, createElement, useContext, forwardRef, Children, isValidElement, cloneElement, Fragment as Fragment$1, useLayoutEffect, useReducer, lazy, Suspense } from "react";
10
10
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
11
- import { unsafeShowToast, AlertDialogProvider, ToastProvider, DefaultTheme, Flex as Flex$1, IconButton, RiIcon, Text as Text$1, useSeverityColor, Checkbox, TextArea, Select, useToast, Badge, MultiSelect, Overlay, Button, Spinner, useViewportSize, ButtonGroup, IconColorUtility, Tooltip, Popover, useSize, ToggleButton, Separator, OvermapItem, ButtonList, divButtonProps, OvermapDropdownMenu, Input, useAlertDialog } from "@overmap-ai/blocks";
11
+ import { unsafeShowToast, AlertDialogProvider, ToastProvider, DefaultTheme, Flex as Flex$1, IconButton, RiIcon, Text as Text$1, useSeverityColor, TextArea, Select, useToast, Badge, MultiSelect, Overlay, Button, Spinner, useViewportSize, ButtonGroup, IconColorUtility, Tooltip, Popover, useSize, ToggleButton, Separator, OvermapItem, ButtonList, divButtonProps, OvermapDropdownMenu, Checkbox as Checkbox$1, Input, useAlertDialog } from "@overmap-ai/blocks";
12
12
  import { DepGraph } from "dependency-graph";
13
13
  import { offline as offline$1 } from "@redux-offline/redux-offline";
14
14
  import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
@@ -24,6 +24,7 @@ import jwtDecode from "jwt-decode";
24
24
  import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
25
25
  import { openDB } from "idb";
26
26
  import { useField, useFormikContext, useFormik, FormikProvider } from "formik";
27
+ import { flushSync } from "react-dom";
27
28
  import get from "lodash.get";
28
29
  import Linkify from "linkify-react";
29
30
  import { DragDropContext, Droppable, Draggable } from "@hello-pangea/dnd";
@@ -32,7 +33,6 @@ import { read, utils } from "xlsx";
32
33
  import { pdfjs, Document, Page } from "react-pdf";
33
34
  import "react-pdf/dist/Page/AnnotationLayer.css";
34
35
  import "react-pdf/dist/Page/TextLayer.css";
35
- import { flushSync } from "react-dom";
36
36
  import { ReactSketchCanvas } from "react-sketch-canvas";
37
37
  import set from "lodash.set";
38
38
  import cloneDeep from "lodash.clonedeep";
@@ -678,15 +678,15 @@ const wrapMigration = (migrator) => (state) => {
678
678
  };
679
679
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
680
680
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
681
- const initialState$r = {
681
+ const initialState$s = {
682
682
  accessToken: "",
683
683
  refreshToken: "",
684
684
  isLoggedIn: false
685
685
  };
686
686
  const authSlice = createSlice({
687
687
  name: "auth",
688
- initialState: initialState$r,
689
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
688
+ initialState: initialState$s,
689
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$s)),
690
690
  reducers: {
691
691
  setTokens: (state, action) => {
692
692
  state.accessToken = action.payload.accessToken;
@@ -1384,7 +1384,7 @@ const ColorsToString = {
1384
1384
  [mint.mint9]: "mint",
1385
1385
  [sky.sky9]: "sky"
1386
1386
  };
1387
- const ComponentStageColors = {
1387
+ const AssetStageColors = {
1388
1388
  indigo: indigo.indigo9,
1389
1389
  red: red.red9,
1390
1390
  violet: violet.violet9,
@@ -1406,7 +1406,7 @@ const generateBadgeColors = (rawColor) => {
1406
1406
  return { backgroundColor, textColor };
1407
1407
  };
1408
1408
  function getStageColor(index2) {
1409
- return Object.values(ComponentStageColors)[index2 % Object.keys(ComponentStageColors).length];
1409
+ return Object.values(AssetStageColors)[index2 % Object.keys(AssetStageColors).length];
1410
1410
  }
1411
1411
  const getLocalDateString = memoize((date) => {
1412
1412
  if (!date)
@@ -1430,7 +1430,7 @@ const getLocalRelativeDateString = memoize((date, min, max) => {
1430
1430
  return getLocalDateString(date);
1431
1431
  return relative.format(days, "days");
1432
1432
  });
1433
- const initialState$q = {
1433
+ const initialState$r = {
1434
1434
  categories: {},
1435
1435
  usedCategoryColors: [],
1436
1436
  categoryVisibility: {
@@ -1440,8 +1440,8 @@ const initialState$q = {
1440
1440
  };
1441
1441
  const categorySlice = createSlice({
1442
1442
  name: "categories",
1443
- initialState: initialState$q,
1444
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1443
+ initialState: initialState$r,
1444
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$r)),
1445
1445
  reducers: {
1446
1446
  setCategories: (state, action) => {
1447
1447
  if (!Array.isArray(action.payload))
@@ -1625,167 +1625,274 @@ function removeAttachments(state, action) {
1625
1625
  delete state.attachments[attachmentId];
1626
1626
  }
1627
1627
  }
1628
+ const initialState$q = {
1629
+ assetTypes: {},
1630
+ hiddenAssetTypeIds: {},
1631
+ attachments: {}
1632
+ };
1633
+ const assetTypeSlice = createSlice({
1634
+ name: "assetTypes",
1635
+ initialState: initialState$q,
1636
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1637
+ reducers: {
1638
+ addAssetType: (state, action) => {
1639
+ state.assetTypes[action.payload.offline_id] = action.payload;
1640
+ },
1641
+ setAssetTypes: (state, action) => {
1642
+ state.assetTypes = toOfflineIdRecord(action.payload);
1643
+ },
1644
+ toggleAssetTypeVisibility: (state, action) => {
1645
+ state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
1646
+ },
1647
+ deleteAssetType: (state, action) => {
1648
+ delete state.assetTypes[action.payload];
1649
+ },
1650
+ // Attachments
1651
+ setAssetTypeAttachment: setAttachment,
1652
+ setAssetTypeAttachments: setAttachments,
1653
+ addAssetTypeAttachment: addAttachment,
1654
+ addAssetTypeAttachments: addAttachments,
1655
+ updateAssetTypeAttachment: updateAttachment,
1656
+ updateAssetTypeAttachments: updateAttachments,
1657
+ removeAssetTypeAttachment: removeAttachment,
1658
+ removeAssetTypeAttachments: removeAttachments
1659
+ }
1660
+ });
1661
+ const {
1662
+ addAssetType,
1663
+ setAssetTypes,
1664
+ toggleAssetTypeVisibility,
1665
+ deleteAssetType,
1666
+ // Attachmet
1667
+ setAssetTypeAttachment,
1668
+ setAssetTypeAttachments,
1669
+ addAssetTypeAttachment,
1670
+ addAssetTypeAttachments,
1671
+ updateAssetTypeAttachment,
1672
+ updateAssetTypeAttachments,
1673
+ removeAssetTypeAttachment,
1674
+ removeAssetTypeAttachments
1675
+ } = assetTypeSlice.actions;
1676
+ const selectAssetTypesMapping = (state) => state.assetTypeReducer.assetTypes;
1677
+ const selectAssetTypes = createSelector(
1678
+ [selectAssetTypesMapping],
1679
+ (mapping) => Object.values(mapping)
1680
+ );
1681
+ const selectAssetType = restructureCreateSelectorWithArgs(
1682
+ createSelector(
1683
+ [selectAssetTypesMapping, (_state, assetTypeId) => assetTypeId],
1684
+ (mapping, assetTypeId) => mapping[assetTypeId]
1685
+ )
1686
+ );
1687
+ const selectNumberOfAssetTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
1688
+ createSelector(
1689
+ [selectAssetTypesMapping, (_state, args) => args],
1690
+ (mapping, args) => {
1691
+ var _a2;
1692
+ const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
1693
+ return Object.values(mapping).filter(
1694
+ (assetType) => {
1695
+ var _a3;
1696
+ return (((_a3 = assetType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && assetType.offline_id !== args.assetTypeId;
1697
+ }
1698
+ ).length;
1699
+ }
1700
+ )
1701
+ );
1702
+ const selectAssetTypesByName = restructureCreateSelectorWithArgs(
1703
+ createSelector([selectAssetTypesMapping, (_state, name) => name], (mapping, name) => {
1704
+ name = (name == null ? void 0 : name.toLowerCase()) ?? null;
1705
+ return Object.values(mapping).filter((assetType) => {
1706
+ var _a2;
1707
+ return (((_a2 = assetType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
1708
+ });
1709
+ })
1710
+ );
1711
+ const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
1712
+ const selectAssetTypeAttachmentMapping = (state) => state.assetTypeReducer.attachments;
1713
+ const selectAssetTypeAttachments = createSelector(
1714
+ [selectAssetTypeAttachmentMapping],
1715
+ (mapping) => Object.values(mapping)
1716
+ );
1717
+ const selectAssetTypeAttachment = (attachmentId) => (state) => {
1718
+ return state.assetTypeReducer.attachments[attachmentId];
1719
+ };
1720
+ const selectAttachmentsOfAssetType = restructureCreateSelectorWithArgs(
1721
+ createSelector(
1722
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1723
+ (attachments, assetTypeId) => {
1724
+ return attachments.filter(({ asset_type }) => assetTypeId === asset_type);
1725
+ }
1726
+ )
1727
+ );
1728
+ const selectAttachmentsOfAssetTypeByType = restructureCreateSelectorWithArgs(
1729
+ createSelector(
1730
+ [selectAssetTypeAttachments, (_state, assetTypeId) => assetTypeId],
1731
+ (attachments, assetTypeId) => {
1732
+ const attachmentsOfAssetType = attachments.filter(({ asset_type }) => asset_type === assetTypeId);
1733
+ const fileAttachments = attachmentsOfAssetType.filter(
1734
+ // this null check here is necessary, there are cases where file_type is null or undefined
1735
+ ({ file_type }) => !file_type || !file_type.startsWith("image/")
1736
+ );
1737
+ const imageAttachments = attachmentsOfAssetType.filter(
1738
+ // this null check here is necessary, there are cases where file_type is null or undefined
1739
+ ({ file_type }) => file_type && file_type.startsWith("image/")
1740
+ );
1741
+ return { fileAttachments, imageAttachments };
1742
+ }
1743
+ )
1744
+ );
1745
+ const assetTypeReducer = assetTypeSlice.reducer;
1628
1746
  const initialState$p = {
1629
- components: {},
1747
+ assets: {},
1630
1748
  attachments: {}
1631
1749
  };
1632
- const componentSlice = createSlice({
1633
- name: "components",
1750
+ const assetSlice = createSlice({
1751
+ name: "assets",
1634
1752
  initialState: initialState$p,
1635
1753
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1636
1754
  reducers: {
1637
- addComponent: (state, action) => {
1638
- state.components[action.payload.offline_id] = action.payload;
1639
- prevComponents = null;
1755
+ addAsset: (state, action) => {
1756
+ state.assets[action.payload.offline_id] = action.payload;
1757
+ prevAssets = null;
1640
1758
  },
1641
- addComponentsInBatches: (state, action) => {
1642
- Object.assign(state.components, toOfflineIdRecord(action.payload));
1643
- prevComponents = null;
1759
+ addAssetsInBatches: (state, action) => {
1760
+ Object.assign(state.assets, toOfflineIdRecord(action.payload));
1761
+ prevAssets = null;
1644
1762
  },
1645
- setComponents: (state, action) => {
1646
- state.components = toOfflineIdRecord(action.payload);
1647
- prevComponents = null;
1763
+ setAssets: (state, action) => {
1764
+ state.assets = toOfflineIdRecord(action.payload);
1765
+ prevAssets = null;
1648
1766
  },
1649
- updateComponent: (state, action) => {
1650
- if (action.payload.offline_id in state.components) {
1651
- state.components[action.payload.offline_id] = action.payload;
1767
+ updateAsset: (state, action) => {
1768
+ if (action.payload.offline_id in state.assets) {
1769
+ state.assets[action.payload.offline_id] = action.payload;
1652
1770
  } else {
1653
- throw new Error(`Tried to update component with ID that doesn't exist: ${action.payload.offline_id}`);
1771
+ throw new Error(`Tried to update asset with ID that doesn't exist: ${action.payload.offline_id}`);
1654
1772
  }
1655
- prevComponents = null;
1773
+ prevAssets = null;
1656
1774
  },
1657
- removeComponent: (state, action) => {
1658
- if (action.payload in state.components) {
1659
- delete state.components[action.payload];
1775
+ removeAsset: (state, action) => {
1776
+ if (action.payload in state.assets) {
1777
+ delete state.assets[action.payload];
1660
1778
  } else {
1661
- throw new Error(`Failed to remove component because ID doesn't exist: ${action.payload}`);
1779
+ throw new Error(`Failed to remove asset because ID doesn't exist: ${action.payload}`);
1662
1780
  }
1663
- prevComponents = null;
1781
+ prevAssets = null;
1664
1782
  },
1665
- removeAllComponentsOfType: (state, action) => {
1783
+ removeAllAssetsOfType: (state, action) => {
1666
1784
  var _a2;
1667
- for (const componentId in state.components) {
1668
- if (((_a2 = state.components[componentId]) == null ? void 0 : _a2.component_type) === action.payload) {
1669
- delete state.components[componentId];
1785
+ for (const componentId in state.assets) {
1786
+ if (((_a2 = state.assets[componentId]) == null ? void 0 : _a2.asset_type) === action.payload) {
1787
+ delete state.assets[componentId];
1670
1788
  }
1671
1789
  }
1672
- prevComponents = null;
1790
+ prevAssets = null;
1673
1791
  },
1674
1792
  // Attachments
1675
- setComponentAttachment: setAttachment,
1676
- setComponentAttachments: setAttachments,
1677
- addComponentAttachment: addAttachment,
1678
- addComponentAttachments: addAttachments,
1679
- updateComponentAttachment: updateAttachment,
1680
- updateComponentAttachments: updateAttachments,
1681
- removeComponentAttachment: removeAttachment,
1682
- removeComponentAttachments: removeAttachments
1793
+ setAssetAttachment: setAttachment,
1794
+ setAssetAttachments: setAttachments,
1795
+ addAssetAttachment: addAttachment,
1796
+ addAssetAttachments: addAttachments,
1797
+ updateAssetAttachment: updateAttachment,
1798
+ updateAssetAttachments: updateAttachments,
1799
+ removeAssetAttachment: removeAttachment,
1800
+ removeAssetAttachments: removeAttachments
1683
1801
  }
1684
1802
  });
1685
1803
  const {
1686
- addComponent,
1687
- updateComponent,
1688
- removeComponent,
1689
- addComponentsInBatches,
1690
- setComponents,
1691
- removeAllComponentsOfType,
1804
+ addAsset,
1805
+ updateAsset,
1806
+ removeAsset,
1807
+ addAssetsInBatches,
1808
+ setAssets,
1809
+ removeAllAssetsOfType,
1692
1810
  // Attachments
1693
- setComponentAttachment,
1694
- setComponentAttachments,
1695
- addComponentAttachment,
1696
- addComponentAttachments,
1697
- updateComponentAttachment,
1698
- updateComponentAttachments,
1699
- removeComponentAttachment,
1700
- removeComponentAttachments
1701
- } = componentSlice.actions;
1702
- let prevComponents = null;
1703
- const selectComponents = (state) => {
1704
- if (!prevComponents) {
1705
- prevComponents = Object.values(state.componentReducer.components);
1706
- }
1707
- return prevComponents;
1811
+ setAssetAttachment,
1812
+ setAssetAttachments,
1813
+ addAssetAttachment,
1814
+ addAssetAttachments,
1815
+ updateAssetAttachment,
1816
+ updateAssetAttachments,
1817
+ removeAssetAttachment,
1818
+ removeAssetAttachments
1819
+ } = assetSlice.actions;
1820
+ let prevAssets = null;
1821
+ const selectAssets = (state) => {
1822
+ if (!prevAssets) {
1823
+ prevAssets = Object.values(state.assetReducer.assets);
1824
+ }
1825
+ return prevAssets;
1708
1826
  };
1709
- const selectComponentsMapping = (state) => state.componentReducer.components;
1710
- const selectComponentsFromComponentType = (componentTypeId) => (state) => {
1711
- if (!componentTypeId)
1712
- return [];
1713
- const components = selectComponents(state);
1714
- return components.filter((component) => component.component_type === componentTypeId);
1715
- };
1716
- const selectComponent = (componentId) => (state) => {
1717
- return state.componentReducer.components[componentId];
1718
- };
1719
- const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
1720
- return state.componentTypeReducer.componentTypes[componentTypeId];
1827
+ const selectAssetsMapping = (state) => state.assetReducer.assets;
1828
+ const selectAssetsOfAssetType = restructureCreateSelectorWithArgs(
1829
+ createSelector([selectAssets, (_state, assetTypeId) => assetTypeId], (components, assetTypeId) => {
1830
+ return components.filter((asset) => asset.asset_type === assetTypeId);
1831
+ })
1832
+ );
1833
+ const selectAsset = (assetId) => (state) => {
1834
+ return state.assetReducer.assets[assetId];
1721
1835
  };
1722
- const selectComponentTypeFromComponents = (state) => {
1723
- const ret = {};
1724
- const componentTypes = state.componentTypeReducer.componentTypes;
1725
- const components = state.componentReducer.components;
1726
- for (const [componentId, component] of Object.entries(components)) {
1727
- const componentType = componentTypes[component.component_type];
1728
- if (!componentType) {
1729
- console.error(
1730
- `Component type with ID ${component.component_type} not found.
1731
- Expected all referenced component types to be populated.
1836
+ const selectAssetToAssetTypeMapping = createSelector(
1837
+ [selectAssets, selectAssetTypesMapping],
1838
+ (assets, assetTypeMapping) => {
1839
+ const ret = {};
1840
+ for (const asset of assets) {
1841
+ const assetType = assetTypeMapping[asset.asset_type];
1842
+ if (!assetType) {
1843
+ console.error(
1844
+ `Asset type with ID ${asset.asset_type} not found.
1845
+ Expected all referenced asset types to be populated.
1732
1846
  Returning empty object to avoid fatal errors.`
1733
- );
1734
- return {};
1847
+ );
1848
+ return {};
1849
+ }
1850
+ ret[asset.offline_id] = assetType;
1735
1851
  }
1736
- ret[componentId] = componentType;
1852
+ return ret;
1737
1853
  }
1738
- return ret;
1739
- };
1740
- const selectComponentsByType = restructureCreateSelectorWithArgs(
1741
- createSelector(
1742
- [selectComponents, (_state, componentTypeId) => componentTypeId],
1743
- (components, componentTypeId) => {
1744
- return components.filter((component) => component.component_type === componentTypeId);
1745
- }
1746
- )
1747
1854
  );
1748
- const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1855
+ const selectNumberOfAssetsOfAssetType = (assetTypeId) => (state) => {
1749
1856
  var _a2;
1750
- if (!componentTypeId)
1857
+ if (!assetTypeId)
1751
1858
  return 0;
1752
- return (_a2 = selectComponentsByType(componentTypeId)(state)) == null ? void 0 : _a2.length;
1859
+ return (_a2 = selectAssetsOfAssetType(assetTypeId)(state)) == null ? void 0 : _a2.length;
1753
1860
  };
1754
- const selectComponentTypesFromIds = (componentTypeIds) => (state) => {
1755
- return componentTypeIds.reduce((acc, componentTypeId) => {
1756
- const componentType = state.componentTypeReducer.componentTypes[componentTypeId];
1757
- if (componentType) {
1758
- acc.push(componentType);
1861
+ const selectAssetTypesFromIds = (assetTypeIds) => (state) => {
1862
+ return assetTypeIds.reduce((acc, assetTypeId) => {
1863
+ const assetType = state.assetTypeReducer.assetTypes[assetTypeId];
1864
+ if (assetType) {
1865
+ acc.push(assetType);
1759
1866
  }
1760
1867
  return acc;
1761
1868
  }, []);
1762
1869
  };
1763
- const selectComponentAttachmentMapping = (state) => state.componentReducer.attachments;
1764
- const selectAllComponentAttachments = createSelector(
1765
- [selectComponentAttachmentMapping],
1870
+ const selectAssetAttachmentMapping = (state) => state.assetReducer.attachments;
1871
+ const selectAssetAttachments = createSelector(
1872
+ [selectAssetAttachmentMapping],
1766
1873
  (mapping) => Object.values(mapping)
1767
1874
  );
1768
- const selectComponentAttachment = (attachmentId) => (state) => {
1769
- return state.componentReducer.attachments[attachmentId];
1875
+ const selectAssetAttachment = (attachmentId) => (state) => {
1876
+ return state.assetReducer.attachments[attachmentId];
1770
1877
  };
1771
- const selectAttachmentsOfComponent = restructureCreateSelectorWithArgs(
1878
+ const selectAttachmentsOfAsset = restructureCreateSelectorWithArgs(
1772
1879
  createSelector(
1773
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1774
- (attachments, componentId) => {
1775
- return attachments.filter(({ component }) => componentId === component);
1880
+ [selectAssetAttachments, (_state, assetId) => assetId],
1881
+ (attachments, assetId) => {
1882
+ return attachments.filter(({ asset }) => assetId === asset);
1776
1883
  }
1777
1884
  )
1778
1885
  );
1779
- const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1886
+ const selectAttachmentsOfAssetsByType = restructureCreateSelectorWithArgs(
1780
1887
  createSelector(
1781
- [selectAllComponentAttachments, (_state, componentId) => componentId],
1782
- (attachments, componentId) => {
1783
- const attachmentsOfComponent = attachments.filter(({ component }) => componentId === component);
1784
- const fileAttachments = attachmentsOfComponent.filter(
1888
+ [selectAssetAttachments, (_state, assetId) => assetId],
1889
+ (attachments, assetId) => {
1890
+ const attachmentsOfAsset = attachments.filter(({ asset }) => assetId === asset);
1891
+ const fileAttachments = attachmentsOfAsset.filter(
1785
1892
  // this null check here is necessary, there are cases where file_type is null or undefined
1786
1893
  ({ file_type }) => !file_type || !file_type.startsWith("image/")
1787
1894
  );
1788
- const imageAttachments = attachmentsOfComponent.filter(
1895
+ const imageAttachments = attachmentsOfAsset.filter(
1789
1896
  // this null check here is necessary, there are cases where file_type is null or undefined
1790
1897
  ({ file_type }) => file_type && file_type.startsWith("image/")
1791
1898
  );
@@ -1793,69 +1900,67 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
1793
1900
  }
1794
1901
  )
1795
1902
  );
1796
- const componentReducer = componentSlice.reducer;
1903
+ const assetReducer = assetSlice.reducer;
1797
1904
  const initialState$o = {
1798
- completionsByComponentId: {}
1905
+ completionsByAssetId: {}
1799
1906
  };
1800
- const componentStageCompletionSlice = createSlice({
1801
- name: "componentStageCompletions",
1907
+ const assetStageCompletionSlice = createSlice({
1908
+ name: "assetStageCompletions",
1802
1909
  initialState: initialState$o,
1803
1910
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1804
1911
  reducers: {
1805
1912
  addStageCompletion: (state, action) => {
1806
- let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
1913
+ let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
1807
1914
  if (!stageToCompletionDateMapping) {
1808
1915
  stageToCompletionDateMapping = {};
1809
- state.completionsByComponentId[action.payload.component] = stageToCompletionDateMapping;
1916
+ state.completionsByAssetId[action.payload.asset] = stageToCompletionDateMapping;
1810
1917
  }
1811
1918
  stageToCompletionDateMapping[action.payload.stage] = (/* @__PURE__ */ new Date()).toISOString();
1812
1919
  },
1813
1920
  addStageCompletions: (state, action) => {
1814
- for (const [componentId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1921
+ for (const [assetId, stageIdToCompletionDateMapping] of Object.entries(action.payload)) {
1815
1922
  if (Object.keys(stageIdToCompletionDateMapping).length === 0)
1816
- throw new Error(
1817
- `Encountered empty stageIdToCompletionDateMapping argument for component ${componentId}`
1818
- );
1819
- let thisComponentCompletions = state.completionsByComponentId[componentId];
1820
- if (thisComponentCompletions === void 0) {
1821
- thisComponentCompletions = {};
1923
+ throw new Error(`Encountered empty stageIdToCompletionDateMapping argument for asset ${assetId}`);
1924
+ let thisAssetCompletions = state.completionsByAssetId[assetId];
1925
+ if (thisAssetCompletions === void 0) {
1926
+ thisAssetCompletions = {};
1822
1927
  }
1823
1928
  for (const [stageId, completionDate] of Object.entries(stageIdToCompletionDateMapping)) {
1824
- thisComponentCompletions[stageId] = completionDate;
1929
+ thisAssetCompletions[stageId] = completionDate;
1825
1930
  }
1826
- state.completionsByComponentId[componentId] = thisComponentCompletions;
1931
+ state.completionsByAssetId[assetId] = thisAssetCompletions;
1827
1932
  }
1828
1933
  },
1829
1934
  removeStageCompletions: (state, action) => {
1830
1935
  for (const completion of action.payload) {
1831
- const thisComponentCompletions = state.completionsByComponentId[completion.component];
1832
- if (!thisComponentCompletions || !(completion.stage in thisComponentCompletions)) {
1936
+ const thisAssetCompletions = state.completionsByAssetId[completion.asset];
1937
+ if (!thisAssetCompletions || !(completion.stage in thisAssetCompletions)) {
1833
1938
  console.warn(
1834
1939
  "Skipping removal of uncompleted stage. This message indicates completion objects are created unnecessarily."
1835
1940
  );
1836
1941
  continue;
1837
1942
  }
1838
- delete thisComponentCompletions[completion.stage];
1943
+ delete thisAssetCompletions[completion.stage];
1839
1944
  }
1840
1945
  },
1841
1946
  setStageCompletions: (state, action) => {
1842
- state.completionsByComponentId = action.payload;
1947
+ state.completionsByAssetId = action.payload;
1843
1948
  }
1844
1949
  }
1845
1950
  });
1846
- const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = componentStageCompletionSlice.actions;
1951
+ const { addStageCompletion, addStageCompletions, removeStageCompletions, setStageCompletions } = assetStageCompletionSlice.actions;
1847
1952
  const selectCompletedStages = (state) => {
1848
- return state.componentStageCompletionReducer.completionsByComponentId;
1953
+ return state.assetStageCompletionReducer.completionsByAssetId;
1849
1954
  };
1850
- const selectCompletedStageIdsForComponent = (component) => (state) => {
1851
- return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1955
+ const selectCompletedStageIdsForAsset = (asset) => (state) => {
1956
+ return Object.keys(state.assetStageCompletionReducer.completionsByAssetId[asset.offline_id] ?? {});
1852
1957
  };
1853
- const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1958
+ const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
1854
1959
  const initialState$n = {
1855
1960
  stages: {}
1856
1961
  };
1857
- const componentStageSlice = createSlice({
1858
- name: "componentStages",
1962
+ const assetStageSlice = createSlice({
1963
+ name: "assetStages",
1859
1964
  initialState: initialState$n,
1860
1965
  extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1861
1966
  reducers: {
@@ -1890,60 +1995,48 @@ const componentStageSlice = createSlice({
1890
1995
  }
1891
1996
  }
1892
1997
  });
1893
- const selectStageMapping = (state) => state.componentStageReducer.stages;
1998
+ const selectStageMapping = (state) => state.assetStageReducer.stages;
1894
1999
  const selectStage = restructureCreateSelectorWithArgs(
1895
2000
  createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
1896
2001
  return stageMapping[stageId];
1897
2002
  })
1898
2003
  );
1899
- const selectStages = createSelector(
1900
- [selectStageMapping],
1901
- (stageMapping) => {
1902
- return Object.values(stageMapping);
1903
- }
1904
- );
1905
- const selectStagesFromComponentTypeIds = restructureCreateSelectorWithArgs(
1906
- createSelector(
1907
- [selectStages, (_state, componentTypeIds) => componentTypeIds],
1908
- (stages, componentTypeIds) => {
1909
- const componentTypeIdsSet = new Set(componentTypeIds);
1910
- const ret = {};
1911
- for (const stage of stages) {
1912
- if (componentTypeIdsSet.has(stage.component_type)) {
1913
- if (!ret[stage.component_type]) {
1914
- ret[stage.component_type] = [];
1915
- }
1916
- ret[stage.component_type].push(stage);
2004
+ const selectStages = createSelector([selectStageMapping], (stageMapping) => {
2005
+ return Object.values(stageMapping);
2006
+ });
2007
+ const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
2008
+ createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
2009
+ const assetTypeIdsSet = new Set(assetTypeIds);
2010
+ const ret = {};
2011
+ for (const stage of stages) {
2012
+ if (assetTypeIdsSet.has(stage.asset_type)) {
2013
+ if (!ret[stage.asset_type]) {
2014
+ ret[stage.asset_type] = [];
1917
2015
  }
2016
+ ret[stage.asset_type].push(stage);
1918
2017
  }
1919
- for (const key in ret) {
1920
- ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
1921
- }
1922
- return ret;
1923
2018
  }
1924
- )
2019
+ for (const key in ret) {
2020
+ ret[key] = ret[key].sort((a, b) => a.priority - b.priority);
2021
+ }
2022
+ return ret;
2023
+ })
1925
2024
  );
1926
- const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
1927
- createSelector(
1928
- [selectStageMapping, (_state, componentTypeId) => componentTypeId],
1929
- (stagesMapping, componentTypeId) => {
1930
- const componentTypeStagesMapping = {};
1931
- for (const [stageId, stage] of Object.entries(stagesMapping)) {
1932
- if (stage.component_type === componentTypeId) {
1933
- componentTypeStagesMapping[stageId] = stage;
1934
- }
2025
+ const selectAssetTypeStagesMapping = restructureCreateSelectorWithArgs(
2026
+ createSelector([selectStageMapping, (_state, assetTypeId) => assetTypeId], (stagesMapping, assetTypeId) => {
2027
+ const assetTypeStagesMapping = {};
2028
+ for (const [stageId, stage] of Object.entries(stagesMapping)) {
2029
+ if (stage.asset_type === assetTypeId) {
2030
+ assetTypeStagesMapping[stageId] = stage;
1935
2031
  }
1936
- return componentTypeStagesMapping;
1937
2032
  }
1938
- )
2033
+ return assetTypeStagesMapping;
2034
+ })
1939
2035
  );
1940
- const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
1941
- createSelector(
1942
- [selectStages, (_state, componentTypeId) => componentTypeId],
1943
- (stages, componentTypeId) => {
1944
- return stages.filter((stage) => stage.component_type === componentTypeId).sort((a, b) => a.priority - b.priority);
1945
- }
1946
- )
2036
+ const selectStagesOfAssetType = restructureCreateSelectorWithArgs(
2037
+ createSelector([selectStages, (_state, assetTypeId) => assetTypeId], (stages, assetTypeId) => {
2038
+ return stages.filter((stage) => stage.asset_type === assetTypeId).sort((a, b) => a.priority - b.priority);
2039
+ })
1947
2040
  );
1948
2041
  const selectStagesFromStageIds = restructureCreateSelectorWithArgs(
1949
2042
  createSelector([selectStageMapping, (_state, stageIds) => stageIds], (stageMapping, stageIds) => {
@@ -1965,140 +2058,15 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
1965
2058
  return ret;
1966
2059
  })
1967
2060
  );
1968
- const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1969
- const componentStageReducer = componentStageSlice.reducer;
2061
+ const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = assetStageSlice.actions;
2062
+ const assetStageReducer = assetStageSlice.reducer;
1970
2063
  const initialState$m = {
1971
- componentTypes: {},
1972
- hiddenComponentTypeIds: {},
1973
- attachments: {}
1974
- };
1975
- const componentTypeSlice = createSlice({
1976
- name: "componentTypes",
1977
- initialState: initialState$m,
1978
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1979
- reducers: {
1980
- addComponentType: (state, action) => {
1981
- state.componentTypes[action.payload.offline_id] = action.payload;
1982
- },
1983
- setComponentTypes: (state, action) => {
1984
- state.componentTypes = toOfflineIdRecord(action.payload);
1985
- },
1986
- toggleComponentTypeVisibility: (state, action) => {
1987
- state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
1988
- },
1989
- deleteComponentType: (state, action) => {
1990
- delete state.componentTypes[action.payload];
1991
- },
1992
- // Attachments
1993
- setComponentTypeAttachment: setAttachment,
1994
- setComponentTypeAttachments: setAttachments,
1995
- addComponentTypeAttachment: addAttachment,
1996
- addComponentTypeAttachments: addAttachments,
1997
- updateComponentTypeAttachment: updateAttachment,
1998
- updateComponentTypeAttachments: updateAttachments,
1999
- removeComponentTypeAttachment: removeAttachment,
2000
- removeComponentTypeAttachments: removeAttachments
2001
- }
2002
- });
2003
- const {
2004
- addComponentType,
2005
- setComponentTypes,
2006
- toggleComponentTypeVisibility,
2007
- deleteComponentType,
2008
- // Attachmet
2009
- setComponentTypeAttachment,
2010
- setComponentTypeAttachments,
2011
- addComponentTypeAttachment,
2012
- addComponentTypeAttachments,
2013
- updateComponentTypeAttachment,
2014
- updateComponentTypeAttachments,
2015
- removeComponentTypeAttachment,
2016
- removeComponentTypeAttachments
2017
- } = componentTypeSlice.actions;
2018
- const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
2019
- const selectComponentTypes = createSelector(
2020
- [selectComponentTypesMapping],
2021
- (mapping) => Object.values(mapping)
2022
- );
2023
- const selectComponentType = restructureCreateSelectorWithArgs(
2024
- createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
2025
- );
2026
- const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
2027
- createSelector(
2028
- [
2029
- selectComponentTypesMapping,
2030
- (_state, args) => args
2031
- ],
2032
- (mapping, args) => {
2033
- var _a2;
2034
- const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
2035
- return Object.values(mapping).filter(
2036
- (componentType) => {
2037
- var _a3;
2038
- return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
2039
- }
2040
- ).length;
2041
- }
2042
- )
2043
- );
2044
- const selectComponentTypesByName = restructureCreateSelectorWithArgs(
2045
- createSelector(
2046
- [selectComponentTypesMapping, (_state, name) => name],
2047
- (mapping, name) => {
2048
- name = (name == null ? void 0 : name.toLowerCase()) ?? null;
2049
- return Object.values(mapping).filter(
2050
- (componentType) => {
2051
- var _a2;
2052
- return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
2053
- }
2054
- );
2055
- }
2056
- )
2057
- );
2058
- const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
2059
- const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
2060
- const selectAllComponentTypeAttachments = createSelector(
2061
- [selectComponentTypeAttachmentMapping],
2062
- (mapping) => Object.values(mapping)
2063
- );
2064
- const selectComponentTypeAttachment = (attachmentId) => (state) => {
2065
- return state.componentTypeReducer.attachments[attachmentId];
2066
- };
2067
- const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
2068
- createSelector(
2069
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
2070
- (attachments, componentTypeId) => {
2071
- return attachments.filter(({ component_type }) => componentTypeId === component_type);
2072
- }
2073
- )
2074
- );
2075
- const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
2076
- createSelector(
2077
- [selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
2078
- (attachments, componentTypeId) => {
2079
- const attachmentsOfComponent = attachments.filter(
2080
- ({ component_type }) => component_type === componentTypeId
2081
- );
2082
- const fileAttachments = attachmentsOfComponent.filter(
2083
- // this null check here is necessary, there are cases where file_type is null or undefined
2084
- ({ file_type }) => !file_type || !file_type.startsWith("image/")
2085
- );
2086
- const imageAttachments = attachmentsOfComponent.filter(
2087
- // this null check here is necessary, there are cases where file_type is null or undefined
2088
- ({ file_type }) => file_type && file_type.startsWith("image/")
2089
- );
2090
- return { fileAttachments, imageAttachments };
2091
- }
2092
- )
2093
- );
2094
- const componentTypeReducer = componentTypeSlice.reducer;
2095
- const initialState$l = {
2096
2064
  workspaces: {},
2097
2065
  activeWorkspaceId: null
2098
2066
  };
2099
2067
  const workspaceSlice = createSlice({
2100
2068
  name: "workspace",
2101
- initialState: initialState$l,
2069
+ initialState: initialState$m,
2102
2070
  // The `reducers` field lets us define reducers and generate associated actions
2103
2071
  reducers: {
2104
2072
  setWorkspaces: (state, action) => {
@@ -2155,7 +2123,7 @@ const selectPermittedWorkspaceIds = createSelector(
2155
2123
  );
2156
2124
  const workspaceReducer = workspaceSlice.reducer;
2157
2125
  const maxRecentIssues = 10;
2158
- const initialState$k = {
2126
+ const initialState$l = {
2159
2127
  issues: {},
2160
2128
  attachments: {},
2161
2129
  comments: {},
@@ -2167,9 +2135,9 @@ const initialState$k = {
2167
2135
  };
2168
2136
  const issueSlice = createSlice({
2169
2137
  name: "issues",
2170
- initialState: initialState$k,
2138
+ initialState: initialState$l,
2171
2139
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2172
- Object.assign(state, initialState$k);
2140
+ Object.assign(state, initialState$l);
2173
2141
  }),
2174
2142
  reducers: {
2175
2143
  setIssues: (state, action) => {
@@ -2602,14 +2570,14 @@ const selectRecentIssuesAsSearchResults = createSelector(
2602
2570
  }
2603
2571
  );
2604
2572
  const issueReducer = issueSlice.reducer;
2605
- const initialState$j = {
2573
+ const initialState$k = {
2606
2574
  issueTypes: {}
2607
2575
  };
2608
2576
  const issueTypeSlice = createSlice({
2609
2577
  name: "issueTypes",
2610
- initialState: initialState$j,
2578
+ initialState: initialState$k,
2611
2579
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2612
- Object.assign(state, initialState$j);
2580
+ Object.assign(state, initialState$k);
2613
2581
  }),
2614
2582
  reducers: {
2615
2583
  setIssueTypes: (state, action) => {
@@ -2676,15 +2644,15 @@ const selectIssuesOfIssueTypeCount = (issueTypeId) => (state) => {
2676
2644
  return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
2677
2645
  };
2678
2646
  const issueTypeReducer = issueTypeSlice.reducer;
2679
- const initialState$i = {
2647
+ const initialState$j = {
2680
2648
  s3Urls: {}
2681
2649
  };
2682
2650
  const msPerHour = 1e3 * 60 * 60;
2683
2651
  const msPerWeek = msPerHour * 24 * 7;
2684
2652
  const fileSlice = createSlice({
2685
2653
  name: "file",
2686
- initialState: initialState$i,
2687
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2654
+ initialState: initialState$j,
2655
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
2688
2656
  reducers: {
2689
2657
  setUploadUrl: (state, action) => {
2690
2658
  const { url, fields, sha1 } = action.payload;
@@ -2711,7 +2679,7 @@ const selectUploadUrl = (sha1) => (state) => {
2711
2679
  return url;
2712
2680
  };
2713
2681
  const fileReducer = fileSlice.reducer;
2714
- const initialState$h = {
2682
+ const initialState$i = {
2715
2683
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2716
2684
  mapStyle: MapStyle.SATELLITE,
2717
2685
  showTooltips: false,
@@ -2719,8 +2687,8 @@ const initialState$h = {
2719
2687
  };
2720
2688
  const mapSlice = createSlice({
2721
2689
  name: "map",
2722
- initialState: initialState$h,
2723
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2690
+ initialState: initialState$i,
2691
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2724
2692
  reducers: {
2725
2693
  setMapStyle: (state, action) => {
2726
2694
  state.mapStyle = action.payload;
@@ -2750,8 +2718,8 @@ var OrganizationAccessLevel = /* @__PURE__ */ ((OrganizationAccessLevel2) => {
2750
2718
  })(OrganizationAccessLevel || {});
2751
2719
  var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
2752
2720
  AttachmentModel2["Issue"] = "issue";
2753
- AttachmentModel2["Component"] = "component";
2754
- AttachmentModel2["ComponentType"] = "component_type";
2721
+ AttachmentModel2["Asset"] = "asset";
2722
+ AttachmentModel2["AssetType"] = "asset_type";
2755
2723
  AttachmentModel2["Project"] = "project";
2756
2724
  AttachmentModel2["Document"] = "document";
2757
2725
  return AttachmentModel2;
@@ -2797,7 +2765,7 @@ var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
2797
2765
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
2798
2766
  return LicenseStatus2;
2799
2767
  })(LicenseStatus || {});
2800
- const initialState$g = {
2768
+ const initialState$h = {
2801
2769
  users: {},
2802
2770
  currentUser: {
2803
2771
  id: 0,
@@ -2808,8 +2776,8 @@ const initialState$g = {
2808
2776
  };
2809
2777
  const userSlice = createSlice({
2810
2778
  name: "users",
2811
- initialState: initialState$g,
2812
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2779
+ initialState: initialState$h,
2780
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2813
2781
  reducers: {
2814
2782
  setUsers: (state, action) => {
2815
2783
  const usersMapping = {};
@@ -2871,13 +2839,13 @@ const selectUser = (userId) => (state) => {
2871
2839
  const selectUsersAsMapping = (state) => state.userReducer.users;
2872
2840
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2873
2841
  const userReducer = userSlice.reducer;
2874
- const initialState$f = {
2842
+ const initialState$g = {
2875
2843
  organizationAccesses: {}
2876
2844
  };
2877
2845
  const organizationAccessSlice = createSlice({
2878
2846
  name: "organizationAccess",
2879
- initialState: initialState$f,
2880
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2847
+ initialState: initialState$g,
2848
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2881
2849
  reducers: {
2882
2850
  setOrganizationAccesses: (state, action) => {
2883
2851
  if (!Array.isArray(action.payload))
@@ -2940,13 +2908,13 @@ const selectOrganizationAccessUserMapping = (state) => {
2940
2908
  return organizationAccesses;
2941
2909
  };
2942
2910
  const organizationAccessReducer = organizationAccessSlice.reducer;
2943
- const initialState$e = {
2911
+ const initialState$f = {
2944
2912
  licenses: {}
2945
2913
  };
2946
2914
  const licenseSlice = createSlice({
2947
2915
  name: "license",
2948
- initialState: initialState$e,
2949
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2916
+ initialState: initialState$f,
2917
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2950
2918
  reducers: {
2951
2919
  setLicenses: (state, action) => {
2952
2920
  if (!Array.isArray(action.payload))
@@ -2991,13 +2959,13 @@ const selectLicensesForProjectsMapping = createSelector(
2991
2959
  (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2992
2960
  );
2993
2961
  const licenseReducer = licenseSlice.reducer;
2994
- const initialState$d = {
2962
+ const initialState$e = {
2995
2963
  projectAccesses: {}
2996
2964
  };
2997
2965
  const projectAccessSlice = createSlice({
2998
2966
  name: "projectAccess",
2999
- initialState: initialState$d,
3000
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2967
+ initialState: initialState$e,
2968
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
3001
2969
  reducers: {
3002
2970
  setProjectAccesses: (state, action) => {
3003
2971
  if (!Array.isArray(action.payload))
@@ -3065,7 +3033,7 @@ const selectProjectAccessUserMapping = (state) => {
3065
3033
  return projectAccesses;
3066
3034
  };
3067
3035
  const projectAccessReducer = projectAccessSlice.reducer;
3068
- const initialState$c = {
3036
+ const initialState$d = {
3069
3037
  projects: {},
3070
3038
  activeProjectId: null,
3071
3039
  recentProjectIds: [],
@@ -3075,7 +3043,7 @@ const initialState$c = {
3075
3043
  };
3076
3044
  const projectSlice = createSlice({
3077
3045
  name: "projects",
3078
- initialState: initialState$c,
3046
+ initialState: initialState$d,
3079
3047
  reducers: {
3080
3048
  setProjects: (state, action) => {
3081
3049
  const projectsMap = {};
@@ -3269,14 +3237,14 @@ const selectAttachmentsOfProjectByType = restructureCreateSelectorWithArgs(
3269
3237
  }
3270
3238
  )
3271
3239
  );
3272
- const initialState$b = {
3240
+ const initialState$c = {
3273
3241
  organizations: {},
3274
3242
  activeOrganizationId: null
3275
3243
  };
3276
3244
  const organizationSlice = createSlice({
3277
3245
  name: "organizations",
3278
- initialState: initialState$b,
3279
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3246
+ initialState: initialState$c,
3247
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
3280
3248
  reducers: {
3281
3249
  setOrganizations: (state, action) => {
3282
3250
  for (const org of action.payload) {
@@ -3395,14 +3363,14 @@ const createOfflineAction = (request2, baseUrl) => {
3395
3363
  }
3396
3364
  };
3397
3365
  };
3398
- const initialState$a = {
3366
+ const initialState$b = {
3399
3367
  deletedRequests: [],
3400
3368
  latestRetryTime: 0
3401
3369
  };
3402
3370
  const outboxSlice = createSlice({
3403
3371
  name: "outbox",
3404
- initialState: initialState$a,
3405
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3372
+ initialState: initialState$b,
3373
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
3406
3374
  reducers: {
3407
3375
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
3408
3376
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -3434,7 +3402,7 @@ const selectDeletedRequests = (state) => state.outboxReducer.deletedRequests;
3434
3402
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
3435
3403
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
3436
3404
  const outboxReducer = outboxSlice.reducer;
3437
- const initialState$9 = {
3405
+ const initialState$a = {
3438
3406
  projectFiles: {},
3439
3407
  activeProjectFileId: null,
3440
3408
  isImportingProjectFile: false,
@@ -3442,8 +3410,8 @@ const initialState$9 = {
3442
3410
  };
3443
3411
  const projectFileSlice = createSlice({
3444
3412
  name: "projectFiles",
3445
- initialState: initialState$9,
3446
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
3413
+ initialState: initialState$a,
3414
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
3447
3415
  reducers: {
3448
3416
  addOrReplaceProjectFiles: (state, action) => {
3449
3417
  for (let fileObj of action.payload) {
@@ -3544,12 +3512,12 @@ const selectProjectFiles = createSelector(
3544
3512
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
3545
3513
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
3546
3514
  const projectFileReducer = projectFileSlice.reducer;
3547
- const initialState$8 = {
3515
+ const initialState$9 = {
3548
3516
  isRehydrated: false
3549
3517
  };
3550
3518
  const rehydratedSlice = createSlice({
3551
3519
  name: "rehydrated",
3552
- initialState: initialState$8,
3520
+ initialState: initialState$9,
3553
3521
  // The `reducers` field lets us define reducers and generate associated actions
3554
3522
  reducers: {
3555
3523
  setRehydrated: (state, action) => {
@@ -3559,11 +3527,12 @@ const rehydratedSlice = createSlice({
3559
3527
  });
3560
3528
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
3561
3529
  const rehydratedReducer = rehydratedSlice.reducer;
3562
- const initialState$7 = {
3530
+ const initialState$8 = {
3563
3531
  useIssueTemplate: false,
3564
3532
  placementMode: false,
3565
3533
  enableClustering: false,
3566
3534
  svgLayout: false,
3535
+ // TODO: this is no longer used
3567
3536
  expandedSections: {
3568
3537
  Issues: true,
3569
3538
  "Map Layers": false,
@@ -3576,8 +3545,8 @@ const initialState$7 = {
3576
3545
  };
3577
3546
  const settingSlice = createSlice({
3578
3547
  name: "settings",
3579
- initialState: initialState$7,
3580
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3548
+ initialState: initialState$8,
3549
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3581
3550
  reducers: {
3582
3551
  setEnableDuplicateIssues: (state, action) => {
3583
3552
  state.useIssueTemplate = action.payload;
@@ -3636,14 +3605,14 @@ const formRevisionSortFn = (formRevisionA, formRevisionB) => {
3636
3605
  return revisionA < revisionB ? -1 : 1;
3637
3606
  }
3638
3607
  };
3639
- const initialState$6 = {
3608
+ const initialState$7 = {
3640
3609
  formRevisions: {},
3641
3610
  attachments: {}
3642
3611
  };
3643
3612
  const formRevisionsSlice = createSlice({
3644
3613
  name: "formRevisions",
3645
- initialState: initialState$6,
3646
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3614
+ initialState: initialState$7,
3615
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3647
3616
  reducers: {
3648
3617
  // revision related actions
3649
3618
  setFormRevision: (state, action) => {
@@ -3774,27 +3743,27 @@ const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
3774
3743
  });
3775
3744
  })
3776
3745
  );
3777
- const selectLatestFormRevisionsOfComponentTypes = restructureCreateSelectorWithArgs(
3746
+ const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
3778
3747
  createSelector(
3779
3748
  [
3780
3749
  (state) => state.formReducer.forms,
3781
3750
  selectFormRevisionMapping,
3782
- (_state, componentTypeIds) => componentTypeIds
3751
+ (_state, assetTypeIds) => assetTypeIds
3783
3752
  ],
3784
- (userForms, revisions, componentTypeIds) => {
3785
- const componentTypeIdsSet = new Set(componentTypeIds);
3786
- const formsOfComponentTypes = {};
3753
+ (userForms, revisions, assetTypeIds) => {
3754
+ const assetTypeIdsSet = new Set(assetTypeIds);
3755
+ const formsOfAssetTypes = {};
3787
3756
  const ret = {};
3788
3757
  for (const form of Object.values(userForms)) {
3789
- if (form.component_type && componentTypeIdsSet.has(form.component_type)) {
3790
- formsOfComponentTypes[form.offline_id] = form;
3758
+ if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
3759
+ formsOfAssetTypes[form.offline_id] = form;
3791
3760
  }
3792
3761
  }
3793
3762
  for (const revision of Object.values(revisions)) {
3794
- const form = formsOfComponentTypes[revision.form];
3795
- if (!form || !form.component_type || ret[form.component_type] && formRevisionSortFn(ret[form.component_type], revision) > 0)
3763
+ const form = formsOfAssetTypes[revision.form];
3764
+ if (!form || !form.asset_type || ret[form.asset_type] && formRevisionSortFn(ret[form.asset_type], revision) > 0)
3796
3765
  continue;
3797
- ret[form.component_type] = revision;
3766
+ ret[form.asset_type] = revision;
3798
3767
  }
3799
3768
  return ret;
3800
3769
  }
@@ -3823,13 +3792,13 @@ const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
3823
3792
  )
3824
3793
  );
3825
3794
  const formRevisionReducer = formRevisionsSlice.reducer;
3826
- const initialState$5 = {
3795
+ const initialState$6 = {
3827
3796
  forms: {}
3828
3797
  };
3829
3798
  const formSlice = createSlice({
3830
3799
  name: "forms",
3831
- initialState: initialState$5,
3832
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3800
+ initialState: initialState$6,
3801
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3833
3802
  reducers: {
3834
3803
  setForms: (state, action) => {
3835
3804
  state.forms = {};
@@ -3911,11 +3880,11 @@ const selectForm = (formId2) => (state) => {
3911
3880
  const selectFormMapping = (state) => {
3912
3881
  return state.formReducer.forms;
3913
3882
  };
3914
- const selectFormOfComponentType = restructureCreateSelectorWithArgs(
3883
+ const selectFormOfAssetType = restructureCreateSelectorWithArgs(
3915
3884
  createSelector(
3916
- [selectFormMapping, (_state, componentTypeId) => componentTypeId],
3917
- (userForms, componentTypeId) => {
3918
- return Object.values(userForms).find((userForm) => userForm.component_type === componentTypeId);
3885
+ [selectFormMapping, (_state, assetTypeId) => assetTypeId],
3886
+ (userForms, assetTypeId) => {
3887
+ return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
3919
3888
  }
3920
3889
  )
3921
3890
  );
@@ -3931,17 +3900,17 @@ const selectFormsCount = createSelector([selectFormMapping], (userForms) => {
3931
3900
  return Object.keys(userForms).length;
3932
3901
  });
3933
3902
  const selectGeneralFormCount = createSelector([selectFormMapping], (userForms) => {
3934
- return Object.values(userForms).filter((form) => !form.component_type).length;
3903
+ return Object.values(userForms).filter((form) => !form.asset_type).length;
3935
3904
  });
3936
3905
  const formReducer = formSlice.reducer;
3937
- const initialState$4 = {
3906
+ const initialState$5 = {
3938
3907
  formSubmissions: {},
3939
3908
  attachments: {}
3940
3909
  };
3941
3910
  const formSubmissionSlice = createSlice({
3942
3911
  name: "formSubmissions",
3943
- initialState: initialState$4,
3944
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3912
+ initialState: initialState$5,
3913
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3945
3914
  reducers: {
3946
3915
  setFormSubmission: (state, action) => {
3947
3916
  state.formSubmissions[action.payload.offline_id] = action.payload;
@@ -4139,31 +4108,31 @@ const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
4139
4108
  }
4140
4109
  )
4141
4110
  );
4142
- const selectFormSubmissionsOfComponent = restructureCreateSelectorWithArgs(
4111
+ const selectFormSubmissionsOfAsset = restructureCreateSelectorWithArgs(
4143
4112
  createSelector(
4144
- [selectFormSubmissions, (_state, componentId) => componentId],
4145
- (submissions, componentId) => {
4113
+ [selectFormSubmissions, (_state, assetId) => assetId],
4114
+ (submissions, assetId) => {
4146
4115
  return submissions.filter((submission) => {
4147
- return submission.component === componentId;
4116
+ return submission.asset === assetId;
4148
4117
  });
4149
4118
  }
4150
4119
  )
4151
4120
  );
4152
- const selectFormSubmissionsByComponents = createSelector(
4153
- [selectFormSubmissionsMapping, selectComponentsMapping],
4154
- (submissions, components) => {
4121
+ const selectFormSubmissionsByAssets = createSelector(
4122
+ [selectFormSubmissionsMapping, selectAssetsMapping],
4123
+ (submissions, assets) => {
4155
4124
  var _a2;
4156
- const componentSubmissionMapping = {};
4157
- for (const componentId in components) {
4158
- componentSubmissionMapping[componentId] = [];
4125
+ const assetSubmissionMapping = {};
4126
+ for (const assetId in assets) {
4127
+ assetSubmissionMapping[assetId] = [];
4159
4128
  }
4160
4129
  for (const submissionId in submissions) {
4161
4130
  const submission = submissions[submissionId];
4162
- if (submission.component) {
4163
- (_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
4131
+ if (submission.asset) {
4132
+ (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
4164
4133
  }
4165
4134
  }
4166
- return componentSubmissionMapping;
4135
+ return assetSubmissionMapping;
4167
4136
  }
4168
4137
  );
4169
4138
  const selectFormSubmissionAttachmentsMapping = (state) => {
@@ -4178,12 +4147,12 @@ const selectAttachmentsOfFormSubmission = restructureCreateSelectorWithArgs(
4178
4147
  )
4179
4148
  );
4180
4149
  const formSubmissionReducer = formSubmissionSlice.reducer;
4181
- const initialState$3 = {
4150
+ const initialState$4 = {
4182
4151
  emailDomains: {}
4183
4152
  };
4184
4153
  const emailDomainsSlice = createSlice({
4185
4154
  name: "emailDomains",
4186
- initialState: initialState$3,
4155
+ initialState: initialState$4,
4187
4156
  reducers: {
4188
4157
  setEmailDomains: (state, action) => {
4189
4158
  const emailDomains = {};
@@ -4210,15 +4179,15 @@ const selectSortedEmailDomains = (state) => Object.values(state.emailDomainsRedu
4210
4179
  (ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
4211
4180
  );
4212
4181
  const emailDomainsReducer = emailDomainsSlice.reducer;
4213
- const initialState$2 = {
4182
+ const initialState$3 = {
4214
4183
  documents: {},
4215
4184
  attachments: {}
4216
4185
  };
4217
4186
  const documentSlice = createSlice({
4218
4187
  name: "documents",
4219
- initialState: initialState$2,
4188
+ initialState: initialState$3,
4220
4189
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
4221
- Object.assign(state, initialState$2);
4190
+ Object.assign(state, initialState$3);
4222
4191
  }),
4223
4192
  reducers: {
4224
4193
  setDocuments: (state, action) => {
@@ -4449,13 +4418,13 @@ const selectAttachmentsOfDocumentByType = restructureCreateSelectorWithArgs(
4449
4418
  )
4450
4419
  );
4451
4420
  const documentsReducer = documentSlice.reducer;
4452
- const initialState$1 = {
4421
+ const initialState$2 = {
4453
4422
  teams: {}
4454
4423
  };
4455
4424
  const teamSlice = createSlice({
4456
4425
  name: "teams",
4457
- initialState: initialState$1,
4458
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4426
+ initialState: initialState$2,
4427
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
4459
4428
  reducers: {
4460
4429
  setTeam: (state, action) => {
4461
4430
  state.teams[action.payload.offline_id] = action.payload;
@@ -4505,6 +4474,54 @@ const selectTeamsOfUser = restructureCreateSelectorWithArgs(
4505
4474
  })
4506
4475
  );
4507
4476
  const teamReducer = teamSlice.reducer;
4477
+ const initialState$1 = {
4478
+ conversations: {}
4479
+ };
4480
+ const agentsSlice = createSlice({
4481
+ name: "agents",
4482
+ initialState: initialState$1,
4483
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
4484
+ reducers: {
4485
+ setConversations: (state, action) => {
4486
+ state.conversations = {};
4487
+ for (const conversation of action.payload) {
4488
+ state.conversations[conversation.offline_id] = conversation;
4489
+ }
4490
+ },
4491
+ addConversation: (state, action) => {
4492
+ if (action.payload.offline_id in state.conversations) {
4493
+ throw new Error("Conversation already exists in history");
4494
+ }
4495
+ state.conversations[action.payload.offline_id] = action.payload;
4496
+ },
4497
+ setConversation: (state, action) => {
4498
+ if (!(action.payload.offline_id in state.conversations)) {
4499
+ throw new Error("Conversation does not exist in history");
4500
+ }
4501
+ state.conversations[action.payload.offline_id] = action.payload;
4502
+ },
4503
+ updateConversation: (state, action) => {
4504
+ const existing = state.conversations[action.payload.offline_id];
4505
+ if (!existing) {
4506
+ throw new Error("Conversation does not exist in history");
4507
+ }
4508
+ state.conversations[action.payload.offline_id] = { ...existing, ...action.payload };
4509
+ }
4510
+ }
4511
+ });
4512
+ const { setConversations, addConversation, setConversation, updateConversation } = agentsSlice.actions;
4513
+ const selectConversationMapping = (state) => state.agentsReducer.conversations;
4514
+ const selectConversations = createSelector(
4515
+ [selectConversationMapping],
4516
+ (conversationMapping) => Object.values(conversationMapping)
4517
+ );
4518
+ const selectConversation = restructureCreateSelectorWithArgs(
4519
+ createSelector(
4520
+ [selectConversationMapping, (_state, conversationId) => conversationId],
4521
+ (conversationMapping, conversationId) => conversationMapping[conversationId]
4522
+ )
4523
+ );
4524
+ const agentsReducer = agentsSlice.reducer;
4508
4525
  const initialState = {
4509
4526
  version: 0
4510
4527
  };
@@ -4514,7 +4531,7 @@ const versioningSlice = createSlice({
4514
4531
  reducers: {}
4515
4532
  });
4516
4533
  const versioningReducer = versioningSlice.reducer;
4517
- const fullComponentMarkerSize = 45;
4534
+ const fullAssetMarkerSize = 45;
4518
4535
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
4519
4536
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
4520
4537
  const OUTBOX_RETRY_DELAY = 5e3;
@@ -4532,10 +4549,10 @@ const overmapReducers = {
4532
4549
  fileReducer,
4533
4550
  authReducer,
4534
4551
  categoryReducer,
4535
- componentReducer,
4536
- componentStageCompletionReducer,
4537
- componentStageReducer,
4538
- componentTypeReducer,
4552
+ assetReducer,
4553
+ assetStageCompletionReducer,
4554
+ assetStageReducer,
4555
+ assetTypeReducer,
4539
4556
  issueReducer,
4540
4557
  issueTypeReducer,
4541
4558
  mapReducer,
@@ -4555,7 +4572,8 @@ const overmapReducers = {
4555
4572
  emailDomainsReducer,
4556
4573
  licenseReducer,
4557
4574
  documentsReducer,
4558
- teamReducer
4575
+ teamReducer,
4576
+ agentsReducer
4559
4577
  };
4560
4578
  const overmapReducer = combineReducers(overmapReducers);
4561
4579
  const resetStore = "RESET";
@@ -5315,6 +5333,9 @@ class AuthService extends BaseApiService {
5315
5333
  }
5316
5334
  async setTourStep(stepIndex) {
5317
5335
  this.client.store.dispatch(setTourStep(stepIndex));
5336
+ const currentStep = this.client.store.getState().userReducer.currentUser.profile.tour_step;
5337
+ if (currentStep === stepIndex)
5338
+ return Promise.resolve(void 0);
5318
5339
  return this.enqueueRequest({
5319
5340
  description: "Set tour step",
5320
5341
  method: HttpMethod.PATCH,
@@ -5433,244 +5454,234 @@ class CategoryService extends BaseApiService {
5433
5454
  store.dispatch(setCategories(result));
5434
5455
  }
5435
5456
  }
5436
- class ComponentService extends BaseApiService {
5457
+ class AssetService extends BaseApiService {
5437
5458
  // Basic CRUD functions
5438
- add(component, workspaceId) {
5439
- const offlineComponent = offline(component);
5440
- this.client.store.dispatch(addComponent(offlineComponent));
5459
+ add(asset, workspaceId) {
5460
+ const offlineAsset = offline(asset);
5461
+ this.client.store.dispatch(addAsset(offlineAsset));
5441
5462
  const promise = this.enqueueRequest({
5442
- description: "Create Component",
5463
+ description: "Create asset",
5443
5464
  method: HttpMethod.POST,
5444
- url: `/components/types/${offlineComponent.component_type}/add-components/`,
5465
+ url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
5445
5466
  queryParams: {
5446
5467
  workspace_id: workspaceId.toString()
5447
5468
  },
5448
- payload: { components: [offlineComponent] },
5469
+ payload: { assets: [offlineAsset] },
5449
5470
  blockers: [],
5450
- blocks: [offlineComponent.offline_id]
5471
+ blocks: [offlineAsset.offline_id]
5451
5472
  });
5452
- return [offlineComponent, promise];
5473
+ return [offlineAsset, promise];
5453
5474
  }
5454
- update(component, workspaceId) {
5455
- this.client.store.dispatch(updateComponent(component));
5475
+ update(asset, workspaceId) {
5476
+ this.client.store.dispatch(updateAsset(asset));
5456
5477
  const promise = this.enqueueRequest({
5457
- description: "Edit component",
5478
+ description: "Edit asset",
5458
5479
  method: HttpMethod.PATCH,
5459
- url: `/components/${component.offline_id}/`,
5480
+ url: `/assets/${asset.offline_id}/`,
5460
5481
  queryParams: {
5461
5482
  workspace_id: workspaceId.toString()
5462
5483
  },
5463
- payload: component,
5464
- blockers: [component.offline_id],
5465
- blocks: [component.offline_id]
5484
+ payload: asset,
5485
+ blockers: [asset.offline_id],
5486
+ blocks: [asset.offline_id]
5466
5487
  });
5467
- return [component, promise];
5488
+ return [asset, promise];
5468
5489
  }
5469
- async remove(id) {
5490
+ async remove(assetId) {
5470
5491
  const { store } = this.client;
5471
- const backupComponent = selectComponent(id)(store.getState());
5472
- if (!backupComponent)
5473
- throw new Error(`No component with id ${id} found in the store`);
5474
- const attachmentsOfComponent = selectAttachmentsOfComponent(id)(store.getState());
5475
- store.dispatch(removeComponent(id));
5476
- if (attachmentsOfComponent.length > 0) {
5477
- const attachmentsOfComponentIds = attachmentsOfComponent.map(({ offline_id }) => offline_id);
5478
- store.dispatch(removeComponentAttachments(attachmentsOfComponentIds));
5492
+ const assetToBeDeleted = selectAsset(assetId)(store.getState());
5493
+ if (!assetToBeDeleted)
5494
+ throw new Error(`No asset with id ${assetId} found in the store`);
5495
+ const attachmentsOfAssets = selectAttachmentsOfAsset(assetId)(store.getState());
5496
+ store.dispatch(removeAsset(assetId));
5497
+ if (attachmentsOfAssets.length > 0) {
5498
+ const attachmentsOfAssetIds = attachmentsOfAssets.map(({ offline_id }) => offline_id);
5499
+ store.dispatch(removeAssetAttachments(attachmentsOfAssetIds));
5479
5500
  }
5480
5501
  return this.enqueueRequest({
5481
- description: "Delete issue",
5502
+ description: "Delete asset",
5482
5503
  method: HttpMethod.DELETE,
5483
- url: `/components/${id}/`,
5484
- blockers: [id],
5504
+ url: `/assets/${assetId}/`,
5505
+ blockers: [assetId],
5485
5506
  blocks: []
5486
5507
  }).catch((err) => {
5487
- store.dispatch(addComponent(backupComponent));
5488
- store.dispatch(addComponentAttachments(attachmentsOfComponent));
5508
+ store.dispatch(addAsset(assetToBeDeleted));
5509
+ store.dispatch(addAssetAttachments(attachmentsOfAssets));
5489
5510
  throw err;
5490
5511
  });
5491
5512
  }
5492
- async deleteAllByComponentType(componentTypeId) {
5493
- const clientStore2 = this.client.store;
5494
- const allComponentsOfType = selectComponentsFromComponentType(componentTypeId)(clientStore2.getState());
5495
- const affectedComponentIds = (allComponentsOfType || []).map((c) => c.offline_id);
5496
- const affectedOfflineIds = [componentTypeId, ...affectedComponentIds];
5513
+ async deleteAllAssetsOfAssetType(assetTypeId) {
5497
5514
  const { store } = this.client;
5498
5515
  const state = store.getState();
5499
- const componentsOfThisType = selectComponentsByType(componentTypeId)(state);
5500
- store.dispatch(removeAllComponentsOfType(componentTypeId));
5516
+ const allAssetsOfAssetType = selectAssetsOfAssetType(assetTypeId)(state);
5517
+ const allAssetsOfAssetTypeIds = (allAssetsOfAssetType || []).map((c) => c.offline_id);
5518
+ const affectedOfflineIds = [assetTypeId, ...allAssetsOfAssetTypeIds];
5519
+ store.dispatch(removeAllAssetsOfType(assetTypeId));
5501
5520
  return this.enqueueRequest({
5502
- description: "Batch delete components by component type",
5521
+ description: "Delete all assets of asset type",
5503
5522
  method: HttpMethod.DELETE,
5504
- url: `/components/types/${componentTypeId}/delete-all-of-type/`,
5523
+ url: `/assets/types/${assetTypeId}/delete-all-of-type/`,
5505
5524
  blockers: affectedOfflineIds,
5506
5525
  blocks: affectedOfflineIds
5507
5526
  }).catch((err) => {
5508
- if (componentsOfThisType) {
5509
- store.dispatch(addComponentsInBatches(componentsOfThisType));
5527
+ if (allAssetsOfAssetType) {
5528
+ store.dispatch(addAssetsInBatches(allAssetsOfAssetType));
5510
5529
  }
5511
5530
  throw err;
5512
5531
  });
5513
5532
  }
5514
- async addBatch(componentsToCreate, workspaceId, componentTypeId) {
5515
- const fullComponents = componentsToCreate.map((component) => {
5516
- return { ...offline(component), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5533
+ async addBatch(assetsToCreate, workspaceId, assetTypeId) {
5534
+ const fullAssets = assetsToCreate.map((asset) => {
5535
+ return { ...offline(asset), submitted_at: (/* @__PURE__ */ new Date()).toISOString() };
5517
5536
  });
5518
5537
  const { store } = this.client;
5519
- store.dispatch(addComponentsInBatches(fullComponents));
5538
+ store.dispatch(addAssetsInBatches(fullAssets));
5520
5539
  const promise = this.enqueueRequest({
5521
- description: "Batch create components",
5540
+ description: "Batch create assets",
5522
5541
  method: HttpMethod.POST,
5523
- url: `/components/types/${componentTypeId}/add-components/`,
5542
+ url: `/assets/types/${assetTypeId}/add-assets/`,
5524
5543
  queryParams: {
5525
5544
  workspace_id: workspaceId.toString()
5526
5545
  },
5527
5546
  payload: {
5528
- components: fullComponents
5547
+ assets: fullAssets
5529
5548
  },
5530
- blockers: [componentTypeId],
5531
- blocks: fullComponents.map((c) => c.offline_id)
5549
+ blockers: [assetTypeId],
5550
+ blocks: fullAssets.map((c) => c.offline_id)
5532
5551
  });
5533
5552
  void promise.then((result) => {
5534
- for (const component of Object.values(result)) {
5535
- store.dispatch(updateComponent(component));
5553
+ for (const assets of Object.values(result)) {
5554
+ store.dispatch(updateAsset(assets));
5536
5555
  }
5537
5556
  }).catch((e) => {
5538
- for (const component of fullComponents) {
5539
- store.dispatch(removeComponent(component.offline_id));
5557
+ for (const asset of fullAssets) {
5558
+ store.dispatch(removeAsset(asset.offline_id));
5540
5559
  }
5541
5560
  throw e;
5542
5561
  });
5543
5562
  return promise;
5544
5563
  }
5545
- async refreshStore(replace) {
5564
+ async refreshStore() {
5546
5565
  const { store } = this.client;
5547
5566
  const result = await this.enqueueRequest({
5548
- description: "Get components",
5567
+ description: "Get assets",
5549
5568
  method: HttpMethod.GET,
5550
- url: `/projects/${store.getState().projectReducer.activeProjectId}/components/`,
5569
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/assets/`,
5551
5570
  blockers: [],
5552
5571
  blocks: []
5553
5572
  });
5554
- if (replace) {
5555
- store.dispatch(setComponents(result));
5556
- } else {
5557
- store.dispatch(addComponentsInBatches(result));
5558
- }
5573
+ store.dispatch(setAssets(result));
5559
5574
  }
5560
5575
  }
5561
- class ComponentStageCompletionService extends BaseApiService {
5562
- add(componentId, stageId) {
5576
+ class AssetStageCompletionService extends BaseApiService {
5577
+ add(assetId, stageId) {
5563
5578
  var _a2;
5564
5579
  const { store } = this.client;
5565
- const componentType = (_a2 = store.getState().componentReducer.components[componentId]) == null ? void 0 : _a2.component_type;
5566
- if (!componentType) {
5567
- throw new Error(`Component ${componentId} not found`);
5580
+ const assetTypeId = (_a2 = store.getState().assetReducer.assets[assetId]) == null ? void 0 : _a2.asset_type;
5581
+ if (!assetTypeId) {
5582
+ throw new Error(`Asset with offline_id ${assetId} not found`);
5568
5583
  }
5569
- const offlineCompletion = offline({
5570
- component: componentId,
5584
+ const offlineStageCompletion = offline({
5585
+ asset: assetId,
5571
5586
  stage: stageId
5572
5587
  });
5573
- store.dispatch(addStageCompletion(offlineCompletion));
5588
+ store.dispatch(addStageCompletion(offlineStageCompletion));
5574
5589
  const promise = this.enqueueRequest({
5575
- description: "Mark stage as completed",
5590
+ description: "Complete stage",
5576
5591
  method: HttpMethod.POST,
5577
- url: `/components/types/${componentType}/complete-stages/`,
5592
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5578
5593
  // TODO: Add submitted_at to model
5579
- payload: { completions: [{ ...offlineCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5580
- blockers: [componentId, stageId],
5581
- blocks: [offlineCompletion.offline_id]
5594
+ payload: { completions: [{ ...offlineStageCompletion, submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3 }] },
5595
+ blockers: [assetId, stageId],
5596
+ blocks: [offlineStageCompletion.offline_id]
5582
5597
  });
5583
- return [offlineCompletion, promise];
5598
+ return [offlineStageCompletion, promise];
5584
5599
  }
5585
5600
  async refreshStore() {
5586
5601
  const { store } = this.client;
5587
5602
  const result = await this.enqueueRequest({
5588
- description: "Get completed stages",
5603
+ description: "Get stage completions",
5589
5604
  method: HttpMethod.GET,
5590
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stage-completions/`,
5605
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stage-completions/`,
5591
5606
  blockers: [],
5592
5607
  blocks: []
5593
5608
  });
5594
5609
  store.dispatch(addStageCompletions(result));
5595
5610
  }
5596
5611
  /**
5597
- * Creates a collection of ComponentStageCompletions, marking the referenced stages as completed for the referenced
5598
- * components. It's REQUIRED that all components referenced all have the SAME component type.
5599
- * @param componentTypeId The ID of the component type for which we are completing stages (we can only complete
5600
- * stages for one component type at a time)
5612
+ * Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
5613
+ * assets. It's REQUIRED that all assets referenced all have the SAME asset type.
5614
+ * @param assetTypeId The ID of the asset type for which we are completing stages (we can only complete
5615
+ * stages for one asset type at a time)
5601
5616
  * @param stageCompletions
5602
5617
  */
5603
- async bulkAdd(componentTypeId, stageCompletions) {
5604
- const offlineStagesCompletions = stageCompletions.map((completion) => {
5618
+ async bulkAdd(assetTypeId, stageCompletions) {
5619
+ const offlineStageCompletions = stageCompletions.map((completion) => {
5605
5620
  return offline(completion);
5606
5621
  });
5607
5622
  const asMapping = {};
5608
5623
  for (const completion of stageCompletions) {
5609
- const stageToCompletionDateMapping = asMapping[completion.component] || {};
5624
+ const stageToCompletionDateMapping = asMapping[completion.asset] || {};
5610
5625
  stageToCompletionDateMapping[completion.stage] = (/* @__PURE__ */ new Date()).toISOString();
5611
- asMapping[completion.component] = stageToCompletionDateMapping;
5626
+ asMapping[completion.asset] = stageToCompletionDateMapping;
5612
5627
  }
5613
5628
  this.client.store.dispatch(addStageCompletions(asMapping));
5614
5629
  await this.enqueueRequest({
5615
- description: "Mark multiple stage as completed",
5630
+ description: "Bulk complete stages",
5616
5631
  method: HttpMethod.POST,
5617
- url: `/components/types/${componentTypeId}/complete-stages/`,
5632
+ url: `/assets/types/${assetTypeId}/complete-stages/`,
5618
5633
  payload: {
5619
- completions: offlineStagesCompletions
5634
+ completions: offlineStageCompletions
5620
5635
  },
5621
- blockers: [
5622
- componentTypeId,
5623
- ...stageCompletions.map((c) => c.component),
5624
- ...stageCompletions.map((c) => c.stage)
5625
- ],
5626
- blocks: offlineStagesCompletions.map((c) => c.offline_id)
5636
+ blockers: [assetTypeId, ...stageCompletions.map((c) => c.asset), ...stageCompletions.map((c) => c.stage)],
5637
+ blocks: offlineStageCompletions.map((c) => c.offline_id)
5627
5638
  });
5628
5639
  }
5629
- bulkDelete(stageId, componentIds) {
5630
- const completionsToRemove = componentIds.map((componentId) => {
5640
+ bulkDelete(stageId, assetIds) {
5641
+ const stageCompletionsToRemove = assetIds.map((assetId) => {
5631
5642
  return {
5632
- component: componentId,
5643
+ asset: assetId,
5633
5644
  stage: stageId
5634
5645
  };
5635
5646
  });
5636
- this.client.store.dispatch(removeStageCompletions(completionsToRemove));
5647
+ this.client.store.dispatch(removeStageCompletions(stageCompletionsToRemove));
5637
5648
  return this.enqueueRequest({
5638
- description: `Undo stage for ${componentIds.length} component(s)`,
5649
+ description: `Undo stage for ${assetIds.length} assets(s)`,
5639
5650
  // TODO: Rename to setCompletedStages
5640
5651
  method: HttpMethod.DELETE,
5641
- url: `/components/stages/${stageId}/undo-stages/`,
5652
+ url: `/assets/stages/${stageId}/undo-stages/`,
5642
5653
  payload: {
5643
- components: componentIds
5654
+ assets: assetIds
5644
5655
  },
5645
- blockers: [stageId, ...componentIds],
5656
+ blockers: [stageId, ...assetIds],
5646
5657
  blocks: []
5647
5658
  });
5648
5659
  }
5649
5660
  }
5650
- class ComponentStageService extends BaseApiService {
5651
- async bulkCreateStages(stagesToSubmit, componentTypeId, workspaceId) {
5661
+ class AssetStageService extends BaseApiService {
5662
+ async bulkCreateStages(stagesToSubmit, assetTypeId, workspaceId) {
5652
5663
  const payload = stagesToSubmit.map((stage) => {
5653
5664
  return offline(stage);
5654
5665
  });
5655
5666
  const fullStages = payload.map((stage) => {
5656
- return { ...stage, component_type: componentTypeId };
5667
+ return { ...stage, asset_type: assetTypeId };
5657
5668
  });
5658
5669
  this.client.store.dispatch(addStages(fullStages));
5659
5670
  return this.enqueueRequest({
5660
- description: "Add component stages",
5671
+ description: "Add asset stages",
5661
5672
  method: HttpMethod.POST,
5662
- url: `/components/types/${componentTypeId}/add-stages/`,
5673
+ url: `/assets/types/${assetTypeId}/add-stages/`,
5663
5674
  payload: {
5664
5675
  stages: payload
5665
5676
  },
5666
5677
  queryParams: {
5667
5678
  workspace_id: workspaceId.toString()
5668
5679
  },
5669
- blockers: [componentTypeId, workspaceId],
5680
+ blockers: [assetTypeId, workspaceId],
5670
5681
  blocks: payload.map(({ offline_id }) => offline_id)
5671
5682
  });
5672
5683
  }
5673
- async bulkUpdateStages(stagesToUpdate, componentTypeId) {
5684
+ async bulkUpdateStages(stagesToUpdate, assetTypeId) {
5674
5685
  const store = this.client.store;
5675
5686
  const state = store.getState();
5676
5687
  const prevStages = selectStagesFromStageIds(
@@ -5681,13 +5692,13 @@ class ComponentStageService extends BaseApiService {
5681
5692
  }
5682
5693
  store.dispatch(updateStages(stagesToUpdate));
5683
5694
  return this.enqueueRequest({
5684
- description: "Edit component stages",
5695
+ description: "Edit asset stages",
5685
5696
  method: HttpMethod.PATCH,
5686
- url: `/components/types/${componentTypeId}/bulk-update-stages/`,
5697
+ url: `/assets/types/${assetTypeId}/bulk-update-stages/`,
5687
5698
  payload: {
5688
5699
  stages: stagesToUpdate
5689
5700
  },
5690
- blockers: [componentTypeId],
5701
+ blockers: [assetTypeId],
5691
5702
  blocks: stagesToUpdate.map(({ offline_id }) => offline_id)
5692
5703
  }).catch((e) => {
5693
5704
  store.dispatch(updateStages(prevStages));
@@ -5697,9 +5708,9 @@ class ComponentStageService extends BaseApiService {
5697
5708
  async bulkDelete(idsToDelete) {
5698
5709
  this.client.store.dispatch(removeStages(idsToDelete));
5699
5710
  return this.enqueueRequest({
5700
- description: "Delete component stages",
5711
+ description: "Delete asset stages",
5701
5712
  method: HttpMethod.DELETE,
5702
- url: "/components/stages/bulk-delete/",
5713
+ url: "/assets/stages/bulk-delete/",
5703
5714
  payload: {
5704
5715
  stage_ids: idsToDelete
5705
5716
  },
@@ -5707,15 +5718,15 @@ class ComponentStageService extends BaseApiService {
5707
5718
  blocks: []
5708
5719
  });
5709
5720
  }
5710
- async update(componentStage) {
5711
- this.client.store.dispatch(addStages([componentStage]));
5721
+ async update(assetStage) {
5722
+ this.client.store.dispatch(addStages([assetStage]));
5712
5723
  return this.enqueueRequest({
5713
- description: "Update component stage",
5724
+ description: "Update asset stage",
5714
5725
  method: HttpMethod.PATCH,
5715
- url: `/components/stages/${componentStage.offline_id}/`,
5716
- payload: componentStage,
5717
- blockers: [componentStage.offline_id],
5718
- blocks: [componentStage.offline_id]
5726
+ url: `/assets/stages/${assetStage.offline_id}/`,
5727
+ payload: assetStage,
5728
+ blockers: [assetStage.offline_id],
5729
+ blocks: [assetStage.offline_id]
5719
5730
  });
5720
5731
  }
5721
5732
  async linkForm(stageId, formId2) {
@@ -5723,9 +5734,9 @@ class ComponentStageService extends BaseApiService {
5723
5734
  store.dispatch(linkStageToForm({ stageId, formId: formId2 }));
5724
5735
  try {
5725
5736
  await this.enqueueRequest({
5726
- description: "Link component stage to form",
5737
+ description: "Link asset stage to form",
5727
5738
  method: HttpMethod.POST,
5728
- url: `/components/stages/${stageId}/associate-with-form/`,
5739
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5729
5740
  payload: { user_form: formId2 },
5730
5741
  blockers: [stageId, formId2],
5731
5742
  blocks: [stageId]
@@ -5740,9 +5751,9 @@ class ComponentStageService extends BaseApiService {
5740
5751
  store.dispatch(unlinkStageToForm({ stageId }));
5741
5752
  try {
5742
5753
  await this.enqueueRequest({
5743
- description: "Unlink component stage from form",
5754
+ description: "Unlink asset stage from form",
5744
5755
  method: HttpMethod.DELETE,
5745
- url: `/components/stages/${stageId}/associate-with-form/`,
5756
+ url: `/assets/stages/${stageId}/associate-with-form/`,
5746
5757
  blockers: [stageId, formId2],
5747
5758
  blocks: [stageId]
5748
5759
  });
@@ -5754,9 +5765,9 @@ class ComponentStageService extends BaseApiService {
5754
5765
  async refreshStore() {
5755
5766
  const { store } = this.client;
5756
5767
  const result = await this.enqueueRequest({
5757
- description: "Get component stages",
5768
+ description: "Get asset stages",
5758
5769
  method: HttpMethod.GET,
5759
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-stages/`,
5770
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-stages/`,
5760
5771
  blockers: [],
5761
5772
  blocks: []
5762
5773
  });
@@ -5770,20 +5781,20 @@ const AttachmentModelMeta = {
5770
5781
  deleteUrlPrefix: "/issues",
5771
5782
  fetchUrlPostfix: "/issue-attachments"
5772
5783
  },
5773
- [AttachmentModel.Component]: {
5774
- name: "component",
5775
- attachUrlPrefix: "/components",
5776
- deleteUrlPrefix: "/components",
5777
- fetchUrlPostfix: "/component-attachments"
5784
+ [AttachmentModel.Asset]: {
5785
+ name: "asset",
5786
+ attachUrlPrefix: "/assets",
5787
+ deleteUrlPrefix: "/assets",
5788
+ fetchUrlPostfix: "/asset-attachments"
5778
5789
  },
5779
- [AttachmentModel.ComponentType]: {
5780
- name: "component type",
5781
- attachUrlPrefix: "/components/types",
5782
- deleteUrlPrefix: "/components/types",
5783
- fetchUrlPostfix: "/component-type-attachments"
5790
+ [AttachmentModel.AssetType]: {
5791
+ name: "asset type",
5792
+ attachUrlPrefix: "/assets/types",
5793
+ deleteUrlPrefix: "/assets/types",
5794
+ fetchUrlPostfix: "/asset-type-attachments"
5784
5795
  },
5785
5796
  [AttachmentModel.Project]: {
5786
- name: "component project",
5797
+ name: "project",
5787
5798
  attachUrlPrefix: "/projects",
5788
5799
  deleteUrlPrefix: "/projects",
5789
5800
  fetchUrlPostfix: "/attachments"
@@ -5799,8 +5810,8 @@ class BaseAttachmentService extends BaseApiService {
5799
5810
  getNumberOfAttachmentsWithSha1(sha1) {
5800
5811
  const {
5801
5812
  issueReducer: issueReducer2,
5802
- componentReducer: componentReducer2,
5803
- componentTypeReducer: componentTypeReducer2,
5813
+ assetReducer: assetReducer2,
5814
+ assetTypeReducer: assetTypeReducer2,
5804
5815
  documentsReducer: documentsReducer2,
5805
5816
  projectReducer: projectReducer2,
5806
5817
  formSubmissionReducer: formSubmissionReducer2,
@@ -5808,8 +5819,8 @@ class BaseAttachmentService extends BaseApiService {
5808
5819
  } = this.client.store.getState();
5809
5820
  const objectsWithSha1 = [].concat(
5810
5821
  Object.values(issueReducer2.attachments),
5811
- Object.values(componentReducer2.attachments),
5812
- Object.values(componentTypeReducer2.attachments),
5822
+ Object.values(assetReducer2.attachments),
5823
+ Object.values(assetTypeReducer2.attachments),
5813
5824
  Object.values(documentsReducer2.attachments),
5814
5825
  Object.values(projectReducer2.attachments),
5815
5826
  Object.values(formRevisionReducer2.attachments),
@@ -5931,10 +5942,10 @@ class BaseAttachmentService extends BaseApiService {
5931
5942
  return promise;
5932
5943
  }
5933
5944
  }
5934
- class ComponentAttachmentService extends BaseAttachmentService {
5945
+ class AssetAttachmentService extends BaseAttachmentService {
5935
5946
  constructor() {
5936
5947
  super(...arguments);
5937
- __publicField(this, "attachmentModel", AttachmentModel.Component);
5948
+ __publicField(this, "attachmentModel", AttachmentModel.Asset);
5938
5949
  }
5939
5950
  buildOfflineAttachment(data) {
5940
5951
  return offline({
@@ -5945,115 +5956,108 @@ class ComponentAttachmentService extends BaseAttachmentService {
5945
5956
  file_type: data.file.type,
5946
5957
  submitted_at: data.submittedAt,
5947
5958
  description: data.description,
5948
- component: data.modelId
5959
+ asset: data.modelId
5949
5960
  });
5950
5961
  }
5951
- async attachFilesToComponent(files, componentId) {
5952
- return this.attachFiles(
5953
- files,
5954
- componentId,
5955
- this.buildOfflineAttachment.bind(this),
5956
- {
5957
- addAttachments: addComponentAttachments,
5958
- updateAttachments: updateComponentAttachments,
5959
- removeAttachments: removeComponentAttachments
5960
- }
5961
- );
5962
+ async attachFilesToAsset(files, assetId) {
5963
+ return this.attachFiles(files, assetId, this.buildOfflineAttachment.bind(this), {
5964
+ addAttachments: addAssetAttachments,
5965
+ updateAttachments: updateAssetAttachments,
5966
+ removeAttachments: removeAssetAttachments
5967
+ });
5962
5968
  }
5963
- deleteComponentAttachment(attachmentId) {
5969
+ deleteAssetAttachment(attachmentId) {
5964
5970
  return this.deleteAttachment(
5965
5971
  attachmentId,
5966
5972
  {
5967
- setAttachment: setComponentAttachment,
5968
- removeAttachment: removeComponentAttachment
5973
+ setAttachment: setAssetAttachment,
5974
+ removeAttachment: removeAssetAttachment
5969
5975
  },
5970
5976
  {
5971
- selectAttachment: selectComponentAttachment
5977
+ selectAttachment: selectAssetAttachment
5972
5978
  }
5973
5979
  );
5974
5980
  }
5975
5981
  async refreshStore() {
5976
5982
  return this.getAttachments({
5977
- setAttachments: setComponentAttachments
5983
+ setAttachments: setAssetAttachments
5978
5984
  });
5979
5985
  }
5980
5986
  }
5981
- class ComponentTypeService extends BaseApiService {
5982
- add(componentType) {
5983
- const offlineComponentType = offline(componentType);
5987
+ class AssetTypeService extends BaseApiService {
5988
+ add(assetType) {
5989
+ const offlineAssetType = offline(assetType);
5984
5990
  const { store } = this.client;
5985
5991
  const activeProjectId = store.getState().projectReducer.activeProjectId;
5986
- store.dispatch(addComponentType(offlineComponentType));
5992
+ store.dispatch(addAssetType(offlineAssetType));
5987
5993
  const promise = this.enqueueRequest({
5988
- description: "Create ComponentType",
5994
+ description: "Create asset type",
5989
5995
  method: HttpMethod.POST,
5990
- url: `/projects/${activeProjectId}/component-types/`,
5991
- payload: { ...offlineComponentType },
5996
+ url: `/projects/${activeProjectId}/asset-types/`,
5997
+ payload: { ...offlineAssetType },
5992
5998
  blockers: [],
5993
- blocks: [offlineComponentType.offline_id]
5999
+ blocks: [offlineAssetType.offline_id]
5994
6000
  });
5995
- return [offlineComponentType, promise];
6001
+ return [offlineAssetType, promise];
5996
6002
  }
5997
- update(componentType) {
5998
- this.client.store.dispatch(addComponentType(componentType));
6003
+ update(assetType) {
6004
+ this.client.store.dispatch(addAssetType(assetType));
5999
6005
  return this.enqueueRequest({
6000
- description: "Update ComponentType",
6006
+ description: "Update asset type",
6001
6007
  method: HttpMethod.PATCH,
6002
- url: `/components/types/${componentType.offline_id}/`,
6003
- payload: componentType,
6004
- blockers: [componentType.offline_id],
6005
- blocks: [componentType.offline_id]
6008
+ url: `/assets/types/${assetType.offline_id}/`,
6009
+ payload: assetType,
6010
+ blockers: [assetType.offline_id],
6011
+ blocks: [assetType.offline_id]
6006
6012
  });
6007
6013
  }
6008
- async delete(componentTypeId) {
6014
+ async delete(assetTypeId) {
6009
6015
  const { store } = this.client;
6010
6016
  const state = store.getState();
6011
- const componentType = selectComponentType(componentTypeId)(state);
6012
- if (!componentType) {
6013
- throw new Error("Expected componentType to exist");
6014
- }
6015
- const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
6016
- const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
6017
- store.dispatch(deleteComponentType(componentTypeId));
6018
- if (stagesOfComponentType.length > 0) {
6019
- const stagesOfComponentTypeIds = stagesOfComponentType.map(
6020
- (componentTypeStage) => componentTypeStage.offline_id
6021
- );
6022
- store.dispatch(removeStages(stagesOfComponentTypeIds));
6017
+ const assetType = selectAssetType(assetTypeId)(state);
6018
+ if (!assetType) {
6019
+ throw new Error(`Expected asset type with offline_id ${assetTypeId} to exist`);
6020
+ }
6021
+ const stagesOfAssetType = selectStagesOfAssetType(assetTypeId)(state) ?? [];
6022
+ const attachmentsOfAssetType = selectAttachmentsOfAssetType(assetTypeId)(state);
6023
+ store.dispatch(deleteAssetType(assetTypeId));
6024
+ if (stagesOfAssetType.length > 0) {
6025
+ const stagesOfAssetTypeIds = stagesOfAssetType.map((assetStage) => assetStage.offline_id);
6026
+ store.dispatch(removeStages(stagesOfAssetTypeIds));
6023
6027
  }
6024
- if (attachmentsOfComponentType.length > 0) {
6025
- const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
6026
- store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
6028
+ if (attachmentsOfAssetType.length > 0) {
6029
+ const attachmentsOfAssetTypeIds = attachmentsOfAssetType.map(({ offline_id }) => offline_id);
6030
+ store.dispatch(removeAssetTypeAttachments(attachmentsOfAssetTypeIds));
6027
6031
  }
6028
6032
  return this.enqueueRequest({
6029
- description: "Delete ComponentType",
6033
+ description: "Delete asset type",
6030
6034
  method: HttpMethod.DELETE,
6031
- url: `/components/types/${componentTypeId}/`,
6032
- blockers: [componentTypeId],
6035
+ url: `/assets/types/${assetTypeId}/`,
6036
+ blockers: [assetTypeId],
6033
6037
  blocks: []
6034
6038
  }).catch((e) => {
6035
- store.dispatch(addComponentType(componentType));
6036
- store.dispatch(addStages(stagesOfComponentType));
6037
- store.dispatch(addComponentTypeAttachments(attachmentsOfComponentType));
6039
+ store.dispatch(addAssetType(assetType));
6040
+ store.dispatch(addStages(stagesOfAssetType));
6041
+ store.dispatch(addAssetTypeAttachments(attachmentsOfAssetType));
6038
6042
  throw e;
6039
6043
  });
6040
6044
  }
6041
6045
  async refreshStore() {
6042
6046
  const { store } = this.client;
6043
6047
  const result = await this.enqueueRequest({
6044
- description: "Get component types",
6048
+ description: "Get asset types",
6045
6049
  method: HttpMethod.GET,
6046
- url: `/projects/${store.getState().projectReducer.activeProjectId}/component-types/`,
6050
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/asset-types/`,
6047
6051
  blockers: [],
6048
6052
  blocks: []
6049
6053
  });
6050
- store.dispatch(setComponentTypes(result));
6054
+ store.dispatch(setAssetTypes(result));
6051
6055
  }
6052
6056
  }
6053
- class ComponentTypeAttachmentService extends BaseAttachmentService {
6057
+ class AssetTypeAttachmentService extends BaseAttachmentService {
6054
6058
  constructor() {
6055
6059
  super(...arguments);
6056
- __publicField(this, "attachmentModel", AttachmentModel.ComponentType);
6060
+ __publicField(this, "attachmentModel", AttachmentModel.AssetType);
6057
6061
  }
6058
6062
  buildOfflineAttachment(data) {
6059
6063
  return offline({
@@ -6064,36 +6068,36 @@ class ComponentTypeAttachmentService extends BaseAttachmentService {
6064
6068
  file_type: data.file.type,
6065
6069
  submitted_at: data.submittedAt,
6066
6070
  description: data.description,
6067
- component_type: data.modelId
6071
+ asset_type: data.modelId
6068
6072
  });
6069
6073
  }
6070
- async attachFilesToComponentType(files, componentTypeId) {
6074
+ async attachFilesToAssetType(files, assetTypeId) {
6071
6075
  return this.attachFiles(
6072
6076
  files,
6073
- componentTypeId,
6077
+ assetTypeId,
6074
6078
  this.buildOfflineAttachment.bind(this),
6075
6079
  {
6076
- addAttachments: addComponentTypeAttachments,
6077
- updateAttachments: updateComponentTypeAttachments,
6078
- removeAttachments: removeComponentTypeAttachments
6080
+ addAttachments: addAssetTypeAttachments,
6081
+ updateAttachments: updateAssetTypeAttachments,
6082
+ removeAttachments: removeAssetTypeAttachments
6079
6083
  }
6080
6084
  );
6081
6085
  }
6082
- deleteComponentTypeAttachment(attachmentId) {
6086
+ deleteAssetTypeAttachment(attachmentId) {
6083
6087
  return this.deleteAttachment(
6084
6088
  attachmentId,
6085
6089
  {
6086
- setAttachment: setComponentTypeAttachment,
6087
- removeAttachment: removeComponentTypeAttachment
6090
+ setAttachment: setAssetTypeAttachment,
6091
+ removeAttachment: removeAssetTypeAttachment
6088
6092
  },
6089
6093
  {
6090
- selectAttachment: selectComponentTypeAttachment
6094
+ selectAttachment: selectAssetTypeAttachment
6091
6095
  }
6092
6096
  );
6093
6097
  }
6094
6098
  async refreshStore() {
6095
6099
  return this.getAttachments({
6096
- setAttachments: setComponentTypeAttachments
6100
+ setAttachments: setAssetTypeAttachments
6097
6101
  });
6098
6102
  }
6099
6103
  }
@@ -6239,7 +6243,7 @@ class IssueService extends BaseApiService {
6239
6243
  // Basic CRUD functions
6240
6244
  // TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
6241
6245
  // have to repeat it for all optimistic model results (all optimistic results are created).
6242
- add(issue, issue_type = null) {
6246
+ add(issue, issueType = null) {
6243
6247
  const { store } = this.client;
6244
6248
  const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
6245
6249
  const state = store.getState();
@@ -6266,7 +6270,7 @@ class IssueService extends BaseApiService {
6266
6270
  url: "/issues/",
6267
6271
  queryParams: {
6268
6272
  workspace_id: workspaceId,
6269
- ...issue_type ? { issue_type } : {}
6273
+ ...issueType ? { issue_type: issueType } : {}
6270
6274
  },
6271
6275
  payload: issuePayload,
6272
6276
  blockers: [
@@ -6284,7 +6288,8 @@ class IssueService extends BaseApiService {
6284
6288
  if (error2 instanceof APIError) {
6285
6289
  (_a2 = unsafeShowToast) == null ? void 0 : _a2({
6286
6290
  title: "Could not create issue",
6287
- description: "An unexpected error occurred while creating the issue."
6291
+ description: error2.message,
6292
+ severity: "danger"
6288
6293
  });
6289
6294
  }
6290
6295
  store.dispatch(removeIssue(issuePayload.offline_id));
@@ -6403,7 +6408,7 @@ class IssueService extends BaseApiService {
6403
6408
  this.client.store.dispatch(updateIssue(issueToBeUpdated));
6404
6409
  this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
6405
6410
  });
6406
- const fullIssue = this.client.store.getState().issueReducer.issues[issue.offline_id];
6411
+ const fullIssue = state.issueReducer.issues[issue.offline_id];
6407
6412
  return [fullIssue, promise];
6408
6413
  }
6409
6414
  async remove(id) {
@@ -6454,14 +6459,15 @@ class IssueService extends BaseApiService {
6454
6459
  class IssueTypeService extends BaseApiService {
6455
6460
  add(payload) {
6456
6461
  const { store } = this.client;
6457
- const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
6462
+ const state = store.getState();
6463
+ const activeOrganizationId = state.organizationReducer.activeOrganizationId;
6458
6464
  if (!activeOrganizationId) {
6459
6465
  throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
6460
6466
  }
6461
6467
  const offlineIssueType = offline({
6462
6468
  ...payload,
6463
6469
  submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
6464
- created_by: store.getState().userReducer.currentUser.id,
6470
+ created_by: state.userReducer.currentUser.id,
6465
6471
  organization: activeOrganizationId
6466
6472
  });
6467
6473
  store.dispatch(addIssueType(offlineIssueType));
@@ -6514,11 +6520,12 @@ class IssueTypeService extends BaseApiService {
6514
6520
  }
6515
6521
  delete(issueTypeId) {
6516
6522
  const { store } = this.client;
6517
- const issueTypeToDelete = store.getState().issueTypeReducer.issueTypes[issueTypeId];
6523
+ const state = store.getState();
6524
+ const issueTypeToDelete = state.issueTypeReducer.issueTypes[issueTypeId];
6518
6525
  if (!issueTypeToDelete) {
6519
6526
  throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
6520
6527
  }
6521
- const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(store.getState()) ?? [];
6528
+ const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state) ?? [];
6522
6529
  store.dispatch(removeIssueType(issueTypeId));
6523
6530
  store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
6524
6531
  const promise = this.enqueueRequest({
@@ -6553,7 +6560,7 @@ class MainService extends BaseApiService {
6553
6560
  if (replaceExisting) {
6554
6561
  this.client.store.dispatch(setIsFetchingInitialData(true));
6555
6562
  }
6556
- return this.enqueueRequest({
6563
+ const result = await this.enqueueRequest({
6557
6564
  uuid,
6558
6565
  description: "Get initial data",
6559
6566
  method: HttpMethod.GET,
@@ -6562,18 +6569,20 @@ class MainService extends BaseApiService {
6562
6569
  isAuthNeeded: true,
6563
6570
  blockers: [],
6564
6571
  blocks: []
6565
- }).then((result) => {
6566
- void this._processInitialData(result, replaceExisting);
6567
- return result;
6568
6572
  });
6573
+ void this._processInitialData(result, replaceExisting);
6569
6574
  }
6570
- async fetchProjectUsers(projectId) {
6575
+ async fetchProjectUsers() {
6576
+ const projectId = this.client.store.getState().projectReducer.activeProjectId;
6571
6577
  return this.enqueueRequest({
6572
6578
  description: "Fetch users",
6573
6579
  method: HttpMethod.GET,
6574
6580
  url: `/projects/${projectId}/users/`,
6575
6581
  blockers: [],
6576
6582
  blocks: []
6583
+ }).then((users) => {
6584
+ this.client.store.dispatch(addUsers(users));
6585
+ return users;
6577
6586
  });
6578
6587
  }
6579
6588
  async fetchOrganizationUsers(orgId) {
@@ -6586,13 +6595,14 @@ class MainService extends BaseApiService {
6586
6595
  });
6587
6596
  }
6588
6597
  // TODO:
6589
- // Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
6590
- // overwrite, use setComponents. Otherwise, use bulkAddComponents.
6598
+ // Don't accept updateStore in AssetService.list. Just return the offline objects and promise. Here, if
6599
+ // overwrite, use setAssets. Otherwise, use bulkAddAssets.
6600
+ // TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
6601
+ // literally immediately.
6591
6602
  async _processInitialData(data, overwrite) {
6592
6603
  var _a2, _b, _c;
6593
6604
  const workspaces = {};
6594
6605
  const projects = [];
6595
- const categories = [];
6596
6606
  const projectsData = data.projects;
6597
6607
  const { store } = this.client;
6598
6608
  const oldProjectId = (_a2 = projectsData.find(
@@ -6616,18 +6626,11 @@ class MainService extends BaseApiService {
6616
6626
  isProjectIdValid = true;
6617
6627
  for (const workspaceData of projectData.workspaces) {
6618
6628
  const workspace = { ...workspaceData, project: projectData.id };
6619
- if (workspace.categories) {
6620
- for (const category of workspace.categories) {
6621
- categories.push(category);
6622
- }
6623
- }
6624
- delete workspace.categories;
6625
6629
  workspaces[workspace.offline_id] = workspace;
6626
6630
  }
6627
6631
  }
6628
6632
  }
6629
6633
  store.dispatch(setCurrentUser(data.user));
6630
- store.dispatch(addUsers(data.project_owners));
6631
6634
  store.dispatch(setLicenses(data.licenses));
6632
6635
  const organizationsData = data.organizations;
6633
6636
  store.dispatch(setOrganizations(organizationsData));
@@ -6648,8 +6651,11 @@ class MainService extends BaseApiService {
6648
6651
  currentOrgId = firstOrg.id;
6649
6652
  }
6650
6653
  if (currentOrgId) {
6651
- await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
6652
- void this.client.teams.refreshStore();
6654
+ const initialOrgData = await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
6655
+ currentOrgId = initialOrgData.organization.id;
6656
+ }
6657
+ if (!currentOrgId) {
6658
+ throw new Error("No organization found");
6653
6659
  }
6654
6660
  if (!isProjectIdValid) {
6655
6661
  if (validProjects.length !== 0) {
@@ -6659,12 +6665,6 @@ class MainService extends BaseApiService {
6659
6665
  if (projectData) {
6660
6666
  for (const workspaceData of projectData.workspaces) {
6661
6667
  const workspace = { ...workspaceData, project: projectData.id };
6662
- if (workspace.categories) {
6663
- for (const category of workspace.categories) {
6664
- categories.push(category);
6665
- }
6666
- }
6667
- delete workspace.categories;
6668
6668
  workspaces[workspace.offline_id] = workspace;
6669
6669
  }
6670
6670
  }
@@ -6673,14 +6673,6 @@ class MainService extends BaseApiService {
6673
6673
  store.dispatch(setActiveProjectId(currentProjectId));
6674
6674
  }
6675
6675
  }
6676
- if (currentProjectId) {
6677
- const usersResultPromise = this.fetchProjectUsers(currentProjectId);
6678
- const projectAccessRefreshPromise = this.client.projectAccesses.refreshStore();
6679
- const usersResult = await usersResultPromise;
6680
- await projectAccessRefreshPromise;
6681
- store.dispatch(addUsers(usersResult));
6682
- void this.client.projectAttachments.refreshStore();
6683
- }
6684
6676
  let currentWorkspaceId;
6685
6677
  const oldWorkspaceId = this.client.store.getState().workspaceReducer.activeWorkspaceId;
6686
6678
  if (overwrite || !oldWorkspaceId) {
@@ -6688,51 +6680,49 @@ class MainService extends BaseApiService {
6688
6680
  } else {
6689
6681
  currentWorkspaceId = oldWorkspaceId;
6690
6682
  }
6691
- if (currentWorkspaceId && currentProjectId) {
6683
+ if (currentWorkspaceId) {
6692
6684
  store.dispatch(setActiveWorkspaceId(currentWorkspaceId));
6693
- void this.client.categories.refreshStore().then(() => {
6694
- void this.client.issues.refreshStore().then(() => {
6695
- void this.client.issueAttachments.refreshStore().then();
6696
- void this.client.issueComments.refreshStore().then();
6697
- void this.client.issueUpdates.refreshStore().then();
6698
- });
6699
- });
6700
- void this.client.projectFiles.refreshStore().then();
6701
- void this.client.componentTypes.refreshStore().then(() => {
6702
- void this.client.componentTypeAttachments.refreshStore().then(() => {
6703
- void this.client.componentStages.refreshStore().then(() => {
6704
- void this.client.components.refreshStore(overwrite).then(() => {
6705
- void this.client.componentAttachments.refreshStore().then();
6706
- });
6707
- });
6708
- void this.client.componentStageCompletions.refreshStore().then();
6709
- });
6710
- });
6711
- void this.client.userForms.refreshStore().then(() => {
6712
- void this.client.userFormSubmissions.refreshStore().then();
6713
- });
6714
- }
6715
- if (currentProjectId) {
6716
- void this.client.documents.refreshStore().then(() => {
6717
- void this.client.documentAttachments.refreshStore().then();
6718
- });
6719
- void this.client.documents.refreshStore();
6720
- void this.client.issueUpdates.refreshStore();
6721
- void this.client.issueTypes.refreshStore();
6722
6685
  }
6723
- store.dispatch(setIsFetchingInitialData(false));
6724
6686
  if (overwrite) {
6725
6687
  console.log("Overwriting data");
6726
6688
  store.dispatch(setProjects(projects));
6727
6689
  store.dispatch(setWorkspaces(workspaces));
6728
- store.dispatch(setCategories(categories));
6729
6690
  store.dispatch(resetRecentIssues());
6730
6691
  } else {
6731
6692
  console.log("Updating data (collisions will be replaced)");
6732
6693
  store.dispatch(addOrReplaceProjects(projects));
6733
6694
  store.dispatch(addOrReplaceWorkspaces(workspaces));
6734
- store.dispatch(addOrReplaceCategories(categories));
6735
6695
  }
6696
+ if (!currentProjectId) {
6697
+ store.dispatch(setIsFetchingInitialData(false));
6698
+ } else {
6699
+ try {
6700
+ await this.client.projectFiles.refreshStore();
6701
+ } finally {
6702
+ store.dispatch(setIsFetchingInitialData(false));
6703
+ }
6704
+ void this.client.assetTypes.refreshStore();
6705
+ void this.client.assetStages.refreshStore();
6706
+ void this.client.assets.refreshStore();
6707
+ void this.client.assetStageCompletions.refreshStore();
6708
+ void this.client.categories.refreshStore();
6709
+ void this.client.issueTypes.refreshStore();
6710
+ void this.client.issues.refreshStore();
6711
+ void this.fetchProjectUsers();
6712
+ void this.client.documents.refreshStore();
6713
+ void this.client.userForms.refreshStore();
6714
+ void this.client.documentAttachments.refreshStore();
6715
+ void this.client.userFormSubmissions.refreshStore();
6716
+ void this.client.agent.refreshStore();
6717
+ void this.client.issueAttachments.refreshStore();
6718
+ void this.client.issueComments.refreshStore();
6719
+ void this.client.issueUpdates.refreshStore();
6720
+ void this.client.projectAccesses.refreshStore();
6721
+ void this.client.projectAttachments.refreshStore();
6722
+ void this.client.assetTypeAttachments.refreshStore();
6723
+ void this.client.assetAttachments.refreshStore();
6724
+ }
6725
+ void this.client.teams.refreshStore();
6736
6726
  }
6737
6727
  }
6738
6728
  class ProjectAccessService extends BaseApiService {
@@ -6772,16 +6762,11 @@ class ProjectAccessService extends BaseApiService {
6772
6762
  const { store } = this.client;
6773
6763
  const state = store.getState();
6774
6764
  const projectId = state.projectReducer.activeProjectId;
6775
- const currentUser = state.userReducer.currentUser;
6776
6765
  if (!projectId) {
6777
6766
  throw new Error("No active project");
6778
6767
  }
6779
6768
  const promise = this.fetchAll(projectId);
6780
6769
  const result = await promise;
6781
- const activeProjectAccess = result.find((projectAccess) => projectAccess.user === currentUser.id);
6782
- if (!activeProjectAccess) {
6783
- throw new Error("Current user does not have a project access instance");
6784
- }
6785
6770
  store.dispatch(setProjectAccesses(result));
6786
6771
  }
6787
6772
  }
@@ -7131,7 +7116,7 @@ class UserFormService extends BaseApiService {
7131
7116
  });
7132
7117
  });
7133
7118
  }
7134
- async add(state, initialRevision, url, ownerUser, ownerOrganization, componentTypeId, issueTypeId) {
7119
+ async add(state, initialRevision, url, ownerUser, ownerOrganization, assetTypeId, issueTypeId) {
7135
7120
  if (!!ownerUser === !!ownerOrganization) {
7136
7121
  throw new Error("Exactly one of ownerUser and ownerOrganization must be defined.");
7137
7122
  }
@@ -7150,7 +7135,7 @@ class UserFormService extends BaseApiService {
7150
7135
  favorite: true,
7151
7136
  submitted_at: submittedAt,
7152
7137
  created_by: currentUser.id,
7153
- ...componentTypeId && { component_type: componentTypeId },
7138
+ ...assetTypeId && { asset_type: assetTypeId },
7154
7139
  ...issueTypeId && { issue_type: issueTypeId },
7155
7140
  ...ownerAttrs
7156
7141
  };
@@ -7174,11 +7159,11 @@ class UserFormService extends BaseApiService {
7174
7159
  } : void 0,
7175
7160
  payload: {
7176
7161
  ...offlineFormPayload,
7177
- ...componentTypeId && { component_type: componentTypeId },
7162
+ ...assetTypeId && { asset_type: assetTypeId },
7178
7163
  ...issueTypeId && { issue_type: issueTypeId },
7179
7164
  initial_revision: payloadWithoutImage
7180
7165
  },
7181
- blockers: componentTypeId ? [componentTypeId] : issueTypeId ? [issueTypeId] : [],
7166
+ blockers: assetTypeId ? [assetTypeId] : issueTypeId ? [issueTypeId] : [],
7182
7167
  blocks: [offlineFormPayload.offline_id, payloadWithoutImage.offline_id]
7183
7168
  });
7184
7169
  const attachImagesPromises = this.getAttachImagePromises(images, offlineRevisionPayload.offline_id);
@@ -7202,7 +7187,7 @@ class UserFormService extends BaseApiService {
7202
7187
  `/forms/in-organization/${activeOrganizationId}/`,
7203
7188
  void 0,
7204
7189
  activeOrganizationId,
7205
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7190
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7206
7191
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7207
7192
  );
7208
7193
  }
@@ -7215,7 +7200,7 @@ class UserFormService extends BaseApiService {
7215
7200
  "/forms/my-forms/",
7216
7201
  currentUser.id,
7217
7202
  void 0,
7218
- attachedTo && "componentTypeId" in attachedTo ? attachedTo.componentTypeId : void 0,
7203
+ attachedTo && "assetTypeId" in attachedTo ? attachedTo.assetTypeId : void 0,
7219
7204
  attachedTo && "issueTypeId" in attachedTo ? attachedTo.issueTypeId : void 0
7220
7205
  );
7221
7206
  }
@@ -7383,8 +7368,8 @@ class UserFormSubmissionService extends BaseApiService {
7383
7368
  url: `/forms/submission/${submission.offline_id}/attachments/`,
7384
7369
  payload: submissionAttachmentPayload,
7385
7370
  blockers: [
7386
- submission.component,
7387
- submission.component_stage,
7371
+ submission.asset,
7372
+ submission.asset_stage,
7388
7373
  submission.issue,
7389
7374
  submission.form_revision
7390
7375
  ].filter((x) => x !== void 0),
@@ -7420,7 +7405,7 @@ class UserFormSubmissionService extends BaseApiService {
7420
7405
  method: HttpMethod.POST,
7421
7406
  url: `/forms/revisions/${payload.form_revision}/respond/`,
7422
7407
  payload: { ...offlineSubmission, project: activeProjectId },
7423
- blockers: [payload.issue, payload.component, payload.component_stage, "add-form-entry"].filter(
7408
+ blockers: [payload.issue, payload.asset, payload.asset_stage, "add-form-entry"].filter(
7424
7409
  (x) => x !== void 0
7425
7410
  ),
7426
7411
  blocks: [payload.offline_id]
@@ -7438,10 +7423,10 @@ class UserFormSubmissionService extends BaseApiService {
7438
7423
  const settledPromise = Promise.all([promise, ...attachFilesPromises]).then(() => promise);
7439
7424
  return [offlineSubmission, settledPromise];
7440
7425
  }
7441
- // Note currently the bulkAdd method is specific to form submissions for components
7426
+ // Note currently the bulkAdd method is specific to form submissions for assets
7442
7427
  // TODO: adapt the support bulk adding to any model type
7443
7428
  async bulkAdd(args) {
7444
- const { formRevision, values: argsValues, componentOfflineIds } = args;
7429
+ const { formRevision, values: argsValues, assetOfflineIds } = args;
7445
7430
  const { store } = this.client;
7446
7431
  const offlineSubmissions = [];
7447
7432
  const offlineAttachments = [];
@@ -7451,16 +7436,16 @@ class UserFormSubmissionService extends BaseApiService {
7451
7436
  const { values, files } = separateFilesFromValues(argsValues);
7452
7437
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7453
7438
  const createdBy = store.getState().userReducer.currentUser.id;
7454
- for (const component_id of componentOfflineIds) {
7439
+ for (const assetId of assetOfflineIds) {
7455
7440
  const submission = offline({
7456
7441
  form_revision: formRevision,
7457
7442
  values,
7458
7443
  created_by: createdBy,
7459
7444
  submitted_at: submittedAt,
7460
- component: component_id
7445
+ asset: assetId
7461
7446
  });
7462
7447
  submissionOfflineIds.push(submission.offline_id);
7463
- submissionsPayload.push({ offline_id: submission.offline_id, component_id });
7448
+ submissionsPayload.push({ offline_id: submission.offline_id, asset_id: assetId });
7464
7449
  offlineSubmissions.push(submission);
7465
7450
  for (const [fieldIdentifier, fileArray] of Object.entries(files)) {
7466
7451
  for (const file of fileArray) {
@@ -7507,7 +7492,7 @@ class UserFormSubmissionService extends BaseApiService {
7507
7492
  attachments: attachmentsPayload,
7508
7493
  files: Object.values(filesRecord)
7509
7494
  },
7510
- blockers: componentOfflineIds,
7495
+ blockers: assetOfflineIds,
7511
7496
  blocks: submissionOfflineIds
7512
7497
  });
7513
7498
  promise.then(({ submissions, attachments, presigned_urls }) => {
@@ -7550,7 +7535,7 @@ class UserFormSubmissionService extends BaseApiService {
7550
7535
  method: HttpMethod.PATCH,
7551
7536
  url: `/forms/submissions/${submission.offline_id}/`,
7552
7537
  payload: offlineSubmission,
7553
- blockers: [offlineSubmission.issue, offlineSubmission.component, offlineSubmission.component_stage].filter(
7538
+ blockers: [offlineSubmission.issue, offlineSubmission.asset, offlineSubmission.asset_stage].filter(
7554
7539
  (x) => x !== void 0
7555
7540
  ),
7556
7541
  blocks: [offlineSubmission.offline_id]
@@ -8359,24 +8344,70 @@ class DocumentAttachmentService extends BaseAttachmentService {
8359
8344
  }
8360
8345
  }
8361
8346
  class AgentService extends BaseApiService {
8347
+ async startConversation(prompt) {
8348
+ const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
8349
+ return this.enqueueRequest({
8350
+ description: "Start agent conversation",
8351
+ method: HttpMethod.POST,
8352
+ url: "/agents/prompt/",
8353
+ payload: {
8354
+ prompt,
8355
+ active_project: activeProjectId
8356
+ },
8357
+ blockers: ["prompt"],
8358
+ blocks: ["prompt"]
8359
+ }).then((response) => {
8360
+ if (response.conversation) {
8361
+ this.client.store.dispatch(addConversation(response.conversation));
8362
+ return response.conversation;
8363
+ }
8364
+ throw new Error("Unexpected response from agent");
8365
+ });
8366
+ }
8362
8367
  /**
8363
8368
  * Prompt the agent with a message.
8364
- * @param request The message to prompt the agent with.
8369
+ * @param prompt The message to prompt the agent with.
8365
8370
  * @param conversationId If continuing an existing message, the UUID of that conversation.
8366
8371
  */
8367
- async prompt(request2, conversationId) {
8368
- const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
8372
+ async continueConversation(prompt, conversationId) {
8373
+ const { store } = this.client;
8374
+ const activeProjectId = store.getState().projectReducer.activeProjectId;
8369
8375
  return this.enqueueRequest({
8370
8376
  description: "Prompt agent",
8371
8377
  method: HttpMethod.POST,
8372
8378
  url: "/agents/prompt/",
8373
8379
  payload: {
8374
- prompt: request2,
8380
+ prompt,
8375
8381
  active_project: activeProjectId
8376
8382
  },
8377
8383
  blockers: ["prompt"],
8378
8384
  blocks: ["prompt"],
8379
- queryParams: conversationId ? { conversation_id: conversationId } : {}
8385
+ queryParams: { conversation_id: conversationId }
8386
+ }).then((response) => {
8387
+ if (response.response) {
8388
+ const conversation = store.getState().agentsReducer.conversations[conversationId];
8389
+ if (!conversation) {
8390
+ throw new Error("Conversation not found");
8391
+ }
8392
+ store.dispatch(
8393
+ updateConversation({
8394
+ offline_id: conversationId,
8395
+ tiptap_content: [...conversation.tiptap_content || [], response.response]
8396
+ })
8397
+ );
8398
+ }
8399
+ throw new Error("Unexpected response from agent");
8400
+ });
8401
+ }
8402
+ async fetchDetails(conversationId) {
8403
+ return this.enqueueRequest({
8404
+ description: "Get agent conversation",
8405
+ method: HttpMethod.GET,
8406
+ url: `/agents/conversations/${conversationId}/`,
8407
+ blockers: ["conversation"],
8408
+ blocks: ["conversation"]
8409
+ }).then((response) => {
8410
+ this.client.store.dispatch(setConversation(response));
8380
8411
  });
8381
8412
  }
8382
8413
  async rate(responseId, rating) {
@@ -8389,6 +8420,18 @@ class AgentService extends BaseApiService {
8389
8420
  blocks: ["rate"]
8390
8421
  });
8391
8422
  }
8423
+ async refreshStore() {
8424
+ const { store } = this.client;
8425
+ const activeProject = store.getState().projectReducer.activeProjectId;
8426
+ const result = await this.enqueueRequest({
8427
+ description: "Get agent conversation history",
8428
+ method: HttpMethod.GET,
8429
+ url: `/projects/${activeProject}/agent-conversations/`,
8430
+ blockers: ["agent-conversations"],
8431
+ blocks: ["agent-conversations"]
8432
+ });
8433
+ store.dispatch(setConversations(result));
8434
+ }
8392
8435
  }
8393
8436
  class TeamService extends BaseApiService {
8394
8437
  add(teamPayload) {
@@ -8544,12 +8587,12 @@ class OvermapSDK {
8544
8587
  __publicField(this, "issueAttachments", new IssueAttachmentService(this));
8545
8588
  __publicField(this, "workspaces", new WorkspaceService(this));
8546
8589
  __publicField(this, "main", new MainService(this));
8547
- __publicField(this, "components", new ComponentService(this));
8548
- __publicField(this, "componentAttachments", new ComponentAttachmentService(this));
8549
- __publicField(this, "componentTypes", new ComponentTypeService(this));
8550
- __publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
8551
- __publicField(this, "componentStages", new ComponentStageService(this));
8552
- __publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
8590
+ __publicField(this, "assets", new AssetService(this));
8591
+ __publicField(this, "assetAttachments", new AssetAttachmentService(this));
8592
+ __publicField(this, "assetTypes", new AssetTypeService(this));
8593
+ __publicField(this, "assetTypeAttachments", new AssetTypeAttachmentService(this));
8594
+ __publicField(this, "assetStages", new AssetStageService(this));
8595
+ __publicField(this, "assetStageCompletions", new AssetStageCompletionService(this));
8553
8596
  __publicField(this, "userForms", new UserFormService(this));
8554
8597
  __publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
8555
8598
  __publicField(this, "projects", new ProjectService(this));
@@ -8888,82 +8931,58 @@ const useFormikInput = (props) => {
8888
8931
  { ...rest, "aria-labelledby": labelId }
8889
8932
  ];
8890
8933
  };
8891
- const truthyValues = [true, "true"];
8892
- const BooleanInput = memo((props) => {
8893
- const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
8894
- let [{ helpText, label }] = useFormikInput(props);
8895
- helpText = showInputOnly ? null : helpText;
8896
- label = showInputOnly ? "" : label;
8897
- const color = useSeverityColor(severity);
8898
- const value = truthyValues.includes(fieldProps.value);
8899
- return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsx(
8900
- InputWithLabel,
8901
- {
8902
- size,
8903
- severity,
8904
- inputId,
8905
- labelId,
8906
- label,
8907
- image: showInputOnly ? void 0 : field.image,
8908
- flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
8909
- children: /* @__PURE__ */ jsx(
8910
- Checkbox,
8911
- {
8912
- ...rest,
8913
- ...fieldProps,
8914
- id: inputId,
8915
- color,
8916
- value: value.toString(),
8917
- checked: value,
8918
- onCheckedChange: fieldProps.onChange,
8919
- onChange: void 0,
8920
- onBlur: void 0
8934
+ function getDefaultExportFromCjs(x) {
8935
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
8936
+ }
8937
+ var classnames = { exports: {} };
8938
+ /*!
8939
+ Copyright (c) 2018 Jed Watson.
8940
+ Licensed under the MIT License (MIT), see
8941
+ http://jedwatson.github.io/classnames
8942
+ */
8943
+ (function(module) {
8944
+ (function() {
8945
+ var hasOwn = {}.hasOwnProperty;
8946
+ function classNames2() {
8947
+ var classes = [];
8948
+ for (var i = 0; i < arguments.length; i++) {
8949
+ var arg = arguments[i];
8950
+ if (!arg)
8951
+ continue;
8952
+ var argType = typeof arg;
8953
+ if (argType === "string" || argType === "number") {
8954
+ classes.push(arg);
8955
+ } else if (Array.isArray(arg)) {
8956
+ if (arg.length) {
8957
+ var inner = classNames2.apply(null, arg);
8958
+ if (inner) {
8959
+ classes.push(inner);
8960
+ }
8961
+ }
8962
+ } else if (argType === "object") {
8963
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
8964
+ classes.push(arg.toString());
8965
+ continue;
8966
+ }
8967
+ for (var key in arg) {
8968
+ if (hasOwn.call(arg, key) && arg[key]) {
8969
+ classes.push(key);
8970
+ }
8971
+ }
8921
8972
  }
8922
- )
8923
- }
8924
- ) });
8925
- });
8926
- BooleanInput.displayName = "BooleanInput";
8927
- var DefaultContext = {
8928
- color: void 0,
8929
- size: void 0,
8930
- className: void 0,
8931
- style: void 0,
8932
- attr: void 0
8933
- };
8934
- var IconContext = React__default.createContext && /* @__PURE__ */ React__default.createContext(DefaultContext);
8935
- var _excluded = ["attr", "size", "title"];
8936
- function _objectWithoutProperties(source, excluded) {
8937
- if (source == null)
8938
- return {};
8939
- var target = _objectWithoutPropertiesLoose(source, excluded);
8940
- var key, i;
8941
- if (Object.getOwnPropertySymbols) {
8942
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
8943
- for (i = 0; i < sourceSymbolKeys.length; i++) {
8944
- key = sourceSymbolKeys[i];
8945
- if (excluded.indexOf(key) >= 0)
8946
- continue;
8947
- if (!Object.prototype.propertyIsEnumerable.call(source, key))
8948
- continue;
8949
- target[key] = source[key];
8973
+ }
8974
+ return classes.join(" ");
8950
8975
  }
8951
- }
8952
- return target;
8953
- }
8954
- function _objectWithoutPropertiesLoose(source, excluded) {
8955
- if (source == null)
8956
- return {};
8957
- var target = {};
8958
- for (var key in source) {
8959
- if (Object.prototype.hasOwnProperty.call(source, key)) {
8960
- if (excluded.indexOf(key) >= 0)
8961
- continue;
8962
- target[key] = source[key];
8976
+ if (module.exports) {
8977
+ classNames2.default = classNames2;
8978
+ module.exports = classNames2;
8979
+ } else {
8980
+ window.classNames = classNames2;
8963
8981
  }
8964
- }
8965
- return target;
8966
- }
8982
+ })();
8983
+ })(classnames);
8984
+ var classnamesExports = classnames.exports;
8985
+ const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
8967
8986
  function _extends$1() {
8968
8987
  _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
8969
8988
  for (var i = 1; i < arguments.length; i++) {
@@ -8978,242 +8997,12 @@ function _extends$1() {
8978
8997
  };
8979
8998
  return _extends$1.apply(this, arguments);
8980
8999
  }
8981
- function ownKeys(e, r) {
8982
- var t = Object.keys(e);
8983
- if (Object.getOwnPropertySymbols) {
8984
- var o = Object.getOwnPropertySymbols(e);
8985
- r && (o = o.filter(function(r2) {
8986
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
8987
- })), t.push.apply(t, o);
8988
- }
8989
- return t;
8990
- }
8991
- function _objectSpread(e) {
8992
- for (var r = 1; r < arguments.length; r++) {
8993
- var t = null != arguments[r] ? arguments[r] : {};
8994
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
8995
- _defineProperty(e, r2, t[r2]);
8996
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
8997
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
8998
- });
8999
- }
9000
- return e;
9001
- }
9002
- function _defineProperty(obj, key, value) {
9003
- key = _toPropertyKey(key);
9004
- if (key in obj) {
9005
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
9006
- } else {
9007
- obj[key] = value;
9008
- }
9009
- return obj;
9010
- }
9011
- function _toPropertyKey(t) {
9012
- var i = _toPrimitive(t, "string");
9013
- return "symbol" == typeof i ? i : i + "";
9014
- }
9015
- function _toPrimitive(t, r) {
9016
- if ("object" != typeof t || !t)
9017
- return t;
9018
- var e = t[Symbol.toPrimitive];
9019
- if (void 0 !== e) {
9020
- var i = e.call(t, r || "default");
9021
- if ("object" != typeof i)
9022
- return i;
9023
- throw new TypeError("@@toPrimitive must return a primitive value.");
9024
- }
9025
- return ("string" === r ? String : Number)(t);
9026
- }
9027
- function Tree2Element(tree) {
9028
- return tree && tree.map((node, i) => /* @__PURE__ */ React__default.createElement(node.tag, _objectSpread({
9029
- key: i
9030
- }, node.attr), Tree2Element(node.child)));
9031
- }
9032
- function GenIcon(data) {
9033
- return (props) => /* @__PURE__ */ React__default.createElement(IconBase, _extends$1({
9034
- attr: _objectSpread({}, data.attr)
9035
- }, props), Tree2Element(data.child));
9036
- }
9037
- function IconBase(props) {
9038
- var elem = (conf) => {
9039
- var {
9040
- attr,
9041
- size,
9042
- title: title2
9043
- } = props, svgProps = _objectWithoutProperties(props, _excluded);
9044
- var computedSize = size || conf.size || "1em";
9045
- var className;
9046
- if (conf.className)
9047
- className = conf.className;
9048
- if (props.className)
9049
- className = (className ? className + " " : "") + props.className;
9050
- return /* @__PURE__ */ React__default.createElement("svg", _extends$1({
9051
- stroke: "currentColor",
9052
- fill: "currentColor",
9053
- strokeWidth: "0"
9054
- }, conf.attr, attr, svgProps, {
9055
- className,
9056
- style: _objectSpread(_objectSpread({
9057
- color: props.color || conf.color
9058
- }, conf.style), props.style),
9059
- height: computedSize,
9060
- width: computedSize,
9061
- xmlns: "http://www.w3.org/2000/svg"
9062
- }), title2 && /* @__PURE__ */ React__default.createElement("title", null, title2), props.children);
9063
- };
9064
- return IconContext !== void 0 ? /* @__PURE__ */ React__default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
9065
- }
9066
- function RiArrowDownLine(props) {
9067
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
9068
- }
9069
- function RiArrowUpLine(props) {
9070
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
9071
- }
9072
- function RiCalendarLine(props) {
9073
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
9074
- }
9075
- function RiQrCodeLine(props) {
9076
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
9077
- }
9078
- function RiFileCopyLine(props) {
9079
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
9080
- }
9081
- function RiAlignJustify(props) {
9082
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
9083
- }
9084
- function RiHashtag(props) {
9085
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
9086
- }
9087
- function RiInputField(props) {
9088
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
9089
- }
9090
- function RiListCheck(props) {
9091
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
9092
- }
9093
- function RiImageLine(props) {
9094
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
9095
- }
9096
- function RiCheckboxCircleLine(props) {
9097
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
9098
- }
9099
- function RiCheckboxLine(props) {
9100
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
9101
- }
9102
- function RiDeleteBin2Line(props) {
9103
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
9104
- }
9105
- function RiMenuFoldLine(props) {
9106
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
9107
- }
9108
- function RiUpload2Line(props) {
9109
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
9110
- }
9111
- const emptyBooleanField = {
9112
- ...emptyBaseField,
9113
- type: "boolean"
9114
- };
9115
- const _BooleanField = class _BooleanField extends BaseField {
9116
- constructor(options) {
9117
- super({ ...options, type: "boolean" });
9118
- __publicField(this, "onlyValidateAfterTouched", false);
9119
- }
9120
- // if a BooleanField is required, `false` is considered blank
9121
- isBlank(value) {
9122
- return this.required && !value;
9123
- }
9124
- getValueFromChangeEvent(event) {
9125
- if (typeof event === "boolean")
9126
- return event;
9127
- return event.target.checked;
9128
- }
9129
- serialize() {
9130
- return super._serialize();
9131
- }
9132
- static deserialize(data) {
9133
- if (data.type !== "boolean")
9134
- throw new Error("Type mismatch.");
9135
- return new _BooleanField(data);
9136
- }
9137
- getInput(props) {
9138
- return /* @__PURE__ */ jsx(BooleanInput, { ...props, field: this });
9139
- }
9140
- };
9141
- __publicField(_BooleanField, "fieldTypeName", "Checkbox");
9142
- __publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
9143
- __publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
9144
- let BooleanField = _BooleanField;
9145
- function getDefaultExportFromCjs(x) {
9146
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
9147
- }
9148
- var classnames = { exports: {} };
9149
- /*!
9150
- Copyright (c) 2018 Jed Watson.
9151
- Licensed under the MIT License (MIT), see
9152
- http://jedwatson.github.io/classnames
9153
- */
9154
- (function(module) {
9155
- (function() {
9156
- var hasOwn = {}.hasOwnProperty;
9157
- function classNames2() {
9158
- var classes = [];
9159
- for (var i = 0; i < arguments.length; i++) {
9160
- var arg = arguments[i];
9161
- if (!arg)
9162
- continue;
9163
- var argType = typeof arg;
9164
- if (argType === "string" || argType === "number") {
9165
- classes.push(arg);
9166
- } else if (Array.isArray(arg)) {
9167
- if (arg.length) {
9168
- var inner = classNames2.apply(null, arg);
9169
- if (inner) {
9170
- classes.push(inner);
9171
- }
9172
- }
9173
- } else if (argType === "object") {
9174
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
9175
- classes.push(arg.toString());
9176
- continue;
9177
- }
9178
- for (var key in arg) {
9179
- if (hasOwn.call(arg, key) && arg[key]) {
9180
- classes.push(key);
9181
- }
9182
- }
9183
- }
9184
- }
9185
- return classes.join(" ");
9186
- }
9187
- if (module.exports) {
9188
- classNames2.default = classNames2;
9189
- module.exports = classNames2;
9190
- } else {
9191
- window.classNames = classNames2;
9192
- }
9193
- })();
9194
- })(classnames);
9195
- var classnamesExports = classnames.exports;
9196
- const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
9197
- function _extends() {
9198
- _extends = Object.assign ? Object.assign.bind() : function(target) {
9199
- for (var i = 1; i < arguments.length; i++) {
9200
- var source = arguments[i];
9201
- for (var key in source) {
9202
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9203
- target[key] = source[key];
9204
- }
9205
- }
9206
- }
9207
- return target;
9208
- };
9209
- return _extends.apply(this, arguments);
9210
- }
9211
- function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9212
- return function handleEvent(event) {
9213
- originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
9214
- if (checkForDefaultPrevented === false || !event.defaultPrevented)
9215
- return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
9216
- };
9000
+ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9001
+ return function handleEvent(event) {
9002
+ originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
9003
+ if (checkForDefaultPrevented === false || !event.defaultPrevented)
9004
+ return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
9005
+ };
9217
9006
  }
9218
9007
  function $6ed0406888f73fc4$var$setRef(ref, value) {
9219
9008
  if (typeof ref === "function")
@@ -9337,11 +9126,11 @@ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ forwardRef((pr
9337
9126
  } else
9338
9127
  return child;
9339
9128
  });
9340
- return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9129
+ return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9341
9130
  ref: forwardedRef
9342
9131
  }), /* @__PURE__ */ isValidElement(newElement) ? /* @__PURE__ */ cloneElement(newElement, void 0, newChildren) : null);
9343
9132
  }
9344
- return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
9133
+ return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
9345
9134
  ref: forwardedRef
9346
9135
  }), children);
9347
9136
  });
@@ -9419,7 +9208,7 @@ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.re
9419
9208
  useEffect(() => {
9420
9209
  window[Symbol.for("radix-ui")] = true;
9421
9210
  }, []);
9422
- return /* @__PURE__ */ createElement(Comp, _extends({}, primitiveProps, {
9211
+ return /* @__PURE__ */ createElement(Comp, _extends$1({}, primitiveProps, {
9423
9212
  ref: forwardedRef
9424
9213
  }));
9425
9214
  });
@@ -9978,9 +9767,9 @@ const Inset = React.forwardRef((props, forwardedRef) => {
9978
9767
  return React.createElement("div", { ...insetProps, ref: forwardedRef, className: classNames("rt-Inset", className, withBreakpoints(side, "rt-r-side"), withBreakpoints(clip, "rt-r-clip"), withBreakpoints(p, "rt-r-p"), withBreakpoints(px, "rt-r-px"), withBreakpoints(py, "rt-r-py"), withBreakpoints(pt, "rt-r-pt"), withBreakpoints(pr, "rt-r-pr"), withBreakpoints(pb, "rt-r-pb"), withBreakpoints(pl, "rt-r-pl"), withMarginProps(marginProps)) });
9979
9768
  });
9980
9769
  Inset.displayName = "Inset";
9981
- const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9770
+ const sizes$9 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9982
9771
  const headingPropDefs = {
9983
- size: { type: "enum", values: sizes$8, default: "6", responsive: true },
9772
+ size: { type: "enum", values: sizes$9, default: "6", responsive: true },
9984
9773
  weight: { ...weightProp, default: "bold" },
9985
9774
  align: alignProp,
9986
9775
  trim: trimProp,
@@ -9993,9 +9782,9 @@ const Heading = React.forwardRef((props, forwardedRef) => {
9993
9782
  return React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...headingProps, ref: forwardedRef, className: classNames("rt-Heading", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React.createElement(Tag, null, children));
9994
9783
  });
9995
9784
  Heading.displayName = "Heading";
9996
- const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9785
+ const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9997
9786
  const textPropDefs = {
9998
- size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9787
+ size: { type: "enum", values: sizes$8, default: void 0, responsive: true },
9999
9788
  weight: weightProp,
10000
9789
  align: alignProp,
10001
9790
  trim: trimProp,
@@ -10008,11 +9797,11 @@ const Text = React.forwardRef((props, forwardedRef) => {
10008
9797
  return React.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...textProps, ref: forwardedRef, className: classNames("rt-Text", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React.createElement(Tag, null, children));
10009
9798
  });
10010
9799
  Text.displayName = "Text";
10011
- const sizes$6 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
10012
- const variants$4 = ["solid", "soft", "outline", "ghost"];
9800
+ const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9801
+ const variants$5 = ["solid", "soft", "outline", "ghost"];
10013
9802
  const codePropDefs = {
10014
- size: { type: "enum", values: sizes$6, default: void 0, responsive: true },
10015
- variant: { type: "enum", values: variants$4, default: "soft" },
9803
+ size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9804
+ variant: { type: "enum", values: variants$5, default: "soft" },
10016
9805
  weight: weightProp,
10017
9806
  color: colorProp,
10018
9807
  highContrast: highContrastProp
@@ -10042,6 +9831,202 @@ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
10042
9831
  value
10043
9832
  ]);
10044
9833
  }
9834
+ const $e698a72e93240346$var$CHECKBOX_NAME = "Checkbox";
9835
+ const [$e698a72e93240346$var$createCheckboxContext, $e698a72e93240346$export$b566c4ff5488ea01] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($e698a72e93240346$var$CHECKBOX_NAME);
9836
+ const [$e698a72e93240346$var$CheckboxProvider, $e698a72e93240346$var$useCheckboxContext] = $e698a72e93240346$var$createCheckboxContext($e698a72e93240346$var$CHECKBOX_NAME);
9837
+ const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
9838
+ const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
9839
+ const [button, setButton] = useState(null);
9840
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
9841
+ forwardedRef,
9842
+ (node) => setButton(node)
9843
+ );
9844
+ const hasConsumerStoppedPropagationRef = useRef(false);
9845
+ const isFormControl = button ? Boolean(button.closest("form")) : true;
9846
+ const [checked = false, setChecked] = $71cd76cc60e0454e$export$6f32135080cb4c3({
9847
+ prop: checkedProp,
9848
+ defaultProp: defaultChecked,
9849
+ onChange: onCheckedChange
9850
+ });
9851
+ const initialCheckedStateRef = useRef(checked);
9852
+ useEffect(() => {
9853
+ const form = button === null || button === void 0 ? void 0 : button.form;
9854
+ if (form) {
9855
+ const reset = () => setChecked(initialCheckedStateRef.current);
9856
+ form.addEventListener("reset", reset);
9857
+ return () => form.removeEventListener("reset", reset);
9858
+ }
9859
+ }, [
9860
+ button,
9861
+ setChecked
9862
+ ]);
9863
+ return /* @__PURE__ */ createElement($e698a72e93240346$var$CheckboxProvider, {
9864
+ scope: __scopeCheckbox,
9865
+ state: checked,
9866
+ disabled
9867
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
9868
+ type: "button",
9869
+ role: "checkbox",
9870
+ "aria-checked": $e698a72e93240346$var$isIndeterminate(checked) ? "mixed" : checked,
9871
+ "aria-required": required,
9872
+ "data-state": $e698a72e93240346$var$getState(checked),
9873
+ "data-disabled": disabled ? "" : void 0,
9874
+ disabled,
9875
+ value
9876
+ }, checkboxProps, {
9877
+ ref: composedRefs,
9878
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
9879
+ if (event.key === "Enter")
9880
+ event.preventDefault();
9881
+ }),
9882
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event) => {
9883
+ setChecked(
9884
+ (prevChecked) => $e698a72e93240346$var$isIndeterminate(prevChecked) ? true : !prevChecked
9885
+ );
9886
+ if (isFormControl) {
9887
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
9888
+ if (!hasConsumerStoppedPropagationRef.current)
9889
+ event.stopPropagation();
9890
+ }
9891
+ })
9892
+ })), isFormControl && /* @__PURE__ */ createElement($e698a72e93240346$var$BubbleInput, {
9893
+ control: button,
9894
+ bubbles: !hasConsumerStoppedPropagationRef.current,
9895
+ name,
9896
+ value,
9897
+ checked,
9898
+ required,
9899
+ disabled,
9900
+ style: {
9901
+ transform: "translateX(-100%)"
9902
+ }
9903
+ }));
9904
+ });
9905
+ const $e698a72e93240346$var$INDICATOR_NAME = "CheckboxIndicator";
9906
+ const $e698a72e93240346$export$59aad738f51d1c05 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
9907
+ const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
9908
+ const context = $e698a72e93240346$var$useCheckboxContext($e698a72e93240346$var$INDICATOR_NAME, __scopeCheckbox);
9909
+ return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
9910
+ present: forceMount || $e698a72e93240346$var$isIndeterminate(context.state) || context.state === true
9911
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
9912
+ "data-state": $e698a72e93240346$var$getState(context.state),
9913
+ "data-disabled": context.disabled ? "" : void 0
9914
+ }, indicatorProps, {
9915
+ ref: forwardedRef,
9916
+ style: {
9917
+ pointerEvents: "none",
9918
+ ...props.style
9919
+ }
9920
+ })));
9921
+ });
9922
+ const $e698a72e93240346$var$BubbleInput = (props) => {
9923
+ const { control, checked, bubbles = true, ...inputProps } = props;
9924
+ const ref = useRef(null);
9925
+ const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
9926
+ const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control);
9927
+ useEffect(() => {
9928
+ const input = ref.current;
9929
+ const inputProto = window.HTMLInputElement.prototype;
9930
+ const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
9931
+ const setChecked = descriptor.set;
9932
+ if (prevChecked !== checked && setChecked) {
9933
+ const event = new Event("click", {
9934
+ bubbles
9935
+ });
9936
+ input.indeterminate = $e698a72e93240346$var$isIndeterminate(checked);
9937
+ setChecked.call(input, $e698a72e93240346$var$isIndeterminate(checked) ? false : checked);
9938
+ input.dispatchEvent(event);
9939
+ }
9940
+ }, [
9941
+ prevChecked,
9942
+ checked,
9943
+ bubbles
9944
+ ]);
9945
+ return /* @__PURE__ */ createElement("input", _extends$1({
9946
+ type: "checkbox",
9947
+ "aria-hidden": true,
9948
+ defaultChecked: $e698a72e93240346$var$isIndeterminate(checked) ? false : checked
9949
+ }, inputProps, {
9950
+ tabIndex: -1,
9951
+ ref,
9952
+ style: {
9953
+ ...props.style,
9954
+ ...controlSize,
9955
+ position: "absolute",
9956
+ pointerEvents: "none",
9957
+ opacity: 0,
9958
+ margin: 0
9959
+ }
9960
+ }));
9961
+ };
9962
+ function $e698a72e93240346$var$isIndeterminate(checked) {
9963
+ return checked === "indeterminate";
9964
+ }
9965
+ function $e698a72e93240346$var$getState(checked) {
9966
+ return $e698a72e93240346$var$isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
9967
+ }
9968
+ const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
9969
+ const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
9970
+ const sizes$6 = ["1", "2", "3"];
9971
+ const variants$4 = ["classic", "surface", "soft"];
9972
+ const checkboxPropDefs = {
9973
+ size: { type: "enum", values: sizes$6, default: "2", responsive: true },
9974
+ variant: { type: "enum", values: variants$4, default: "surface" },
9975
+ color: colorProp,
9976
+ highContrast: highContrastProp
9977
+ };
9978
+ const ThickCheckIcon = React.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9979
+ return React.createElement(
9980
+ "svg",
9981
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9982
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z" })
9983
+ );
9984
+ });
9985
+ ThickCheckIcon.displayName = "ThickCheckIcon";
9986
+ const ChevronDownIcon = React.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9987
+ return React.createElement(
9988
+ "svg",
9989
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9990
+ React.createElement("path", { d: "M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z" })
9991
+ );
9992
+ });
9993
+ ChevronDownIcon.displayName = "ChevronDownIcon";
9994
+ const ThickChevronRightIcon = React.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
9995
+ return React.createElement(
9996
+ "svg",
9997
+ { width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
9998
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z" })
9999
+ );
10000
+ });
10001
+ ThickChevronRightIcon.displayName = "ThickChevronRightIcon";
10002
+ const InfoCircledIcon = React.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
10003
+ return React.createElement(
10004
+ "svg",
10005
+ { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
10006
+ React.createElement("path", { d: "M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z", fill: color, fillRule: "evenodd", clipRule: "evenodd" })
10007
+ );
10008
+ });
10009
+ InfoCircledIcon.displayName = "InfoCircledIcon";
10010
+ const Checkbox = React.forwardRef((props, forwardedRef) => {
10011
+ const { rest: marginRest, ...marginProps } = extractMarginProps(props);
10012
+ const { className, style, size = checkboxPropDefs.size.default, variant = checkboxPropDefs.variant.default, color = checkboxPropDefs.color.default, highContrast = checkboxPropDefs.highContrast.default, ...checkboxProps } = marginRest;
10013
+ return React.createElement(
10014
+ "span",
10015
+ { className: classNames("rt-CheckboxRoot", className, withBreakpoints(size, "rt-r-size"), withMarginProps(marginProps)), style },
10016
+ React.createElement(
10017
+ $e698a72e93240346$export$be92b6f5f03c0fe9,
10018
+ { "data-accent-color": color, ...checkboxProps, ref: forwardedRef, className: classNames("rt-reset", "rt-CheckboxButton", `rt-variant-${variant}`, {
10019
+ "rt-high-contrast": highContrast
10020
+ }) },
10021
+ React.createElement(
10022
+ $e698a72e93240346$export$adb584737d712b70,
10023
+ { className: "rt-CheckboxIndicator" },
10024
+ React.createElement(ThickCheckIcon, { className: "rt-CheckboxIndicatorIcon" })
10025
+ )
10026
+ )
10027
+ );
10028
+ });
10029
+ Checkbox.displayName = "Checkbox";
10045
10030
  function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
10046
10031
  const PROVIDER_NAME = name + "CollectionProvider";
10047
10032
  const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
@@ -10133,7 +10118,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /* @__PURE__ */ forwardRef((pr
10133
10118
  scope: props.__scopeRovingFocusGroup
10134
10119
  }, /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
10135
10120
  scope: props.__scopeRovingFocusGroup
10136
- }, /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
10121
+ }, /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends$1({}, props, {
10137
10122
  ref: forwardedRef
10138
10123
  }))));
10139
10124
  });
@@ -10189,7 +10174,7 @@ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /* @__PURE__ */ forwardRef((p
10189
10174
  ),
10190
10175
  []
10191
10176
  )
10192
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10177
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10193
10178
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
10194
10179
  "data-orientation": orientation
10195
10180
  }, groupProps, {
@@ -10259,7 +10244,7 @@ const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /* @__PURE__ */ forwardRef((pro
10259
10244
  id,
10260
10245
  focusable,
10261
10246
  active
10262
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
10247
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
10263
10248
  tabIndex: isCurrentTabStop ? 0 : -1,
10264
10249
  "data-orientation": context.orientation
10265
10250
  }, itemProps, {
@@ -10399,7 +10384,7 @@ const $57acba87d6e25586$export$ccf8d8d7bbf3c2cc = /* @__PURE__ */ forwardRef((pr
10399
10384
  onScrollbarYEnabledChange: setScrollbarYEnabled,
10400
10385
  onCornerWidthChange: setCornerWidth,
10401
10386
  onCornerHeightChange: setCornerHeight
10402
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10387
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10403
10388
  dir: direction
10404
10389
  }, scrollAreaProps, {
10405
10390
  ref: composedRefs,
@@ -10422,7 +10407,7 @@ const $57acba87d6e25586$export$a21cbf9f11fca853 = /* @__PURE__ */ forwardRef((pr
10422
10407
  dangerouslySetInnerHTML: {
10423
10408
  __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
10424
10409
  }
10425
- }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10410
+ }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10426
10411
  "data-radix-scroll-area-viewport": ""
10427
10412
  }, viewportProps, {
10428
10413
  ref: composedRefs,
@@ -10466,16 +10451,16 @@ const $57acba87d6e25586$export$2fabd85d0eba3c57 = /* @__PURE__ */ forwardRef((pr
10466
10451
  onScrollbarXEnabledChange,
10467
10452
  onScrollbarYEnabledChange
10468
10453
  ]);
10469
- return context.type === "hover" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends({}, scrollbarProps, {
10454
+ return context.type === "hover" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends$1({}, scrollbarProps, {
10470
10455
  ref: forwardedRef,
10471
10456
  forceMount
10472
- })) : context.type === "scroll" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends({}, scrollbarProps, {
10457
+ })) : context.type === "scroll" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends$1({}, scrollbarProps, {
10473
10458
  ref: forwardedRef,
10474
10459
  forceMount
10475
- })) : context.type === "auto" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({}, scrollbarProps, {
10460
+ })) : context.type === "auto" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({}, scrollbarProps, {
10476
10461
  ref: forwardedRef,
10477
10462
  forceMount
10478
- })) : context.type === "always" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({}, scrollbarProps, {
10463
+ })) : context.type === "always" ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({}, scrollbarProps, {
10479
10464
  ref: forwardedRef
10480
10465
  })) : null;
10481
10466
  });
@@ -10511,7 +10496,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarHover = /* @__PURE__ */ forwardRe
10511
10496
  ]);
10512
10497
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10513
10498
  present: forceMount || visible
10514
- }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({
10499
+ }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({
10515
10500
  "data-state": visible ? "visible" : "hidden"
10516
10501
  }, scrollbarProps, {
10517
10502
  ref: forwardedRef
@@ -10581,7 +10566,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarScroll = /* @__PURE__ */ forwardR
10581
10566
  ]);
10582
10567
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10583
10568
  present: forceMount || state !== "hidden"
10584
- }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10569
+ }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
10585
10570
  "data-state": state === "hidden" ? "hidden" : "visible"
10586
10571
  }, scrollbarProps, {
10587
10572
  ref: forwardedRef,
@@ -10611,7 +10596,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarAuto = /* @__PURE__ */ forwardRef
10611
10596
  $57acba87d6e25586$var$useResizeObserver(context.content, handleResize);
10612
10597
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10613
10598
  present: forceMount || visible
10614
- }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
10599
+ }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
10615
10600
  "data-state": visible ? "visible" : "hidden"
10616
10601
  }, scrollbarProps, {
10617
10602
  ref: forwardedRef
@@ -10645,7 +10630,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarVisible = /* @__PURE__ */ forward
10645
10630
  return $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes2, dir);
10646
10631
  }
10647
10632
  if (orientation === "horizontal")
10648
- return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends({}, commonProps, {
10633
+ return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends$1({}, commonProps, {
10649
10634
  ref: forwardedRef,
10650
10635
  onThumbPositionChange: () => {
10651
10636
  if (context.viewport && thumbRef.current) {
@@ -10664,7 +10649,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarVisible = /* @__PURE__ */ forward
10664
10649
  }
10665
10650
  }));
10666
10651
  if (orientation === "vertical")
10667
- return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends({}, commonProps, {
10652
+ return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends$1({}, commonProps, {
10668
10653
  ref: forwardedRef,
10669
10654
  onThumbPositionChange: () => {
10670
10655
  if (context.viewport && thumbRef.current) {
@@ -10696,7 +10681,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarX = /* @__PURE__ */ forwardRef((p
10696
10681
  }, [
10697
10682
  ref
10698
10683
  ]);
10699
- return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10684
+ return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
10700
10685
  "data-orientation": "horizontal"
10701
10686
  }, scrollbarProps, {
10702
10687
  ref: composeRefs,
@@ -10744,7 +10729,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarY = /* @__PURE__ */ forwardRef((p
10744
10729
  }, [
10745
10730
  ref
10746
10731
  ]);
10747
- return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
10732
+ return /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
10748
10733
  "data-orientation": "vertical"
10749
10734
  }, scrollbarProps, {
10750
10735
  ref: composeRefs,
@@ -10840,7 +10825,7 @@ const $57acba87d6e25586$var$ScrollAreaScrollbarImpl = /* @__PURE__ */ forwardRef
10840
10825
  onThumbPointerUp: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerUp),
10841
10826
  onThumbPositionChange: handleThumbPositionChange,
10842
10827
  onThumbPointerDown: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerDown)
10843
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, scrollbarProps, {
10828
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, scrollbarProps, {
10844
10829
  ref: composeRefs,
10845
10830
  style: {
10846
10831
  position: "absolute",
@@ -10877,7 +10862,7 @@ const $57acba87d6e25586$export$9fba1154677d7cd2 = /* @__PURE__ */ forwardRef((pr
10877
10862
  const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, props.__scopeScrollArea);
10878
10863
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
10879
10864
  present: forceMount || scrollbarContext.hasThumb
10880
- }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends({
10865
+ }, /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends$1({
10881
10866
  ref: forwardedRef
10882
10867
  }, thumbProps)));
10883
10868
  });
@@ -10917,7 +10902,7 @@ const $57acba87d6e25586$var$ScrollAreaThumbImpl = /* @__PURE__ */ forwardRef((pr
10917
10902
  debounceScrollEnd,
10918
10903
  onThumbPositionChange
10919
10904
  ]);
10920
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
10905
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
10921
10906
  "data-state": scrollbarContext.hasThumb ? "visible" : "hidden"
10922
10907
  }, thumbProps, {
10923
10908
  ref: composedRef,
@@ -10944,7 +10929,7 @@ const $57acba87d6e25586$export$56969d565df7cc4b = /* @__PURE__ */ forwardRef((pr
10944
10929
  const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, props.__scopeScrollArea);
10945
10930
  const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
10946
10931
  const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
10947
- return hasCorner ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends({}, props, {
10932
+ return hasCorner ? /* @__PURE__ */ createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends$1({}, props, {
10948
10933
  ref: forwardedRef
10949
10934
  })) : null;
10950
10935
  });
@@ -10966,7 +10951,7 @@ const $57acba87d6e25586$var$ScrollAreaCornerImpl = /* @__PURE__ */ forwardRef((p
10966
10951
  context.onCornerWidthChange(width);
10967
10952
  setWidth(width);
10968
10953
  });
10969
- return hasSize ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, cornerProps, {
10954
+ return hasSize ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, cornerProps, {
10970
10955
  ref: forwardedRef,
10971
10956
  style: {
10972
10957
  width: width1,
@@ -11227,7 +11212,7 @@ const $faa2e61a3361514f$export$472062a354075cee = /* @__PURE__ */ forwardRef((pr
11227
11212
  scope: props.__scopeSlider
11228
11213
  }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$Collection.Slot, {
11229
11214
  scope: props.__scopeSlider
11230
- }, /* @__PURE__ */ createElement(SliderOrientation, _extends({
11215
+ }, /* @__PURE__ */ createElement(SliderOrientation, _extends$1({
11231
11216
  "aria-disabled": disabled,
11232
11217
  "data-disabled": disabled ? "" : void 0
11233
11218
  }, sliderProps, {
@@ -11309,7 +11294,7 @@ const $faa2e61a3361514f$var$SliderHorizontal = /* @__PURE__ */ forwardRef((props
11309
11294
  endEdge: isSlidingFromLeft ? "right" : "left",
11310
11295
  direction: isSlidingFromLeft ? 1 : -1,
11311
11296
  size: "width"
11312
- }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11297
+ }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11313
11298
  dir: direction,
11314
11299
  "data-orientation": "horizontal"
11315
11300
  }, sliderProps, {
@@ -11369,7 +11354,7 @@ const $faa2e61a3361514f$var$SliderVertical = /* @__PURE__ */ forwardRef((props,
11369
11354
  endEdge: isSlidingFromBottom ? "top" : "bottom",
11370
11355
  size: "height",
11371
11356
  direction: isSlidingFromBottom ? 1 : -1
11372
- }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderImpl, _extends({
11357
+ }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
11373
11358
  "data-orientation": "vertical"
11374
11359
  }, sliderProps, {
11375
11360
  ref,
@@ -11402,7 +11387,7 @@ const $faa2e61a3361514f$var$SliderVertical = /* @__PURE__ */ forwardRef((props,
11402
11387
  const $faa2e61a3361514f$var$SliderImpl = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
11403
11388
  const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
11404
11389
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
11405
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
11390
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, sliderProps, {
11406
11391
  ref: forwardedRef,
11407
11392
  onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
11408
11393
  if (event.key === "Home") {
@@ -11443,7 +11428,7 @@ const $faa2e61a3361514f$var$TRACK_NAME = "SliderTrack";
11443
11428
  const $faa2e61a3361514f$export$105594979f116971 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
11444
11429
  const { __scopeSlider, ...trackProps } = props;
11445
11430
  const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
11446
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11431
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11447
11432
  "data-disabled": context.disabled ? "" : void 0,
11448
11433
  "data-orientation": context.orientation
11449
11434
  }, trackProps, {
@@ -11463,7 +11448,7 @@ const $faa2e61a3361514f$export$a5cf38a7a000fe77 = /* @__PURE__ */ forwardRef((pr
11463
11448
  );
11464
11449
  const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
11465
11450
  const offsetEnd = 100 - Math.max(...percentages);
11466
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11451
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11467
11452
  "data-orientation": context.orientation,
11468
11453
  "data-disabled": context.disabled ? "" : void 0
11469
11454
  }, rangeProps, {
@@ -11492,7 +11477,7 @@ const $faa2e61a3361514f$export$2c1b491743890dec = /* @__PURE__ */ forwardRef((pr
11492
11477
  thumb
11493
11478
  ]
11494
11479
  );
11495
- return /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
11480
+ return /* @__PURE__ */ createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends$1({}, props, {
11496
11481
  ref: composedRefs,
11497
11482
  index: index2
11498
11483
  }));
@@ -11531,7 +11516,7 @@ const $faa2e61a3361514f$var$SliderThumbImpl = /* @__PURE__ */ forwardRef((props,
11531
11516
  }
11532
11517
  }, /* @__PURE__ */ createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
11533
11518
  scope: props.__scopeSlider
11534
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
11519
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
11535
11520
  role: "slider",
11536
11521
  "aria-label": props["aria-label"] || label,
11537
11522
  "aria-valuemin": context.min,
@@ -11571,7 +11556,7 @@ const $faa2e61a3361514f$var$BubbleInput = (props) => {
11571
11556
  prevValue,
11572
11557
  value
11573
11558
  ]);
11574
- return /* @__PURE__ */ createElement("input", _extends({
11559
+ return /* @__PURE__ */ createElement("input", _extends$1({
11575
11560
  style: {
11576
11561
  display: "none"
11577
11562
  }
@@ -11790,7 +11775,7 @@ const $cddcb0b647441e34$export$e2255cf6045e8d47 = /* @__PURE__ */ forwardRef((pr
11790
11775
  scope: __scopeAvatar,
11791
11776
  imageLoadingStatus,
11792
11777
  onImageLoadingStatusChange: setImageLoadingStatus
11793
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, avatarProps, {
11778
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, avatarProps, {
11794
11779
  ref: forwardedRef
11795
11780
  })));
11796
11781
  });
@@ -11811,7 +11796,7 @@ const $cddcb0b647441e34$export$2cd8ae1985206fe8 = /* @__PURE__ */ forwardRef((pr
11811
11796
  imageLoadingStatus,
11812
11797
  handleLoadingStatusChange
11813
11798
  ]);
11814
- return imageLoadingStatus === "loaded" ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends({}, imageProps, {
11799
+ return imageLoadingStatus === "loaded" ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends$1({}, imageProps, {
11815
11800
  ref: forwardedRef,
11816
11801
  src
11817
11802
  })) : null;
@@ -11832,7 +11817,7 @@ const $cddcb0b647441e34$export$69fffb6a9571fbfe = /* @__PURE__ */ forwardRef((pr
11832
11817
  }, [
11833
11818
  delayMs
11834
11819
  ]);
11835
- return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, fallbackProps, {
11820
+ return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, fallbackProps, {
11836
11821
  ref: forwardedRef
11837
11822
  })) : null;
11838
11823
  });
@@ -11936,7 +11921,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /* @__PURE__ */ forwardRef((pr
11936
11921
  orientation,
11937
11922
  dir: direction,
11938
11923
  activationMode
11939
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11924
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
11940
11925
  dir: direction,
11941
11926
  "data-orientation": orientation
11942
11927
  }, tabsProps, {
@@ -11948,13 +11933,13 @@ const $69cb30bb0017df05$export$9712d22edc0d78c1 = /* @__PURE__ */ forwardRef((pr
11948
11933
  const { __scopeTabs, loop = true, ...listProps } = props;
11949
11934
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
11950
11935
  const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
11951
- return /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
11936
+ return /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends$1({
11952
11937
  asChild: true
11953
11938
  }, rovingFocusGroupScope, {
11954
11939
  orientation: context.orientation,
11955
11940
  dir: context.dir,
11956
11941
  loop
11957
- }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
11942
+ }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
11958
11943
  role: "tablist",
11959
11944
  "aria-orientation": context.orientation
11960
11945
  }, listProps, {
@@ -11969,12 +11954,12 @@ const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /* @__PURE__ */ forwardRef((pr
11969
11954
  const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
11970
11955
  const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
11971
11956
  const isSelected = value === context.value;
11972
- return /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
11957
+ return /* @__PURE__ */ createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends$1({
11973
11958
  asChild: true
11974
11959
  }, rovingFocusGroupScope, {
11975
11960
  focusable: !disabled,
11976
11961
  active: isSelected
11977
- }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
11962
+ }), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
11978
11963
  type: "button",
11979
11964
  role: "tab",
11980
11965
  "aria-selected": isSelected,
@@ -12024,7 +12009,7 @@ const $69cb30bb0017df05$export$bd905d70e8fd2ebb = /* @__PURE__ */ forwardRef((pr
12024
12009
  {
12025
12010
  present: forceMount || isSelected
12026
12011
  },
12027
- ({ present }) => /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
12012
+ ({ present }) => /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
12028
12013
  "data-state": isSelected ? "active" : "inactive",
12029
12014
  "data-orientation": context.orientation,
12030
12015
  role: "tabpanel",
@@ -12084,6 +12069,260 @@ const Tabs = Object.assign({}, {
12084
12069
  Trigger: TabsTrigger,
12085
12070
  Content: TabsContent
12086
12071
  });
12072
+ const truthyValues = [true, "true"];
12073
+ const BooleanInput = memo((props) => {
12074
+ const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12075
+ let [{ helpText, label }] = useFormikInput(props);
12076
+ helpText = showInputOnly ? null : helpText;
12077
+ label = showInputOnly ? "" : label;
12078
+ const color = useSeverityColor(severity);
12079
+ const value = truthyValues.includes(fieldProps.value);
12080
+ return /* @__PURE__ */ jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsx(
12081
+ InputWithLabel,
12082
+ {
12083
+ size,
12084
+ severity,
12085
+ inputId,
12086
+ labelId,
12087
+ label,
12088
+ image: showInputOnly ? void 0 : field.image,
12089
+ flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
12090
+ children: /* @__PURE__ */ jsx(
12091
+ Checkbox,
12092
+ {
12093
+ ...rest,
12094
+ ...fieldProps,
12095
+ id: inputId,
12096
+ color,
12097
+ value: value.toString(),
12098
+ checked: value,
12099
+ onCheckedChange: fieldProps.onChange,
12100
+ onChange: void 0,
12101
+ onBlur: void 0
12102
+ }
12103
+ )
12104
+ }
12105
+ ) });
12106
+ });
12107
+ BooleanInput.displayName = "BooleanInput";
12108
+ var DefaultContext = {
12109
+ color: void 0,
12110
+ size: void 0,
12111
+ className: void 0,
12112
+ style: void 0,
12113
+ attr: void 0
12114
+ };
12115
+ var IconContext = React__default.createContext && /* @__PURE__ */ React__default.createContext(DefaultContext);
12116
+ var _excluded = ["attr", "size", "title"];
12117
+ function _objectWithoutProperties(source, excluded) {
12118
+ if (source == null)
12119
+ return {};
12120
+ var target = _objectWithoutPropertiesLoose(source, excluded);
12121
+ var key, i;
12122
+ if (Object.getOwnPropertySymbols) {
12123
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
12124
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
12125
+ key = sourceSymbolKeys[i];
12126
+ if (excluded.indexOf(key) >= 0)
12127
+ continue;
12128
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
12129
+ continue;
12130
+ target[key] = source[key];
12131
+ }
12132
+ }
12133
+ return target;
12134
+ }
12135
+ function _objectWithoutPropertiesLoose(source, excluded) {
12136
+ if (source == null)
12137
+ return {};
12138
+ var target = {};
12139
+ for (var key in source) {
12140
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12141
+ if (excluded.indexOf(key) >= 0)
12142
+ continue;
12143
+ target[key] = source[key];
12144
+ }
12145
+ }
12146
+ return target;
12147
+ }
12148
+ function _extends() {
12149
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
12150
+ for (var i = 1; i < arguments.length; i++) {
12151
+ var source = arguments[i];
12152
+ for (var key in source) {
12153
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12154
+ target[key] = source[key];
12155
+ }
12156
+ }
12157
+ }
12158
+ return target;
12159
+ };
12160
+ return _extends.apply(this, arguments);
12161
+ }
12162
+ function ownKeys(e, r) {
12163
+ var t = Object.keys(e);
12164
+ if (Object.getOwnPropertySymbols) {
12165
+ var o = Object.getOwnPropertySymbols(e);
12166
+ r && (o = o.filter(function(r2) {
12167
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
12168
+ })), t.push.apply(t, o);
12169
+ }
12170
+ return t;
12171
+ }
12172
+ function _objectSpread(e) {
12173
+ for (var r = 1; r < arguments.length; r++) {
12174
+ var t = null != arguments[r] ? arguments[r] : {};
12175
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
12176
+ _defineProperty(e, r2, t[r2]);
12177
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
12178
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
12179
+ });
12180
+ }
12181
+ return e;
12182
+ }
12183
+ function _defineProperty(obj, key, value) {
12184
+ key = _toPropertyKey(key);
12185
+ if (key in obj) {
12186
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
12187
+ } else {
12188
+ obj[key] = value;
12189
+ }
12190
+ return obj;
12191
+ }
12192
+ function _toPropertyKey(t) {
12193
+ var i = _toPrimitive(t, "string");
12194
+ return "symbol" == typeof i ? i : i + "";
12195
+ }
12196
+ function _toPrimitive(t, r) {
12197
+ if ("object" != typeof t || !t)
12198
+ return t;
12199
+ var e = t[Symbol.toPrimitive];
12200
+ if (void 0 !== e) {
12201
+ var i = e.call(t, r || "default");
12202
+ if ("object" != typeof i)
12203
+ return i;
12204
+ throw new TypeError("@@toPrimitive must return a primitive value.");
12205
+ }
12206
+ return ("string" === r ? String : Number)(t);
12207
+ }
12208
+ function Tree2Element(tree) {
12209
+ return tree && tree.map((node, i) => /* @__PURE__ */ React__default.createElement(node.tag, _objectSpread({
12210
+ key: i
12211
+ }, node.attr), Tree2Element(node.child)));
12212
+ }
12213
+ function GenIcon(data) {
12214
+ return (props) => /* @__PURE__ */ React__default.createElement(IconBase, _extends({
12215
+ attr: _objectSpread({}, data.attr)
12216
+ }, props), Tree2Element(data.child));
12217
+ }
12218
+ function IconBase(props) {
12219
+ var elem = (conf) => {
12220
+ var {
12221
+ attr,
12222
+ size,
12223
+ title: title2
12224
+ } = props, svgProps = _objectWithoutProperties(props, _excluded);
12225
+ var computedSize = size || conf.size || "1em";
12226
+ var className;
12227
+ if (conf.className)
12228
+ className = conf.className;
12229
+ if (props.className)
12230
+ className = (className ? className + " " : "") + props.className;
12231
+ return /* @__PURE__ */ React__default.createElement("svg", _extends({
12232
+ stroke: "currentColor",
12233
+ fill: "currentColor",
12234
+ strokeWidth: "0"
12235
+ }, conf.attr, attr, svgProps, {
12236
+ className,
12237
+ style: _objectSpread(_objectSpread({
12238
+ color: props.color || conf.color
12239
+ }, conf.style), props.style),
12240
+ height: computedSize,
12241
+ width: computedSize,
12242
+ xmlns: "http://www.w3.org/2000/svg"
12243
+ }), title2 && /* @__PURE__ */ React__default.createElement("title", null, title2), props.children);
12244
+ };
12245
+ return IconContext !== void 0 ? /* @__PURE__ */ React__default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
12246
+ }
12247
+ function RiArrowDownLine(props) {
12248
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
12249
+ }
12250
+ function RiArrowUpLine(props) {
12251
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
12252
+ }
12253
+ function RiCalendarLine(props) {
12254
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
12255
+ }
12256
+ function RiQrCodeLine(props) {
12257
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
12258
+ }
12259
+ function RiFileCopyLine(props) {
12260
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
12261
+ }
12262
+ function RiAlignJustify(props) {
12263
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
12264
+ }
12265
+ function RiHashtag(props) {
12266
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
12267
+ }
12268
+ function RiInputField(props) {
12269
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
12270
+ }
12271
+ function RiListCheck(props) {
12272
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
12273
+ }
12274
+ function RiImageLine(props) {
12275
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
12276
+ }
12277
+ function RiCheckboxCircleLine(props) {
12278
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
12279
+ }
12280
+ function RiCheckboxLine(props) {
12281
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
12282
+ }
12283
+ function RiDeleteBin2Line(props) {
12284
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
12285
+ }
12286
+ function RiMenuFoldLine(props) {
12287
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
12288
+ }
12289
+ function RiUpload2Line(props) {
12290
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
12291
+ }
12292
+ const emptyBooleanField = {
12293
+ ...emptyBaseField,
12294
+ type: "boolean"
12295
+ };
12296
+ const _BooleanField = class _BooleanField extends BaseField {
12297
+ constructor(options) {
12298
+ super({ ...options, type: "boolean" });
12299
+ __publicField(this, "onlyValidateAfterTouched", false);
12300
+ }
12301
+ // if a BooleanField is required, `false` is considered blank
12302
+ isBlank(value) {
12303
+ return this.required && !value;
12304
+ }
12305
+ getValueFromChangeEvent(event) {
12306
+ if (typeof event === "boolean")
12307
+ return event;
12308
+ return event.target.checked;
12309
+ }
12310
+ serialize() {
12311
+ return super._serialize();
12312
+ }
12313
+ static deserialize(data) {
12314
+ if (data.type !== "boolean")
12315
+ throw new Error("Type mismatch.");
12316
+ return new _BooleanField(data);
12317
+ }
12318
+ getInput(props) {
12319
+ return /* @__PURE__ */ jsx(BooleanInput, { ...props, field: this });
12320
+ }
12321
+ };
12322
+ __publicField(_BooleanField, "fieldTypeName", "Checkbox");
12323
+ __publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
12324
+ __publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
12325
+ let BooleanField = _BooleanField;
12087
12326
  const NumberInput = memo((props) => {
12088
12327
  const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12089
12328
  let [{ helpText, label }] = useFormikInput(props);
@@ -13189,7 +13428,7 @@ const QrInput = memo((props) => {
13189
13428
  ] }),
13190
13429
  value && /* @__PURE__ */ jsx(Text, { color: "jade", size: "1", children: /* @__PURE__ */ jsx(RiIcon, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
13191
13430
  ] }),
13192
- value && /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
13431
+ !!value && /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
13193
13432
  /* @__PURE__ */ jsx(Code, { color: "gray", highContrast: true, children: value }),
13194
13433
  /* @__PURE__ */ jsx(
13195
13434
  IconButton,
@@ -13229,9 +13468,7 @@ const QrScanner = memo((props) => {
13229
13468
  }
13230
13469
  );
13231
13470
  setIsScannerLoading(true);
13232
- qrScanner.start().then(() => {
13233
- setIsScannerLoading(false);
13234
- }).catch(() => {
13471
+ void qrScanner.start().finally(() => {
13235
13472
  setIsScannerLoading(false);
13236
13473
  });
13237
13474
  }, [onQrScan]);
@@ -14986,9 +15223,9 @@ const FormBrowser = memo(
14986
15223
  }, [filter, maxResults, ownerFilter]);
14987
15224
  const userForms = useAppSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
14988
15225
  const userFormMapping = useAppSelector(selectFormMapping);
14989
- const attachableUserForms = userForms.filter((form) => !form.component_type && !form.issue_type);
15226
+ const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
14990
15227
  const attachableUserFormMapping = Object.values(userFormMapping).filter(
14991
- (form) => !form.component_type
15228
+ (form) => !form.asset_type
14992
15229
  );
14993
15230
  const handleToggleFavorite = useCallback(
14994
15231
  (form) => {
@@ -15629,7 +15866,7 @@ const FieldBuilder = memo((props) => {
15629
15866
  {
15630
15867
  name: `${parentPath}.${index2}.required`,
15631
15868
  render: ({ setValue, value }) => /* @__PURE__ */ jsx(
15632
- Checkbox,
15869
+ Checkbox$1,
15633
15870
  {
15634
15871
  checked: value,
15635
15872
  onCheckedChange: setValue,
@@ -16393,6 +16630,13 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
16393
16630
  export {
16394
16631
  APIError,
16395
16632
  AgentService,
16633
+ AssetAttachmentService,
16634
+ AssetService,
16635
+ AssetStageColors,
16636
+ AssetStageCompletionService,
16637
+ AssetStageService,
16638
+ AssetTypeAttachmentService,
16639
+ AssetTypeService,
16396
16640
  AttachmentModel,
16397
16641
  AuthService,
16398
16642
  BaseApiService,
@@ -16404,13 +16648,6 @@ export {
16404
16648
  ColorPicker,
16405
16649
  Colors,
16406
16650
  ColorsToString,
16407
- ComponentAttachmentService,
16408
- ComponentService,
16409
- ComponentStageColors,
16410
- ComponentStageCompletionService,
16411
- ComponentStageService,
16412
- ComponentTypeAttachmentService,
16413
- ComponentTypeService,
16414
16651
  DEFAULT_ISSUE_PRIORITY,
16415
16652
  DEFAULT_ISSUE_STATUS,
16416
16653
  DateField,
@@ -16502,14 +16739,15 @@ export {
16502
16739
  acceptProjectInvite,
16503
16740
  addActiveProjectFormSubmissionsCount,
16504
16741
  addActiveProjectIssuesCount,
16742
+ addAsset,
16743
+ addAssetAttachment,
16744
+ addAssetAttachments,
16745
+ addAssetType,
16746
+ addAssetTypeAttachment,
16747
+ addAssetTypeAttachments,
16748
+ addAssetsInBatches,
16505
16749
  addCategory,
16506
- addComponent,
16507
- addComponentAttachment,
16508
- addComponentAttachments,
16509
- addComponentType,
16510
- addComponentTypeAttachment,
16511
- addComponentTypeAttachments,
16512
- addComponentsInBatches,
16750
+ addConversation,
16513
16751
  addDocumentAttachment,
16514
16752
  addDocumentAttachments,
16515
16753
  addDocuments,
@@ -16550,7 +16788,17 @@ export {
16550
16788
  addToRecentIssues,
16551
16789
  addUsers,
16552
16790
  addWorkspace,
16791
+ agentsReducer,
16792
+ agentsSlice,
16553
16793
  areArraysEqual,
16794
+ assetReducer,
16795
+ assetSlice,
16796
+ assetStageCompletionReducer,
16797
+ assetStageCompletionSlice,
16798
+ assetStageReducer,
16799
+ assetStageSlice,
16800
+ assetTypeReducer,
16801
+ assetTypeSlice,
16554
16802
  authReducer,
16555
16803
  authSlice,
16556
16804
  blobToBase64,
@@ -16560,14 +16808,6 @@ export {
16560
16808
  classNames$1 as classNames,
16561
16809
  cleanRecentIssues,
16562
16810
  clearTokens,
16563
- componentReducer,
16564
- componentSlice,
16565
- componentStageCompletionReducer,
16566
- componentStageCompletionSlice,
16567
- componentStageReducer,
16568
- componentStageSlice,
16569
- componentTypeReducer,
16570
- componentTypeSlice,
16571
16811
  constructUploadedFilePayloads,
16572
16812
  coordinatesAreEqual,
16573
16813
  coordinatesToLiteral,
@@ -16578,7 +16818,7 @@ export {
16578
16818
  createPointMarker,
16579
16819
  defaultBadgeColor,
16580
16820
  defaultStore,
16581
- deleteComponentType,
16821
+ deleteAssetType,
16582
16822
  deleteForm,
16583
16823
  deleteFormRevision,
16584
16824
  deleteFormRevisionAttachment,
@@ -16627,7 +16867,7 @@ export {
16627
16867
  formSubmissionReducer,
16628
16868
  formSubmissionSlice,
16629
16869
  index as forms,
16630
- fullComponentMarkerSize,
16870
+ fullAssetMarkerSize,
16631
16871
  generateBadgeColors,
16632
16872
  genericMemo,
16633
16873
  getFileIdentifier,
@@ -16687,15 +16927,15 @@ export {
16687
16927
  projectSlice,
16688
16928
  rehydratedReducer,
16689
16929
  rehydratedSlice,
16690
- removeAllComponentsOfType,
16930
+ removeAllAssetsOfType,
16931
+ removeAsset,
16932
+ removeAssetAttachment,
16933
+ removeAssetAttachments,
16934
+ removeAssetTypeAttachment,
16935
+ removeAssetTypeAttachments,
16691
16936
  removeAttachmentsOfIssue,
16692
16937
  removeCategory,
16693
16938
  removeColor,
16694
- removeComponent,
16695
- removeComponentAttachment,
16696
- removeComponentAttachments,
16697
- removeComponentTypeAttachment,
16698
- removeComponentTypeAttachments,
16699
16939
  removeDocumentAttachment,
16700
16940
  removeDocumentAttachments,
16701
16941
  removeDocuments,
@@ -16746,16 +16986,31 @@ export {
16746
16986
  selectActiveWorkspace,
16747
16987
  selectActiveWorkspaceId,
16748
16988
  selectAllAttachments,
16749
- selectAllComponentAttachments,
16750
- selectAllComponentTypeAttachments,
16751
16989
  selectAllDocumentAttachments,
16752
16990
  selectAllProjectAttachments,
16753
16991
  selectAncestorIdsOfDocument,
16754
16992
  selectAppearance,
16755
- selectAttachmentsOfComponent,
16756
- selectAttachmentsOfComponentByType,
16757
- selectAttachmentsOfComponentType,
16758
- selectAttachmentsOfComponentTypeByType,
16993
+ selectAsset,
16994
+ selectAssetAttachment,
16995
+ selectAssetAttachmentMapping,
16996
+ selectAssetAttachments,
16997
+ selectAssetToAssetTypeMapping,
16998
+ selectAssetType,
16999
+ selectAssetTypeAttachment,
17000
+ selectAssetTypeAttachmentMapping,
17001
+ selectAssetTypeAttachments,
17002
+ selectAssetTypeStagesMapping,
17003
+ selectAssetTypes,
17004
+ selectAssetTypesByName,
17005
+ selectAssetTypesFromIds,
17006
+ selectAssetTypesMapping,
17007
+ selectAssets,
17008
+ selectAssetsMapping,
17009
+ selectAssetsOfAssetType,
17010
+ selectAttachmentsOfAsset,
17011
+ selectAttachmentsOfAssetType,
17012
+ selectAttachmentsOfAssetTypeByType,
17013
+ selectAttachmentsOfAssetsByType,
16759
17014
  selectAttachmentsOfDocument,
16760
17015
  selectAttachmentsOfDocumentByType,
16761
17016
  selectAttachmentsOfFormRevision,
@@ -16772,25 +17027,11 @@ export {
16772
17027
  selectCenterMapToProject,
16773
17028
  selectCommentMapping,
16774
17029
  selectCommentsOfIssue,
16775
- selectCompletedStageIdsForComponent,
17030
+ selectCompletedStageIdsForAsset,
16776
17031
  selectCompletedStages,
16777
- selectComponent,
16778
- selectComponentAttachment,
16779
- selectComponentAttachmentMapping,
16780
- selectComponentType,
16781
- selectComponentTypeAttachment,
16782
- selectComponentTypeAttachmentMapping,
16783
- selectComponentTypeFromComponent,
16784
- selectComponentTypeFromComponents,
16785
- selectComponentTypeStagesMapping,
16786
- selectComponentTypes,
16787
- selectComponentTypesByName,
16788
- selectComponentTypesFromIds,
16789
- selectComponentTypesMapping,
16790
- selectComponents,
16791
- selectComponentsByType,
16792
- selectComponentsFromComponentType,
16793
- selectComponentsMapping,
17032
+ selectConversation,
17033
+ selectConversationMapping,
17034
+ selectConversations,
16794
17035
  selectCreateProjectType,
16795
17036
  selectCurrentUser,
16796
17037
  selectDeletedRequests,
@@ -16812,7 +17053,7 @@ export {
16812
17053
  selectFilteredForms,
16813
17054
  selectForm,
16814
17055
  selectFormMapping,
16815
- selectFormOfComponentType,
17056
+ selectFormOfAssetType,
16816
17057
  selectFormOfIssueType,
16817
17058
  selectFormRevision,
16818
17059
  selectFormRevisionMapping,
@@ -16821,16 +17062,16 @@ export {
16821
17062
  selectFormSubmission,
16822
17063
  selectFormSubmissionAttachmentsMapping,
16823
17064
  selectFormSubmissions,
16824
- selectFormSubmissionsByComponents,
17065
+ selectFormSubmissionsByAssets,
16825
17066
  selectFormSubmissionsByFormRevisions,
16826
17067
  selectFormSubmissionsMapping,
16827
- selectFormSubmissionsOfComponent,
17068
+ selectFormSubmissionsOfAsset,
16828
17069
  selectFormSubmissionsOfForm,
16829
17070
  selectFormSubmissionsOfIssue,
16830
17071
  selectFormsCount,
16831
17072
  selectGeneralFormCount,
17073
+ selectHiddenAssetTypeIds,
16832
17074
  selectHiddenCategoryCount,
16833
- selectHiddenComponentTypeIds,
16834
17075
  selectIsFetchingInitialData,
16835
17076
  selectIsImportingProjectFile,
16836
17077
  selectIsLoading,
@@ -16852,7 +17093,7 @@ export {
16852
17093
  selectIssuesOfIssueTypeCount,
16853
17094
  selectLatestFormRevisionByForm,
16854
17095
  selectLatestFormRevisionOfForm,
16855
- selectLatestFormRevisionsOfComponentTypes,
17096
+ selectLatestFormRevisionsOfAssetTypes,
16856
17097
  selectLatestRetryTime,
16857
17098
  selectLicense,
16858
17099
  selectLicenseForProject,
@@ -16860,8 +17101,8 @@ export {
16860
17101
  selectLicensesForProjectsMapping,
16861
17102
  selectMainWorkspace,
16862
17103
  selectMapStyle,
16863
- selectNumberOfComponentTypesMatchingCaseInsensitiveName,
16864
- selectNumberOfComponentsOfComponentType,
17104
+ selectNumberOfAssetTypesMatchingCaseInsensitiveName,
17105
+ selectNumberOfAssetsOfAssetType,
16865
17106
  selectOrganization,
16866
17107
  selectOrganizationAccess,
16867
17108
  selectOrganizationAccessForUser,
@@ -16902,9 +17143,9 @@ export {
16902
17143
  selectStageFormIdsFromStageIds,
16903
17144
  selectStageMapping,
16904
17145
  selectStages,
16905
- selectStagesFromComponentType,
16906
- selectStagesFromComponentTypeIds,
17146
+ selectStagesFromAssetTypeIds,
16907
17147
  selectStagesFromStageIds,
17148
+ selectStagesOfAssetType,
16908
17149
  selectTeam,
16909
17150
  selectTeams,
16910
17151
  selectTeamsMapping,
@@ -16926,14 +17167,16 @@ export {
16926
17167
  setActiveProjectId,
16927
17168
  setActiveWorkspaceId,
16928
17169
  setAppearance,
17170
+ setAssetAttachment,
17171
+ setAssetAttachments,
17172
+ setAssetTypeAttachment,
17173
+ setAssetTypeAttachments,
17174
+ setAssetTypes,
17175
+ setAssets,
16929
17176
  setCategories,
16930
17177
  setCenterMapToProject,
16931
- setComponentAttachment,
16932
- setComponentAttachments,
16933
- setComponentTypeAttachment,
16934
- setComponentTypeAttachments,
16935
- setComponentTypes,
16936
- setComponents,
17178
+ setConversation,
17179
+ setConversations,
16937
17180
  setCreateProjectType,
16938
17181
  setCurrentUser,
16939
17182
  setDocumentAttachment,
@@ -16994,18 +17237,19 @@ export {
16994
17237
  teamSlice,
16995
17238
  toFileNameSafeString,
16996
17239
  toOfflineIdRecord,
16997
- toggleComponentTypeVisibility,
17240
+ toggleAssetTypeVisibility,
16998
17241
  truncate,
16999
17242
  unfavoriteForm,
17000
17243
  unhideAllCategories,
17001
17244
  unhideCategory,
17002
17245
  unlinkStageToForm,
17003
17246
  updateActiveOrganization,
17004
- updateComponent,
17005
- updateComponentAttachment,
17006
- updateComponentAttachments,
17007
- updateComponentTypeAttachment,
17008
- updateComponentTypeAttachments,
17247
+ updateAsset,
17248
+ updateAssetAttachment,
17249
+ updateAssetAttachments,
17250
+ updateAssetTypeAttachment,
17251
+ updateAssetTypeAttachments,
17252
+ updateConversation,
17009
17253
  updateDocumentAttachment,
17010
17254
  updateDocumentAttachments,
17011
17255
  updateDocuments,