@overmap-ai/core 1.0.60-forms-removal.9 → 1.0.60-forms-refactor-1.1

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 (39) hide show
  1. package/dist/overmap-core.js +487 -509
  2. package/dist/overmap-core.js.map +1 -1
  3. package/dist/overmap-core.umd.cjs +487 -509
  4. package/dist/overmap-core.umd.cjs.map +1 -1
  5. package/dist/sdk/services/BaseAttachmentService.d.ts +8 -4
  6. package/dist/sdk/services/BaseUploadService.d.ts +8 -0
  7. package/dist/sdk/services/FormService.d.ts +18 -0
  8. package/dist/sdk/services/FormSubmissionService.d.ts +24 -0
  9. package/dist/sdk/services/GeoImageService.d.ts +11 -0
  10. package/dist/sdk/services/IssueService.d.ts +1 -1
  11. package/dist/sdk/services/index.d.ts +3 -2
  12. package/dist/sdk/typings.d.ts +3 -2
  13. package/dist/store/slices/assetTypeSlice.d.ts +2 -8
  14. package/dist/store/slices/categorySlice.d.ts +11 -25
  15. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +21 -21
  16. package/dist/store/slices/formRevisionSlice.d.ts +21 -21
  17. package/dist/store/slices/formSlice.d.ts +20 -20
  18. package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +20 -20
  19. package/dist/store/slices/formSubmissionSlice.d.ts +26 -26
  20. package/dist/store/slices/geoImageSlice.d.ts +48 -0
  21. package/dist/store/slices/index.d.ts +1 -0
  22. package/dist/store/slices/issueSlice.d.ts +2 -12
  23. package/dist/store/slices/organizationSlice.d.ts +6 -17
  24. package/dist/store/slices/projectFileSlice.d.ts +4 -15
  25. package/dist/store/slices/projectSlice.d.ts +1 -4
  26. package/dist/store/slices/workspaceSlice.d.ts +5 -10
  27. package/dist/store/store.d.ts +2 -1
  28. package/dist/typings/models/assets.d.ts +1 -1
  29. package/dist/typings/models/forms.d.ts +11 -11
  30. package/dist/typings/models/geo.d.ts +2 -1
  31. package/dist/typings/models/geoImages.d.ts +14 -0
  32. package/dist/typings/models/index.d.ts +1 -0
  33. package/dist/typings/models/issues.d.ts +3 -3
  34. package/dist/typings/models/store.d.ts +2 -2
  35. package/dist/utils/coordinates.d.ts +2 -1
  36. package/dist/utils/forms.d.ts +2 -2
  37. package/package.json +1 -1
  38. package/dist/sdk/services/UserFormService.d.ts +0 -18
  39. package/dist/sdk/services/UserFormSubmissionService.d.ts +0 -25
@@ -367,15 +367,15 @@ var __publicField = (obj, key, value) => {
367
367
  };
368
368
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
369
369
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
370
- const initialState$A = {
370
+ const initialState$B = {
371
371
  accessToken: "",
372
372
  refreshToken: "",
373
373
  isLoggedIn: false
374
374
  };
375
375
  const authSlice = toolkit.createSlice({
376
376
  name: "auth",
377
- initialState: initialState$A,
378
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
377
+ initialState: initialState$B,
378
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$B)),
379
379
  reducers: {
380
380
  setTokens: (state, action) => {
381
381
  state.accessToken = action.payload.accessToken;
@@ -406,6 +406,9 @@ var __publicField = (obj, key, value) => {
406
406
  const flipCoordinates = (coordinates) => {
407
407
  return [coordinates[1], coordinates[0]];
408
408
  };
409
+ const flipBounds = (bounds) => {
410
+ return [flipCoordinates(bounds[0]), flipCoordinates(bounds[1])];
411
+ };
409
412
  function offsetPositionByMeters(originalPosition, latMeters, lngMeters) {
410
413
  const { lat, lng } = originalPosition;
411
414
  const earthRadius = 6378137;
@@ -842,72 +845,23 @@ var __publicField = (obj, key, value) => {
842
845
  };
843
846
  }
844
847
  const categoryAdapter = createModelAdapter((category) => category.offline_id);
845
- const initialState$z = categoryAdapter.getInitialState({
846
- categoryVisibility: {
847
- hiddenCategoryIds: [],
848
- isNullCategoryHidden: false
849
- }
850
- });
848
+ const initialState$A = categoryAdapter.getInitialState({});
851
849
  const categorySlice = toolkit.createSlice({
852
850
  name: "categories",
853
- initialState: initialState$z,
854
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
851
+ initialState: initialState$A,
852
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$A)),
855
853
  reducers: {
856
- initializeCategories: (state, action) => {
857
- categoryAdapter.initialize(state, action);
858
- state.categoryVisibility.hiddenCategoryIds = state.categoryVisibility.hiddenCategoryIds.filter(
859
- (categoryId) => action.payload.some((category) => category.offline_id === categoryId)
860
- );
861
- },
854
+ initializeCategories: categoryAdapter.initialize,
862
855
  addCategory: categoryAdapter.addOne,
863
856
  updateCategory: categoryAdapter.updateOne,
864
- deleteCategory: categoryAdapter.deleteOne,
865
- // Pass in a null value to hide the "No category" category
866
- hideCategory: (state, action) => {
867
- const categoryId = action.payload;
868
- if (categoryId === null) {
869
- state.categoryVisibility.isNullCategoryHidden = true;
870
- } else if (!(categoryId in state.categoryVisibility.hiddenCategoryIds)) {
871
- state.categoryVisibility.hiddenCategoryIds.push(categoryId);
872
- }
873
- },
874
- hideAllCategories: (state) => {
875
- state.categoryVisibility.hiddenCategoryIds = Object.keys(state.instances);
876
- state.categoryVisibility.isNullCategoryHidden = true;
877
- },
878
- // Pass in a null value to unhide the "No category" category
879
- unhideCategory: (state, action) => {
880
- const categoryId = action.payload;
881
- if (categoryId === null) {
882
- state.categoryVisibility.isNullCategoryHidden = false;
883
- } else {
884
- state.categoryVisibility.hiddenCategoryIds = state.categoryVisibility.hiddenCategoryIds.filter(
885
- (id) => id !== categoryId
886
- );
887
- }
888
- },
889
- unhideAllCategories: (state) => {
890
- state.categoryVisibility.hiddenCategoryIds = [];
891
- state.categoryVisibility.isNullCategoryHidden = false;
892
- }
857
+ deleteCategory: categoryAdapter.deleteOne
893
858
  }
894
859
  });
895
- const {
896
- initializeCategories,
897
- addCategory,
898
- updateCategory,
899
- deleteCategory,
900
- hideCategory,
901
- hideAllCategories,
902
- unhideCategory,
903
- unhideAllCategories
904
- } = categorySlice.actions;
860
+ const { initializeCategories, addCategory, updateCategory, deleteCategory } = categorySlice.actions;
905
861
  const selectCategoryMapping = (state) => state.categoryReducer.instances;
906
- const _selectActiveWorkspaceId = (state) => state.workspaceReducer.activeWorkspaceId;
907
- const selectCategories = toolkit.createSelector(
908
- [selectCategoryMapping, _selectActiveWorkspaceId],
909
- (mapping, activeWorkspaceId) => activeWorkspaceId ? Object.values(mapping).filter((category) => category.workspace === activeWorkspaceId) : []
910
- );
862
+ const selectCategories = toolkit.createSelector([selectCategoryMapping], (categoryMapping) => {
863
+ return Object.values(categoryMapping);
864
+ });
911
865
  const selectCategoriesOfWorkspace = restructureCreateSelectorWithArgs(
912
866
  toolkit.createSelector(
913
867
  [selectCategories, (_state, workspaceId) => workspaceId],
@@ -920,36 +874,23 @@ var __publicField = (obj, key, value) => {
920
874
  (mapping, categoryId) => mapping[categoryId]
921
875
  )
922
876
  );
923
- const selectCategoryVisibility = (state) => state.categoryReducer.categoryVisibility;
924
- const selectHiddenCategoryCount = (state) => {
925
- const { hiddenCategoryIds, isNullCategoryHidden } = state.categoryReducer.categoryVisibility;
926
- let hiddenCategoryCount = hiddenCategoryIds.length;
927
- if (isNullCategoryHidden)
928
- hiddenCategoryCount++;
929
- return hiddenCategoryCount;
930
- };
931
877
  const selectIssueCountOfCategory = (categoryId) => (state) => {
932
878
  return Object.values(state.issueReducer.instances).filter((issue) => issue.category === categoryId).length;
933
879
  };
934
880
  const categoryReducer = categorySlice.reducer;
935
881
  const assetTypeAdapter = createModelAdapter((assetType) => assetType.offline_id);
936
- const initialState$y = assetTypeAdapter.getInitialState({
937
- hiddenAssetTypeIds: {}
938
- });
882
+ const initialState$z = assetTypeAdapter.getInitialState({});
939
883
  const assetTypeSlice = toolkit.createSlice({
940
884
  name: "assetTypes",
941
- initialState: initialState$y,
942
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
885
+ initialState: initialState$z,
886
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$z)),
943
887
  reducers: {
944
888
  initializeAssetTypes: assetTypeAdapter.initialize,
945
889
  addAssetType: assetTypeAdapter.addOne,
946
- deleteAssetType: assetTypeAdapter.deleteOne,
947
- toggleAssetTypeVisibility: (state, action) => {
948
- state.hiddenAssetTypeIds[action.payload] = !state.hiddenAssetTypeIds[action.payload];
949
- }
890
+ deleteAssetType: assetTypeAdapter.deleteOne
950
891
  }
951
892
  });
952
- const { addAssetType, initializeAssetTypes, deleteAssetType, toggleAssetTypeVisibility } = assetTypeSlice.actions;
893
+ const { addAssetType, initializeAssetTypes, deleteAssetType } = assetTypeSlice.actions;
953
894
  const selectAssetTypesMapping = (state) => state.assetTypeReducer.instances;
954
895
  const selectAssetTypes = toolkit.createSelector(
955
896
  [selectAssetTypesMapping],
@@ -985,14 +926,13 @@ var __publicField = (obj, key, value) => {
985
926
  });
986
927
  })
987
928
  );
988
- const selectHiddenAssetTypeIds = (state) => state.assetTypeReducer.hiddenAssetTypeIds;
989
929
  const assetTypeReducer = assetTypeSlice.reducer;
990
930
  const assetAdapter = createModelAdapter((asset) => asset.offline_id);
991
- const initialState$x = assetAdapter.getInitialState({});
931
+ const initialState$y = assetAdapter.getInitialState({});
992
932
  const assetSlice = toolkit.createSlice({
993
933
  name: "assets",
994
- initialState: initialState$x,
995
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
934
+ initialState: initialState$y,
935
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$y)),
996
936
  reducers: {
997
937
  initializeAssets: (state, action) => {
998
938
  assetAdapter.initialize(state, action);
@@ -1095,11 +1035,11 @@ var __publicField = (obj, key, value) => {
1095
1035
  };
1096
1036
  const assetReducer = assetSlice.reducer;
1097
1037
  const assetAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
1098
- const initialState$w = assetAttachmentAdapter.getInitialState({});
1038
+ const initialState$x = assetAttachmentAdapter.getInitialState({});
1099
1039
  const assetAttachmentSlice = toolkit.createSlice({
1100
1040
  name: "assetAttachments",
1101
- initialState: initialState$w,
1102
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
1041
+ initialState: initialState$x,
1042
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
1103
1043
  reducers: {
1104
1044
  initializeAssetAttachments: assetAttachmentAdapter.initialize,
1105
1045
  addAssetAttachment: assetAttachmentAdapter.addOne,
@@ -1157,13 +1097,13 @@ var __publicField = (obj, key, value) => {
1157
1097
  )
1158
1098
  );
1159
1099
  const assetAttachmentReducer = assetAttachmentSlice.reducer;
1160
- const initialState$v = {
1100
+ const initialState$w = {
1161
1101
  completionsByAssetId: {}
1162
1102
  };
1163
1103
  const assetStageCompletionSlice = toolkit.createSlice({
1164
1104
  name: "assetStageCompletions",
1165
- initialState: initialState$v,
1166
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
1105
+ initialState: initialState$w,
1106
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$w)),
1167
1107
  reducers: {
1168
1108
  addStageCompletion: (state, action) => {
1169
1109
  let stageToCompletionDateMapping = state.completionsByAssetId[action.payload.asset];
@@ -1215,11 +1155,11 @@ var __publicField = (obj, key, value) => {
1215
1155
  );
1216
1156
  const assetStageCompletionReducer = assetStageCompletionSlice.reducer;
1217
1157
  const assetStageAdapter = createModelAdapter((assetStage) => assetStage.offline_id);
1218
- const initialState$u = assetStageAdapter.getInitialState({});
1158
+ const initialState$v = assetStageAdapter.getInitialState({});
1219
1159
  const assetStageSlice = toolkit.createSlice({
1220
1160
  name: "assetStages",
1221
- initialState: initialState$u,
1222
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
1161
+ initialState: initialState$v,
1162
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$v)),
1223
1163
  reducers: {
1224
1164
  initializeStages: assetStageAdapter.initialize,
1225
1165
  setStage: assetStageAdapter.setOne,
@@ -1288,8 +1228,8 @@ var __publicField = (obj, key, value) => {
1288
1228
  if (!stage) {
1289
1229
  throw new Error("No stage exists with the id " + stageId);
1290
1230
  }
1291
- if (stage.user_form) {
1292
- ret[stageId] = stage.user_form;
1231
+ if (stage.form) {
1232
+ ret[stageId] = stage.form;
1293
1233
  }
1294
1234
  }
1295
1235
  return ret;
@@ -1300,11 +1240,11 @@ var __publicField = (obj, key, value) => {
1300
1240
  const assetTypeAttachmentAdapter = createModelAdapter(
1301
1241
  (attachment) => attachment.offline_id
1302
1242
  );
1303
- const initialState$t = assetTypeAttachmentAdapter.getInitialState({});
1243
+ const initialState$u = assetTypeAttachmentAdapter.getInitialState({});
1304
1244
  const assetTypeAttachmentSlice = toolkit.createSlice({
1305
1245
  name: "assetTypeAttachments",
1306
- initialState: initialState$t,
1307
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$t)),
1246
+ initialState: initialState$u,
1247
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$u)),
1308
1248
  reducers: {
1309
1249
  initializeAssetTypeAttachments: assetTypeAttachmentAdapter.initialize,
1310
1250
  addAssetTypeAttachment: assetTypeAttachmentAdapter.addOne,
@@ -1363,31 +1303,19 @@ var __publicField = (obj, key, value) => {
1363
1303
  );
1364
1304
  const assetTypeAttachmentReducer = assetTypeAttachmentSlice.reducer;
1365
1305
  const workspaceAdapter = createModelAdapter((workspace) => workspace.offline_id);
1366
- const initialState$s = workspaceAdapter.getInitialState({
1367
- activeWorkspaceId: null
1368
- });
1306
+ const initialState$t = workspaceAdapter.getInitialState({});
1369
1307
  const workspaceSlice = toolkit.createSlice({
1370
1308
  name: "workspace",
1371
- initialState: initialState$s,
1309
+ initialState: initialState$t,
1372
1310
  reducers: {
1373
1311
  initializeWorkspaces: workspaceAdapter.initialize,
1374
1312
  setWorkspaces: workspaceAdapter.setMany,
1375
1313
  addWorkspace: workspaceAdapter.addOne,
1376
1314
  updateWorkspace: workspaceAdapter.updateOne,
1377
- deleteWorkspace: workspaceAdapter.deleteOne,
1378
- setActiveWorkspaceId: (state, action) => {
1379
- state.activeWorkspaceId = action.payload;
1380
- }
1315
+ deleteWorkspace: workspaceAdapter.deleteOne
1381
1316
  }
1382
1317
  });
1383
- const {
1384
- initializeWorkspaces,
1385
- setWorkspaces,
1386
- addWorkspace,
1387
- updateWorkspace,
1388
- setActiveWorkspaceId,
1389
- deleteWorkspace
1390
- } = workspaceSlice.actions;
1318
+ const { initializeWorkspaces, setWorkspaces, addWorkspace, updateWorkspace, deleteWorkspace } = workspaceSlice.actions;
1391
1319
  const selectWorkspaceMapping = (state) => state.workspaceReducer.instances;
1392
1320
  const selectWorkspaces = toolkit.createSelector([selectWorkspaceMapping], (mapping) => Object.values(mapping));
1393
1321
  const selectMainWorkspace = toolkit.createSelector(
@@ -1396,20 +1324,9 @@ var __publicField = (obj, key, value) => {
1396
1324
  return workspaces.find((workspace) => workspace.name.toLowerCase() === "main");
1397
1325
  }
1398
1326
  );
1399
- const selectWorkspace = restructureCreateSelectorWithArgs(
1400
- toolkit.createSelector([selectWorkspaceMapping, (_state, workspaceId) => workspaceId], (mapping, workspaceId) => {
1401
- return mapping[workspaceId];
1402
- })
1403
- );
1404
- const selectActiveWorkspaceId = (state) => state.workspaceReducer.activeWorkspaceId;
1405
- const selectActiveWorkspace = toolkit.createSelector(
1406
- [selectWorkspaceMapping, selectActiveWorkspaceId],
1407
- (mapping, activeWorkspaceId) => {
1408
- if (!activeWorkspaceId)
1409
- return null;
1410
- return mapping[activeWorkspaceId];
1411
- }
1412
- );
1327
+ const selectWorkspaceById = (workspaceId) => (state) => {
1328
+ return state.workspaceReducer.instances[workspaceId];
1329
+ };
1413
1330
  const selectPermittedWorkspaceIds = toolkit.createSelector(
1414
1331
  [selectWorkspaceMapping],
1415
1332
  (mapping) => {
@@ -1421,16 +1338,14 @@ var __publicField = (obj, key, value) => {
1421
1338
  const workspaceReducer = workspaceSlice.reducer;
1422
1339
  const maxRecentIssues = 10;
1423
1340
  const issueAdapter = createModelAdapter((issue) => issue.offline_id);
1424
- const initialState$r = issueAdapter.getInitialState({
1425
- visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
1426
- visibleUserIds: null,
1341
+ const initialState$s = issueAdapter.getInitialState({
1427
1342
  recentIssueIds: []
1428
1343
  });
1429
1344
  const issueSlice = toolkit.createSlice({
1430
1345
  name: "issues",
1431
- initialState: initialState$r,
1346
+ initialState: initialState$s,
1432
1347
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
1433
- Object.assign(state, initialState$r);
1348
+ Object.assign(state, initialState$s);
1434
1349
  }),
1435
1350
  reducers: {
1436
1351
  initializeIssues: issueAdapter.initialize,
@@ -1439,12 +1354,6 @@ var __publicField = (obj, key, value) => {
1439
1354
  updateIssue: issueAdapter.updateOne,
1440
1355
  deleteIssue: issueAdapter.deleteOne,
1441
1356
  deleteIssues: issueAdapter.deleteMany,
1442
- setVisibleStatuses: (state, action) => {
1443
- state.visibleStatuses = action.payload;
1444
- },
1445
- setVisibleUserIds: (state, action) => {
1446
- state.visibleUserIds = [...new Set(action.payload)];
1447
- },
1448
1357
  cleanRecentIssues: (state) => {
1449
1358
  state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.instances[recentIssue.offlineId]);
1450
1359
  },
@@ -1477,8 +1386,6 @@ var __publicField = (obj, key, value) => {
1477
1386
  updateIssue,
1478
1387
  deleteIssue,
1479
1388
  deleteIssues,
1480
- setVisibleStatuses,
1481
- setVisibleUserIds,
1482
1389
  addToRecentIssues,
1483
1390
  cleanRecentIssues,
1484
1391
  removeRecentIssue,
@@ -1486,51 +1393,6 @@ var __publicField = (obj, key, value) => {
1486
1393
  } = issueSlice.actions;
1487
1394
  const selectIssueMapping = (state) => state.issueReducer.instances;
1488
1395
  const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
1489
- const selectVisibleUserIds = (state) => state.issueReducer.visibleUserIds;
1490
- const selectVisibleStatuses = (state) => state.issueReducer.visibleStatuses;
1491
- const selectIssues = restructureCreateSelectorWithArgs(
1492
- toolkit.createSelector(
1493
- [
1494
- selectIssueMapping,
1495
- selectVisibleUserIds,
1496
- selectVisibleStatuses,
1497
- selectCategoryVisibility,
1498
- selectActiveWorkspaceId,
1499
- (_state, args) => args
1500
- ],
1501
- (mapping, visibleUserIds, visibleStatuses, categoryVisibility, activeWorkspaceId, args) => {
1502
- let ret = Object.values(mapping);
1503
- const visibleUserIdsSet = new Set(visibleUserIds);
1504
- const visibleStatusesSet = new Set(visibleStatuses);
1505
- if (args.filterByAssignedTo && (visibleUserIds == null ? void 0 : visibleUserIds.length)) {
1506
- ret = ret.filter((issue) => {
1507
- return visibleUserIdsSet.has(issue.assigned_to || null);
1508
- });
1509
- }
1510
- if (args.filterByStatus) {
1511
- ret = ret.filter((issue) => {
1512
- return visibleStatusesSet.has(issue.status);
1513
- });
1514
- }
1515
- if (args.filterByCategory) {
1516
- const isNullCategoryHidden = categoryVisibility.isNullCategoryHidden;
1517
- const hiddenCategoryIds = categoryVisibility.hiddenCategoryIds;
1518
- ret = ret.filter((issue) => {
1519
- if (!issue.category) {
1520
- return !isNullCategoryHidden;
1521
- }
1522
- return !hiddenCategoryIds.includes(issue.category);
1523
- });
1524
- if (args.filterByWorkspace) {
1525
- ret = ret.filter((issue) => {
1526
- return activeWorkspaceId && issue.visible_in_workspaces.includes(activeWorkspaceId);
1527
- });
1528
- }
1529
- }
1530
- return ret;
1531
- }
1532
- )
1533
- );
1534
1396
  const selectIssue = restructureCreateSelectorWithArgs(
1535
1397
  toolkit.createSelector([selectIssueMapping, (_state, id) => id], (mapping, id) => {
1536
1398
  return mapping[id];
@@ -1627,12 +1489,12 @@ var __publicField = (obj, key, value) => {
1627
1489
  );
1628
1490
  const issueReducer = issueSlice.reducer;
1629
1491
  const issueTypeAdapter = createModelAdapter((issueType) => issueType.offline_id);
1630
- const initialState$q = issueTypeAdapter.getInitialState({});
1492
+ const initialState$r = issueTypeAdapter.getInitialState({});
1631
1493
  const issueTypeSlice = toolkit.createSlice({
1632
1494
  name: "issueTypes",
1633
- initialState: initialState$q,
1495
+ initialState: initialState$r,
1634
1496
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
1635
- Object.assign(state, initialState$q);
1497
+ Object.assign(state, initialState$r);
1636
1498
  }),
1637
1499
  reducers: {
1638
1500
  initializeIssueTypes: issueTypeAdapter.initialize,
@@ -1681,15 +1543,15 @@ var __publicField = (obj, key, value) => {
1681
1543
  return ((_a2 = selectIssuesOfIssueType(issueTypeId)(state)) == null ? void 0 : _a2.length) ?? 0;
1682
1544
  };
1683
1545
  const issueTypeReducer = issueTypeSlice.reducer;
1684
- const initialState$p = {
1546
+ const initialState$q = {
1685
1547
  s3Urls: {}
1686
1548
  };
1687
1549
  const msPerHour = 1e3 * 60 * 60;
1688
1550
  const msPerWeek = msPerHour * 24 * 7;
1689
1551
  const fileSlice = toolkit.createSlice({
1690
1552
  name: "file",
1691
- initialState: initialState$p,
1692
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1553
+ initialState: initialState$q,
1554
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
1693
1555
  reducers: {
1694
1556
  setUploadUrl: (state, action) => {
1695
1557
  const { url, fields, sha1 } = action.payload;
@@ -1770,7 +1632,7 @@ var __publicField = (obj, key, value) => {
1770
1632
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
1771
1633
  return LicenseStatus2;
1772
1634
  })(LicenseStatus || {});
1773
- const initialState$o = {
1635
+ const initialState$p = {
1774
1636
  users: {},
1775
1637
  currentUser: {
1776
1638
  id: 0,
@@ -1781,8 +1643,8 @@ var __publicField = (obj, key, value) => {
1781
1643
  };
1782
1644
  const userSlice = toolkit.createSlice({
1783
1645
  name: "users",
1784
- initialState: initialState$o,
1785
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1646
+ initialState: initialState$p,
1647
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
1786
1648
  reducers: {
1787
1649
  setUsers: (state, action) => {
1788
1650
  const usersMapping = {};
@@ -1847,11 +1709,11 @@ var __publicField = (obj, key, value) => {
1847
1709
  const organizationAccessAdapter = createModelAdapter(
1848
1710
  (organizationAccess) => organizationAccess.offline_id
1849
1711
  );
1850
- const initialState$n = organizationAccessAdapter.getInitialState({});
1712
+ const initialState$o = organizationAccessAdapter.getInitialState({});
1851
1713
  const organizationAccessSlice = toolkit.createSlice({
1852
1714
  name: "organizationAccess",
1853
- initialState: initialState$n,
1854
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1715
+ initialState: initialState$o,
1716
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
1855
1717
  reducers: {
1856
1718
  initializeOrganizationAccesses: organizationAccessAdapter.initialize,
1857
1719
  updateOrganizationAccess: organizationAccessAdapter.updateOne,
@@ -1888,11 +1750,11 @@ var __publicField = (obj, key, value) => {
1888
1750
  };
1889
1751
  const organizationAccessReducer = organizationAccessSlice.reducer;
1890
1752
  const licenseAdapter = createModelAdapter((license) => license.offline_id);
1891
- const initialState$m = licenseAdapter.getInitialState({});
1753
+ const initialState$n = licenseAdapter.getInitialState({});
1892
1754
  const licenseSlice = toolkit.createSlice({
1893
1755
  name: "license",
1894
- initialState: initialState$m,
1895
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1756
+ initialState: initialState$n,
1757
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1896
1758
  reducers: {
1897
1759
  setLicenses: licenseAdapter.initialize,
1898
1760
  addLicenses: licenseAdapter.addMany,
@@ -1918,11 +1780,11 @@ var __publicField = (obj, key, value) => {
1918
1780
  );
1919
1781
  const licenseReducer = licenseSlice.reducer;
1920
1782
  const projectAccessAdapter = createModelAdapter((projectAccess) => projectAccess.offline_id);
1921
- const initialState$l = projectAccessAdapter.getInitialState({});
1783
+ const initialState$m = projectAccessAdapter.getInitialState({});
1922
1784
  const projectAccessSlice = toolkit.createSlice({
1923
1785
  name: "projectAccess",
1924
- initialState: initialState$l,
1925
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1786
+ initialState: initialState$m,
1787
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1926
1788
  reducers: {
1927
1789
  setProjectAccesses: projectAccessAdapter.initialize,
1928
1790
  updateProjectAccess: projectAccessAdapter.updateOne,
@@ -1968,15 +1830,14 @@ var __publicField = (obj, key, value) => {
1968
1830
  return projectAccesses;
1969
1831
  };
1970
1832
  const projectAccessReducer = projectAccessSlice.reducer;
1971
- const initialState$k = {
1833
+ const initialState$l = {
1972
1834
  projects: {},
1973
- activeProjectId: null,
1974
- recentProjectIds: [],
1975
- recentSearchableQueries: []
1835
+ activeProjectId: null
1976
1836
  };
1977
1837
  const projectSlice = toolkit.createSlice({
1978
1838
  name: "projects",
1979
- initialState: initialState$k,
1839
+ initialState: initialState$l,
1840
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1980
1841
  reducers: {
1981
1842
  setProjects: (state, action) => {
1982
1843
  const projectsMap = {};
@@ -2056,21 +1917,6 @@ var __publicField = (obj, key, value) => {
2056
1917
  (projects, projectId) => projects[projectId]
2057
1918
  )
2058
1919
  );
2059
- const selectSortedProjects = toolkit.createSelector(
2060
- [selectActiveProject, selectProjects],
2061
- (activeProject, projects) => {
2062
- return Object.values(projects).sort((projectA, projectB) => {
2063
- if (activeProject) {
2064
- if (activeProject.id === projectA.id) {
2065
- return -1;
2066
- } else if (activeProject.id === projectB.id) {
2067
- return 1;
2068
- }
2069
- }
2070
- return projectA.name.toLowerCase().localeCompare(projectB.name.toLowerCase(), void 0, { numeric: true });
2071
- });
2072
- }
2073
- );
2074
1920
  const projectReducer = projectSlice.reducer;
2075
1921
  const selectProjectUsersIds = toolkit.createSelector(
2076
1922
  [selectProjectAccessMapping],
@@ -2105,38 +1951,22 @@ var __publicField = (obj, key, value) => {
2105
1951
  });
2106
1952
  }
2107
1953
  );
2108
- const initialState$j = {
2109
- organizations: {},
2110
- activeOrganizationId: null
1954
+ const initialState$k = {
1955
+ organizations: {}
2111
1956
  };
2112
1957
  const organizationSlice = toolkit.createSlice({
2113
1958
  name: "organizations",
2114
- initialState: initialState$j,
2115
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
1959
+ initialState: initialState$k,
1960
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
2116
1961
  reducers: {
2117
1962
  setOrganizations: (state, action) => {
2118
1963
  for (const org of action.payload) {
2119
1964
  state.organizations[org.id] = org;
2120
1965
  }
2121
- },
2122
- updateActiveOrganization: (state, action) => {
2123
- if (!state.activeOrganizationId) {
2124
- throw new Error("Cannot update name of active organization. Active organization ID does not exist");
2125
- }
2126
- if (state.activeOrganizationId !== action.payload.id) {
2127
- throw new Error("Tried updating active organization with different organization");
2128
- }
2129
- state.organizations[state.activeOrganizationId] = action.payload;
2130
- },
2131
- setActiveOrganizationId: (state, action) => {
2132
- state.activeOrganizationId = action.payload;
2133
1966
  }
2134
1967
  }
2135
1968
  });
2136
- const { setOrganizations, setActiveOrganizationId, updateActiveOrganization } = organizationSlice.actions;
2137
- const selectActiveOrganizationId = (state) => {
2138
- return state.organizationReducer.activeOrganizationId;
2139
- };
1969
+ const { setOrganizations } = organizationSlice.actions;
2140
1970
  const selectOrganizations = (state) => {
2141
1971
  return Object.values(state.organizationReducer.organizations);
2142
1972
  };
@@ -2147,43 +1977,21 @@ var __publicField = (obj, key, value) => {
2147
1977
  [selectOrganizations],
2148
1978
  (organizations) => Object.values(organizations).filter((organization) => organization.has_access)
2149
1979
  );
2150
- const selectActiveOrganization = (state) => {
2151
- const id = selectActiveOrganizationId(state);
2152
- if (!id) {
2153
- return null;
2154
- }
2155
- const organization = state.organizationReducer.organizations[id];
2156
- if (!organization) {
2157
- return null;
2158
- }
2159
- return organization;
1980
+ const selectOrganizationById = (organizationId) => (state) => {
1981
+ return state.organizationReducer.organizations[organizationId];
2160
1982
  };
2161
1983
  const selectOrganizationUsersIds = toolkit.createSelector(
2162
1984
  [selectOrganizationAccesses],
2163
1985
  (organizationAccesses) => Object.values(organizationAccesses).map((organizationAccess) => organizationAccess.user)
2164
1986
  );
2165
- const selectActiveOrganizationProjects = toolkit.createSelector(
2166
- [selectProjects, selectActiveOrganizationId],
2167
- (projects, activeOrganizationId) => activeOrganizationId ? Object.values(projects).filter((project) => project.owner_organization === activeOrganizationId) : []
2168
- );
2169
- const selectActiveOrganizationLicenses = toolkit.createSelector(
2170
- [selectActiveOrganizationId, selectLicenses],
2171
- (activeOrganizationId, licenses) => !activeOrganizationId ? [] : Object.values(licenses).filter((license) => license.organization_owner === activeOrganizationId)
1987
+ const selectProjectsOfOrganization = restructureCreateSelectorWithArgs(
1988
+ toolkit.createSelector([selectProjects, (_, organizationId) => organizationId], (projects, organizationId) => {
1989
+ return Object.values(projects).filter((project) => project.owner_organization === organizationId);
1990
+ })
2172
1991
  );
2173
- const selectSortedOrganizationLicenses = toolkit.createSelector(
2174
- [selectActiveOrganizationLicenses, selectProjects],
2175
- (licences, projects) => licences.sort((licenseA, licenseB) => {
2176
- if (!licenseA.project) {
2177
- return 1;
2178
- }
2179
- if (!licenseB.project) {
2180
- return -1;
2181
- }
2182
- return projects[licenseA.project].name.toLowerCase().localeCompare(
2183
- projects[licenseB.project].name.toLowerCase(),
2184
- void 0,
2185
- { numeric: true }
2186
- );
1992
+ const selectLicensesOfOrganization = restructureCreateSelectorWithArgs(
1993
+ toolkit.createSelector([selectLicenses, (_, organizationId) => organizationId], (licenses, organizationId) => {
1994
+ return Object.values(licenses).filter((license) => license.organization_owner === organizationId);
2187
1995
  })
2188
1996
  );
2189
1997
  const selectOrganizationUsersAsMapping = toolkit.createSelector(
@@ -2232,14 +2040,14 @@ var __publicField = (obj, key, value) => {
2232
2040
  }
2233
2041
  };
2234
2042
  };
2235
- const initialState$i = {
2043
+ const initialState$j = {
2236
2044
  deletedRequests: [],
2237
2045
  latestRetryTime: 0
2238
2046
  };
2239
2047
  const outboxSlice = toolkit.createSlice({
2240
2048
  name: "outbox",
2241
- initialState: initialState$i,
2242
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2049
+ initialState: initialState$j,
2050
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
2243
2051
  reducers: {
2244
2052
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
2245
2053
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -2271,16 +2079,15 @@ var __publicField = (obj, key, value) => {
2271
2079
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
2272
2080
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
2273
2081
  const outboxReducer = outboxSlice.reducer;
2274
- const initialState$h = {
2082
+ const initialState$i = {
2275
2083
  projectFiles: {},
2276
2084
  activeProjectFileId: null,
2277
- isImportingProjectFile: false,
2278
- enabledProjectFiles: {}
2085
+ isImportingProjectFile: false
2279
2086
  };
2280
2087
  const projectFileSlice = toolkit.createSlice({
2281
2088
  name: "projectFiles",
2282
- initialState: initialState$h,
2283
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2089
+ initialState: initialState$i,
2090
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
2284
2091
  reducers: {
2285
2092
  addOrReplaceProjectFiles: (state, action) => {
2286
2093
  for (let fileObj of action.payload) {
@@ -2305,9 +2112,6 @@ var __publicField = (obj, key, value) => {
2305
2112
  }
2306
2113
  state.projectFiles[action.payload.offline_id] = action.payload;
2307
2114
  },
2308
- setProjectFileVisible: (state, action) => {
2309
- state.enabledProjectFiles[action.payload.fileId] = action.payload.visible;
2310
- },
2311
2115
  setIsImportingProjectFile: (state, action) => {
2312
2116
  state.isImportingProjectFile = action.payload;
2313
2117
  },
@@ -2327,19 +2131,14 @@ var __publicField = (obj, key, value) => {
2327
2131
  // TODO: Move to MapContext. Should not be persisted.
2328
2132
  setActiveProjectFileId: (state, action) => {
2329
2133
  state.activeProjectFileId = action.payload;
2330
- if (action.payload) {
2331
- state.enabledProjectFiles[action.payload] = true;
2332
- }
2333
2134
  },
2334
2135
  removeProjectFile: (state, action) => {
2335
2136
  delete state.projectFiles[action.payload];
2336
- delete state.enabledProjectFiles[action.payload];
2337
2137
  },
2338
2138
  removeProjectFilesOfProject: (state, action) => {
2339
2139
  const filesToDelete = Object.values(state.projectFiles).filter((file) => file.project === action.payload);
2340
2140
  for (const file of filesToDelete) {
2341
2141
  delete state.projectFiles[file.offline_id];
2342
- delete state.enabledProjectFiles[file.offline_id];
2343
2142
  }
2344
2143
  },
2345
2144
  resetProjectFileObjectUrls: (state, ..._args) => {
@@ -2352,7 +2151,6 @@ var __publicField = (obj, key, value) => {
2352
2151
  const {
2353
2152
  addOrReplaceProjectFiles,
2354
2153
  addOrReplaceProjectFile,
2355
- setProjectFileVisible,
2356
2154
  setIsImportingProjectFile,
2357
2155
  setActiveProjectFileId,
2358
2156
  saveActiveProjectFileBounds,
@@ -2360,33 +2158,25 @@ var __publicField = (obj, key, value) => {
2360
2158
  removeProjectFilesOfProject,
2361
2159
  resetProjectFileObjectUrls
2362
2160
  } = projectFileSlice.actions;
2363
- const selectEnabledProjectFiles = (state) => state.projectFileReducer.enabledProjectFiles;
2364
- const selectProjectFileVisibility = toolkit.createSelector(
2365
- [selectEnabledProjectFiles],
2366
- (enabledProjectFiles) => {
2367
- const ret = {};
2368
- for (const [fileId, enabled] of Object.entries(enabledProjectFiles)) {
2369
- ret[fileId] = enabled === true || enabled === void 0;
2370
- }
2371
- return ret;
2372
- }
2373
- );
2374
- const selectEnabledProjectFileMapping = (state) => state.projectFileReducer.projectFiles;
2161
+ const selectProjectFileMapping = (state) => state.projectFileReducer.projectFiles;
2375
2162
  const selectProjectFiles = toolkit.createSelector(
2376
- [selectEnabledProjectFileMapping, selectActiveProjectId],
2163
+ [selectProjectFileMapping, selectActiveProjectId],
2377
2164
  (mapping, activeProjectId) => {
2378
2165
  return Object.values(mapping).filter((file) => file.project === activeProjectId).sort((a, b) => a.z_index - b.z_index);
2379
2166
  }
2380
2167
  );
2381
2168
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
2382
2169
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
2170
+ const selectProjectFileById = (id) => (state) => {
2171
+ return state.projectFileReducer.projectFiles[id];
2172
+ };
2383
2173
  const projectFileReducer = projectFileSlice.reducer;
2384
2174
  const projectAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
2385
- const initialState$g = projectAttachmentAdapter.getInitialState({});
2175
+ const initialState$h = projectAttachmentAdapter.getInitialState({});
2386
2176
  const projectAttachmentSlice = toolkit.createSlice({
2387
2177
  name: "projectAttachments",
2388
- initialState: initialState$g,
2389
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2178
+ initialState: initialState$h,
2179
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$h)),
2390
2180
  reducers: {
2391
2181
  initializeProjectAttachments: projectAttachmentAdapter.initialize,
2392
2182
  addProjectAttachment: projectAttachmentAdapter.addOne,
@@ -2444,12 +2234,12 @@ var __publicField = (obj, key, value) => {
2444
2234
  )
2445
2235
  );
2446
2236
  const projectAttachmentReducer = projectAttachmentSlice.reducer;
2447
- const initialState$f = {
2237
+ const initialState$g = {
2448
2238
  isRehydrated: false
2449
2239
  };
2450
2240
  const rehydratedSlice = toolkit.createSlice({
2451
2241
  name: "rehydrated",
2452
- initialState: initialState$f,
2242
+ initialState: initialState$g,
2453
2243
  // The `reducers` field lets us define reducers and generate associated actions
2454
2244
  reducers: {
2455
2245
  setRehydrated: (state, action) => {
@@ -2460,13 +2250,13 @@ var __publicField = (obj, key, value) => {
2460
2250
  const { setRehydrated } = rehydratedSlice.actions;
2461
2251
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
2462
2252
  const rehydratedReducer = rehydratedSlice.reducer;
2463
- const initialState$e = {
2253
+ const initialState$f = {
2464
2254
  isFetchingInitialData: false
2465
2255
  };
2466
2256
  const settingSlice = toolkit.createSlice({
2467
2257
  name: "settings",
2468
- initialState: initialState$e,
2469
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2258
+ initialState: initialState$f,
2259
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2470
2260
  reducers: {
2471
2261
  setIsFetchingInitialData: (state, action) => {
2472
2262
  state.isFetchingInitialData = action.payload;
@@ -2490,11 +2280,11 @@ var __publicField = (obj, key, value) => {
2490
2280
  }
2491
2281
  };
2492
2282
  const formRevisionAdapter = createModelAdapter((revision) => revision.offline_id);
2493
- const initialState$d = formRevisionAdapter.getInitialState({});
2283
+ const initialState$e = formRevisionAdapter.getInitialState({});
2494
2284
  const formRevisionsSlice = toolkit.createSlice({
2495
2285
  name: "formRevisions",
2496
- initialState: initialState$d,
2497
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2286
+ initialState: initialState$e,
2287
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2498
2288
  reducers: {
2499
2289
  initializeFormRevisions: formRevisionAdapter.initialize,
2500
2290
  setFormRevision: formRevisionAdapter.setOne,
@@ -2555,11 +2345,11 @@ var __publicField = (obj, key, value) => {
2555
2345
  selectFormRevisionMapping,
2556
2346
  (_state, assetTypeIds) => assetTypeIds
2557
2347
  ],
2558
- (userForms, revisions, assetTypeIds) => {
2348
+ (formsMapping, revisions, assetTypeIds) => {
2559
2349
  const assetTypeIdsSet = new Set(assetTypeIds);
2560
2350
  const formsOfAssetTypes = {};
2561
2351
  const ret = {};
2562
- for (const form of Object.values(userForms)) {
2352
+ for (const form of Object.values(formsMapping)) {
2563
2353
  if (form.asset_type && assetTypeIdsSet.has(form.asset_type)) {
2564
2354
  formsOfAssetTypes[form.offline_id] = form;
2565
2355
  }
@@ -2587,11 +2377,11 @@ var __publicField = (obj, key, value) => {
2587
2377
  });
2588
2378
  const formRevisionReducer = formRevisionsSlice.reducer;
2589
2379
  const formAdapter = createModelAdapter((form) => form.offline_id);
2590
- const initialState$c = formAdapter.getInitialState({});
2380
+ const initialState$d = formAdapter.getInitialState({});
2591
2381
  const formSlice = toolkit.createSlice({
2592
2382
  name: "forms",
2593
- initialState: initialState$c,
2594
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2383
+ initialState: initialState$d,
2384
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2595
2385
  reducers: {
2596
2386
  setForms: formAdapter.initialize,
2597
2387
  setForm: formAdapter.setOne,
@@ -2612,22 +2402,22 @@ var __publicField = (obj, key, value) => {
2612
2402
  (state) => state.formRevisionReducer.instances,
2613
2403
  (_state, search) => search
2614
2404
  ],
2615
- (userForms, revisions, search) => {
2405
+ (formsMapping, revisions, search) => {
2616
2406
  const { searchTerm, maxResults, favorites, organization } = search;
2617
2407
  const favoriteMatches = [];
2618
2408
  const regularMatches = [];
2619
- for (const [userFormId, userForm] of Object.entries(userForms)) {
2620
- if (favorites !== void 0 && userForm.favorite != favorites)
2409
+ for (const [formId, form] of Object.entries(formsMapping)) {
2410
+ if (favorites !== void 0 && form.favorite != favorites)
2621
2411
  continue;
2622
- if (Number.isInteger(organization) && organization !== userForm.organization) {
2412
+ if (Number.isInteger(organization) && organization !== form.organization) {
2623
2413
  continue;
2624
2414
  }
2625
- const latestRevision = _selectLatestFormRevision(revisions, userFormId);
2415
+ const latestRevision = _selectLatestFormRevision(revisions, formId);
2626
2416
  if (latestRevision.title.toLowerCase().includes(searchTerm.toLowerCase())) {
2627
- if (userForm.favorite) {
2628
- favoriteMatches.push({ ...userForm, latestRevision });
2417
+ if (form.favorite) {
2418
+ favoriteMatches.push({ ...form, latestRevision });
2629
2419
  } else {
2630
- regularMatches.push({ ...userForm, latestRevision });
2420
+ regularMatches.push({ ...form, latestRevision });
2631
2421
  }
2632
2422
  }
2633
2423
  if (favoriteMatches.length >= maxResults) {
@@ -2641,43 +2431,41 @@ var __publicField = (obj, key, value) => {
2641
2431
  { memoizeOptions: { equalityCheck: shallowEqual } }
2642
2432
  )
2643
2433
  );
2644
- const selectForm = restructureCreateSelectorWithArgs(
2645
- toolkit.createSelector([selectFormsMapping, (_, formId) => formId], (userForms, formId) => {
2646
- return userForms[formId];
2647
- })
2648
- );
2434
+ const selectForm = (formId) => (state) => {
2435
+ return state.formReducer.instances[formId];
2436
+ };
2649
2437
  const selectFormMapping = (state) => {
2650
2438
  return state.formReducer.instances;
2651
2439
  };
2652
2440
  const selectFormOfAssetType = restructureCreateSelectorWithArgs(
2653
2441
  toolkit.createSelector(
2654
2442
  [selectFormMapping, (_state, assetTypeId) => assetTypeId],
2655
- (userForms, assetTypeId) => {
2656
- return Object.values(userForms).find((userForm) => userForm.asset_type === assetTypeId);
2443
+ (formsMapping, assetTypeId) => {
2444
+ return Object.values(formsMapping).find((form) => form.asset_type === assetTypeId);
2657
2445
  }
2658
2446
  )
2659
2447
  );
2660
2448
  const selectFormOfIssueType = restructureCreateSelectorWithArgs(
2661
2449
  toolkit.createSelector(
2662
2450
  [selectFormMapping, (_state, issueTypeId) => issueTypeId],
2663
- (userForms, issueTypeId) => {
2664
- return Object.values(userForms).find((userForm) => userForm.issue_type === issueTypeId);
2451
+ (formsMapping, issueTypeId) => {
2452
+ return Object.values(formsMapping).find((form) => form.issue_type === issueTypeId);
2665
2453
  }
2666
2454
  )
2667
2455
  );
2668
- const selectFormsCount = toolkit.createSelector([selectFormMapping], (userForms) => {
2669
- return Object.keys(userForms).length;
2456
+ const selectFormsCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
2457
+ return Object.keys(formsMapping).length;
2670
2458
  });
2671
- const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (userForms) => {
2672
- return Object.values(userForms).filter((form) => !form.asset_type).length;
2459
+ const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
2460
+ return Object.values(formsMapping).filter((form) => !form.asset_type).length;
2673
2461
  });
2674
2462
  const formReducer = formSlice.reducer;
2675
2463
  const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
2676
- const initialState$b = submissionAdapter.getInitialState({});
2464
+ const initialState$c = submissionAdapter.getInitialState({});
2677
2465
  const formSubmissionSlice = toolkit.createSlice({
2678
2466
  name: "formSubmissions",
2679
- initialState: initialState$b,
2680
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2467
+ initialState: initialState$c,
2468
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2681
2469
  reducers: {
2682
2470
  setFormSubmission: submissionAdapter.setOne,
2683
2471
  setFormSubmissions: submissionAdapter.setMany,
@@ -2797,29 +2585,32 @@ var __publicField = (obj, key, value) => {
2797
2585
  }
2798
2586
  )
2799
2587
  );
2800
- const selectFormSubmissionsByAssets = toolkit.createSelector([selectFormSubmissionsMapping, selectAssetsMapping], (submissions, assets) => {
2801
- var _a2;
2802
- const assetSubmissionMapping = {};
2803
- for (const assetId in assets) {
2804
- assetSubmissionMapping[assetId] = [];
2805
- }
2806
- for (const submissionId in submissions) {
2807
- const submission = submissions[submissionId];
2808
- if (submission.asset) {
2809
- (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
2588
+ const selectFormSubmissionsByAssets = toolkit.createSelector(
2589
+ [selectFormSubmissionsMapping, selectAssetsMapping],
2590
+ (submissions, assets) => {
2591
+ var _a2;
2592
+ const assetSubmissionMapping = {};
2593
+ for (const assetId in assets) {
2594
+ assetSubmissionMapping[assetId] = [];
2595
+ }
2596
+ for (const submissionId in submissions) {
2597
+ const submission = submissions[submissionId];
2598
+ if (submission.asset) {
2599
+ (_a2 = assetSubmissionMapping[submission.asset]) == null ? void 0 : _a2.push(submission);
2600
+ }
2810
2601
  }
2602
+ return assetSubmissionMapping;
2811
2603
  }
2812
- return assetSubmissionMapping;
2813
- });
2604
+ );
2814
2605
  const formSubmissionReducer = formSubmissionSlice.reducer;
2815
2606
  const formSubmissionAttachmentAdapter = createModelAdapter(
2816
2607
  (attachment) => attachment.offline_id
2817
2608
  );
2818
- const initialState$a = formSubmissionAttachmentAdapter.getInitialState({});
2609
+ const initialState$b = formSubmissionAttachmentAdapter.getInitialState({});
2819
2610
  const formSubmissionAttachmentSlice = toolkit.createSlice({
2820
2611
  name: "formSubmissionAttachments",
2821
- initialState: initialState$a,
2822
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
2612
+ initialState: initialState$b,
2613
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2823
2614
  reducers: {
2824
2615
  initializeFormSubmissionAttachments: formSubmissionAttachmentAdapter.initialize,
2825
2616
  addFormSubmissionAttachment: formSubmissionAttachmentAdapter.addOne,
@@ -2858,11 +2649,11 @@ var __publicField = (obj, key, value) => {
2858
2649
  const formRevisionAttachmentAdapter = createModelAdapter(
2859
2650
  (attachment) => attachment.offline_id
2860
2651
  );
2861
- const initialState$9 = formRevisionAttachmentAdapter.getInitialState({});
2652
+ const initialState$a = formRevisionAttachmentAdapter.getInitialState({});
2862
2653
  const formRevisionAttachmentSlice = toolkit.createSlice({
2863
2654
  name: "formRevisionAttachments",
2864
- initialState: initialState$9,
2865
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
2655
+ initialState: initialState$a,
2656
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
2866
2657
  reducers: {
2867
2658
  initializeFormRevisionAttachments: formRevisionAttachmentAdapter.initialize,
2868
2659
  addFormRevisionAttachment: formRevisionAttachmentAdapter.addOne,
@@ -2886,12 +2677,12 @@ var __publicField = (obj, key, value) => {
2886
2677
  deleteFormRevisionAttachment,
2887
2678
  deleteFormRevisionAttachments
2888
2679
  } = formRevisionAttachmentSlice.actions;
2889
- const selectUserFormRevisionAttachmentsMapping = (state) => {
2680
+ const selectFormRevisionAttachmentsMapping = (state) => {
2890
2681
  return state.formRevisionAttachmentReducer.instances;
2891
2682
  };
2892
2683
  const selectAttachmentsOfFormRevision = restructureCreateSelectorWithArgs(
2893
2684
  toolkit.createSelector(
2894
- [selectUserFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
2685
+ [selectFormRevisionAttachmentsMapping, (_state, revisionId) => revisionId],
2895
2686
  (attachments, revisionId) => {
2896
2687
  return Object.values(attachments).filter((attachment) => attachment.revision === revisionId);
2897
2688
  }
@@ -2899,10 +2690,10 @@ var __publicField = (obj, key, value) => {
2899
2690
  );
2900
2691
  const formRevisionAttachmentReducer = formRevisionAttachmentSlice.reducer;
2901
2692
  const emailDomainAdapter = createModelAdapter((emailDomain) => emailDomain.offline_id);
2902
- const initialState$8 = emailDomainAdapter.getInitialState({});
2693
+ const initialState$9 = emailDomainAdapter.getInitialState({});
2903
2694
  const emailDomainsSlice = toolkit.createSlice({
2904
2695
  name: "emailDomains",
2905
- initialState: initialState$8,
2696
+ initialState: initialState$9,
2906
2697
  reducers: {
2907
2698
  initializeEmailDomains: emailDomainAdapter.initialize,
2908
2699
  addEmailDomain: emailDomainAdapter.addOne,
@@ -2921,14 +2712,14 @@ var __publicField = (obj, key, value) => {
2921
2712
  )
2922
2713
  );
2923
2714
  const emailDomainsReducer = emailDomainsSlice.reducer;
2924
- const initialState$7 = {
2715
+ const initialState$8 = {
2925
2716
  documents: {}
2926
2717
  };
2927
2718
  const documentSlice = toolkit.createSlice({
2928
2719
  name: "documents",
2929
- initialState: initialState$7,
2720
+ initialState: initialState$8,
2930
2721
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2931
- Object.assign(state, initialState$7);
2722
+ Object.assign(state, initialState$8);
2932
2723
  }),
2933
2724
  reducers: {
2934
2725
  setDocuments: (state, action) => {
@@ -3103,11 +2894,11 @@ var __publicField = (obj, key, value) => {
3103
2894
  );
3104
2895
  const documentsReducer = documentSlice.reducer;
3105
2896
  const documentAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
3106
- const initialState$6 = documentAttachmentAdapter.getInitialState({});
2897
+ const initialState$7 = documentAttachmentAdapter.getInitialState({});
3107
2898
  const documentAttachmentSlice = toolkit.createSlice({
3108
2899
  name: "documentAttachments",
3109
- initialState: initialState$6,
3110
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
2900
+ initialState: initialState$7,
2901
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3111
2902
  reducers: {
3112
2903
  initializeDocumentAttachments: documentAttachmentAdapter.initialize,
3113
2904
  addDocumentAttachment: documentAttachmentAdapter.addOne,
@@ -3166,11 +2957,11 @@ var __publicField = (obj, key, value) => {
3166
2957
  );
3167
2958
  const documentAttachmentReducer = documentAttachmentSlice.reducer;
3168
2959
  const teamAdapter = createModelAdapter((team) => team.offline_id);
3169
- const initialState$5 = teamAdapter.getInitialState({});
2960
+ const initialState$6 = teamAdapter.getInitialState({});
3170
2961
  const teamSlice = toolkit.createSlice({
3171
2962
  name: "teams",
3172
- initialState: initialState$5,
3173
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
2963
+ initialState: initialState$6,
2964
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3174
2965
  reducers: {
3175
2966
  setTeam: teamAdapter.setOne,
3176
2967
  setTeams: teamAdapter.initialize,
@@ -3204,11 +2995,11 @@ var __publicField = (obj, key, value) => {
3204
2995
  const agentUserConversationAdapter = createModelAdapter(
3205
2996
  (conversation) => conversation.offline_id
3206
2997
  );
3207
- const initialState$4 = agentUserConversationAdapter.getInitialState({});
2998
+ const initialState$5 = agentUserConversationAdapter.getInitialState({});
3208
2999
  const agentsSlice = toolkit.createSlice({
3209
3000
  name: "agents",
3210
- initialState: initialState$4,
3211
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3001
+ initialState: initialState$5,
3002
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3212
3003
  reducers: {
3213
3004
  initializeConversations: agentUserConversationAdapter.initialize,
3214
3005
  addConversation: agentUserConversationAdapter.addOne,
@@ -3230,11 +3021,11 @@ var __publicField = (obj, key, value) => {
3230
3021
  );
3231
3022
  const agentsReducer = agentsSlice.reducer;
3232
3023
  const issueCommentAdapter = createModelAdapter((comment) => comment.offline_id);
3233
- const initialState$3 = issueCommentAdapter.getInitialState({});
3024
+ const initialState$4 = issueCommentAdapter.getInitialState({});
3234
3025
  const issueCommentSlice = toolkit.createSlice({
3235
3026
  name: "issueComments",
3236
- initialState: initialState$3,
3237
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
3027
+ initialState: initialState$4,
3028
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3238
3029
  reducers: {
3239
3030
  addIssueComment: issueCommentAdapter.addOne,
3240
3031
  addIssueComments: issueCommentAdapter.addMany,
@@ -3263,11 +3054,11 @@ var __publicField = (obj, key, value) => {
3263
3054
  );
3264
3055
  const issueCommentReducer = issueCommentSlice.reducer;
3265
3056
  const issueUpdateAdapter = createModelAdapter((issueUpdate) => issueUpdate.offline_id);
3266
- const initialState$2 = issueUpdateAdapter.getInitialState({});
3057
+ const initialState$3 = issueUpdateAdapter.getInitialState({});
3267
3058
  const issueUpdateSlice = toolkit.createSlice({
3268
3059
  name: "issueUpdates",
3269
- initialState: initialState$2,
3270
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
3060
+ initialState: initialState$3,
3061
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
3271
3062
  reducers: {
3272
3063
  initializeIssueUpdates: issueUpdateAdapter.setMany,
3273
3064
  setIssueUpdate: issueUpdateAdapter.setOne,
@@ -3296,11 +3087,11 @@ var __publicField = (obj, key, value) => {
3296
3087
  );
3297
3088
  const issueUpdateReducer = issueUpdateSlice.reducer;
3298
3089
  const issueAttachmentAdapter = createModelAdapter((attachment) => attachment.offline_id);
3299
- const initialState$1 = issueAttachmentAdapter.getInitialState({});
3090
+ const initialState$2 = issueAttachmentAdapter.getInitialState({});
3300
3091
  const issueAttachmentSlice = toolkit.createSlice({
3301
3092
  name: "issueAttachments",
3302
- initialState: initialState$1,
3303
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
3093
+ initialState: initialState$2,
3094
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$2)),
3304
3095
  reducers: {
3305
3096
  initializeIssueAttachments: issueAttachmentAdapter.initialize,
3306
3097
  addIssueAttachment: issueAttachmentAdapter.addOne,
@@ -3358,15 +3149,59 @@ var __publicField = (obj, key, value) => {
3358
3149
  )
3359
3150
  );
3360
3151
  const issueAttachmentReducer = issueAttachmentSlice.reducer;
3361
- const initialState = {
3152
+ const initialState$1 = {
3362
3153
  version: 0
3363
3154
  };
3364
3155
  const versioningSlice = toolkit.createSlice({
3365
3156
  name: "versioning",
3366
- initialState,
3157
+ initialState: initialState$1,
3367
3158
  reducers: {}
3368
3159
  });
3369
3160
  const versioningReducer = versioningSlice.reducer;
3161
+ const geoImageAdapter = createModelAdapter((model) => model.offline_id);
3162
+ const initialState = geoImageAdapter.getInitialState({});
3163
+ const geoImageSlice = toolkit.createSlice({
3164
+ name: "geoImages",
3165
+ initialState,
3166
+ extraReducers: (builder) => {
3167
+ builder.addCase("RESET", (state) => {
3168
+ Object.assign(state, initialState);
3169
+ });
3170
+ },
3171
+ reducers: {
3172
+ initializeGeoImages: geoImageAdapter.initialize,
3173
+ setGeoImage: geoImageAdapter.setOne,
3174
+ setGeoImages: geoImageAdapter.setMany,
3175
+ addGeoImage: geoImageAdapter.addOne,
3176
+ addGeoImages: geoImageAdapter.addMany,
3177
+ updateGeoImage: geoImageAdapter.updateOne,
3178
+ updateGeoImages: geoImageAdapter.updateMany,
3179
+ deleteGeoImage: geoImageAdapter.deleteOne,
3180
+ deleteGeoImages: geoImageAdapter.deleteMany
3181
+ }
3182
+ });
3183
+ const {
3184
+ initializeGeoImages,
3185
+ setGeoImage,
3186
+ setGeoImages,
3187
+ addGeoImage,
3188
+ addGeoImages,
3189
+ updateGeoImage,
3190
+ updateGeoImages,
3191
+ deleteGeoImage,
3192
+ deleteGeoImages
3193
+ } = geoImageSlice.actions;
3194
+ const selectGeoImageMapping = (state) => state.geoImageReducer.instances;
3195
+ const selectGeoImages = (state) => Object.values(state.geoImageReducer.instances);
3196
+ const selectGeoImageById = (id) => (state) => {
3197
+ return state.geoImageReducer.instances[id];
3198
+ };
3199
+ const selectGeoImagesOfProject = restructureCreateSelectorWithArgs(
3200
+ toolkit.createSelector([selectGeoImages, (_, projectId) => projectId], (mapImages, projectId) => {
3201
+ return mapImages.filter((mapImage) => mapImage.project === projectId);
3202
+ })
3203
+ );
3204
+ const geoImageReducer = geoImageSlice.reducer;
3370
3205
  const fullAssetMarkerSize = 45;
3371
3206
  const DEFAULT_ISSUE_STATUS = IssueStatus.BACKLOG;
3372
3207
  const DEFAULT_ISSUE_PRIORITY = IssuePriority.MEDIUM;
@@ -3438,7 +3273,8 @@ var __publicField = (obj, key, value) => {
3438
3273
  teamReducer,
3439
3274
  agentsReducer,
3440
3275
  issueCommentReducer,
3441
- issueUpdateReducer
3276
+ issueUpdateReducer,
3277
+ geoImageReducer
3442
3278
  };
3443
3279
  const overmapReducer = toolkit.combineReducers(overmapReducers);
3444
3280
  const resetStore = "RESET";
@@ -3994,8 +3830,6 @@ var __publicField = (obj, key, value) => {
3994
3830
  console.debug(this.constructor.name, "clearing auth;");
3995
3831
  this.dispatch(setLoggedIn(false));
3996
3832
  this.clearTokens();
3997
- this.dispatch(setActiveProjectId(null));
3998
- this.dispatch(setActiveWorkspaceId(null));
3999
3833
  this.dispatch({ type: constants.RESET_STATE });
4000
3834
  this.dispatch({ type: resetStore });
4001
3835
  }
@@ -4492,13 +4326,13 @@ var __publicField = (obj, key, value) => {
4492
4326
  if (!stage) {
4493
4327
  throw new Error(`No asset stage with id ${stageId} found in the store`);
4494
4328
  }
4495
- this.dispatch(updateStage({ ...stage, user_form: formId }));
4329
+ this.dispatch(updateStage({ ...stage, form: formId }));
4496
4330
  try {
4497
4331
  await this.enqueueRequest({
4498
4332
  description: "Link asset stage to form",
4499
4333
  method: HttpMethod.POST,
4500
4334
  url: `/assets/stages/${stageId}/associate-with-form/`,
4501
- payload: { user_form: formId },
4335
+ payload: { form: formId },
4502
4336
  blockers: [stageId, formId],
4503
4337
  blocks: [stageId]
4504
4338
  });
@@ -4513,7 +4347,7 @@ var __publicField = (obj, key, value) => {
4513
4347
  if (!stage) {
4514
4348
  throw new Error(`No asset stage with id ${stageId} found in the store`);
4515
4349
  }
4516
- this.dispatch(updateStage({ ...stage, user_form: void 0 }));
4350
+ this.dispatch(updateStage({ ...stage, form: void 0 }));
4517
4351
  try {
4518
4352
  await this.enqueueRequest({
4519
4353
  description: "Unlink asset stage from form",
@@ -4538,39 +4372,7 @@ var __publicField = (obj, key, value) => {
4538
4372
  this.dispatch(initializeStages(result));
4539
4373
  }
4540
4374
  }
4541
- const AttachmentModelMeta = {
4542
- [AttachmentModel.Issue]: {
4543
- name: "issue",
4544
- attachUrlPrefix: "/issues",
4545
- deleteUrlPrefix: "/issues",
4546
- fetchUrlPostfix: "/issue-attachments"
4547
- },
4548
- [AttachmentModel.Asset]: {
4549
- name: "asset",
4550
- attachUrlPrefix: "/assets",
4551
- deleteUrlPrefix: "/assets",
4552
- fetchUrlPostfix: "/asset-attachments"
4553
- },
4554
- [AttachmentModel.AssetType]: {
4555
- name: "asset type",
4556
- attachUrlPrefix: "/assets/types",
4557
- deleteUrlPrefix: "/assets/types",
4558
- fetchUrlPostfix: "/asset-type-attachments"
4559
- },
4560
- [AttachmentModel.Project]: {
4561
- name: "project",
4562
- attachUrlPrefix: "/projects",
4563
- deleteUrlPrefix: "/projects",
4564
- fetchUrlPostfix: "/attachments"
4565
- },
4566
- [AttachmentModel.Document]: {
4567
- name: "document",
4568
- attachUrlPrefix: "/documents",
4569
- deleteUrlPrefix: "/documents",
4570
- fetchUrlPostfix: "/document-attachments"
4571
- }
4572
- };
4573
- class BaseAttachmentService extends BaseApiService {
4375
+ class BaseUploadService extends BaseApiService {
4574
4376
  getNumberOfAttachmentsWithSha1(sha1) {
4575
4377
  const {
4576
4378
  issueAttachmentReducer: issueAttachmentReducer2,
@@ -4578,8 +4380,9 @@ var __publicField = (obj, key, value) => {
4578
4380
  assetTypeAttachmentReducer: assetTypeAttachmentReducer2,
4579
4381
  documentAttachmentReducer: documentAttachmentReducer2,
4580
4382
  projectAttachmentReducer: projectAttachmentReducer2,
4383
+ formRevisionAttachmentReducer: formRevisionAttachmentReducer2,
4581
4384
  formSubmissionAttachmentReducer: formSubmissionAttachmentReducer2,
4582
- formRevisionAttachmentReducer: formRevisionAttachmentReducer2
4385
+ geoImageReducer: geoImageReducer2
4583
4386
  } = this.client.store.getState();
4584
4387
  const objectsWithSha1 = [].concat(
4585
4388
  Object.values(issueAttachmentReducer2.instances),
@@ -4588,7 +4391,8 @@ var __publicField = (obj, key, value) => {
4588
4391
  Object.values(documentAttachmentReducer2.instances),
4589
4392
  Object.values(projectAttachmentReducer2.instances),
4590
4393
  Object.values(formRevisionAttachmentReducer2.instances),
4591
- Object.values(formSubmissionAttachmentReducer2.instances)
4394
+ Object.values(formSubmissionAttachmentReducer2.instances),
4395
+ Object.values(geoImageReducer2.instances)
4592
4396
  );
4593
4397
  return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
4594
4398
  }
@@ -4608,6 +4412,40 @@ var __publicField = (obj, key, value) => {
4608
4412
  });
4609
4413
  }
4610
4414
  }
4415
+ }
4416
+ const AttachmentModelMeta = {
4417
+ [AttachmentModel.Issue]: {
4418
+ name: "issue",
4419
+ attachUrlPrefix: "/issues",
4420
+ deleteUrlPrefix: "/issues",
4421
+ fetchUrlPostfix: "/issue-attachments"
4422
+ },
4423
+ [AttachmentModel.Asset]: {
4424
+ name: "asset",
4425
+ attachUrlPrefix: "/assets",
4426
+ deleteUrlPrefix: "/assets",
4427
+ fetchUrlPostfix: "/asset-attachments"
4428
+ },
4429
+ [AttachmentModel.AssetType]: {
4430
+ name: "asset type",
4431
+ attachUrlPrefix: "/assets/types",
4432
+ deleteUrlPrefix: "/assets/types",
4433
+ fetchUrlPostfix: "/asset-type-attachments"
4434
+ },
4435
+ [AttachmentModel.Project]: {
4436
+ name: "project",
4437
+ attachUrlPrefix: "/projects",
4438
+ deleteUrlPrefix: "/projects",
4439
+ fetchUrlPostfix: "/attachments"
4440
+ },
4441
+ [AttachmentModel.Document]: {
4442
+ name: "document",
4443
+ attachUrlPrefix: "/documents",
4444
+ deleteUrlPrefix: "/documents",
4445
+ fetchUrlPostfix: "/document-attachments"
4446
+ }
4447
+ };
4448
+ class BaseAttachmentService extends BaseUploadService {
4611
4449
  async attachFiles(files, modelId, buildOfflineAttachment) {
4612
4450
  const { store } = this.client;
4613
4451
  const currentUser = store.getState().userReducer.currentUser;
@@ -4963,11 +4801,10 @@ var __publicField = (obj, key, value) => {
4963
4801
  // Basic CRUD functions
4964
4802
  // TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
4965
4803
  // have to repeat it for all optimistic model results (all optimistic results are created).
4966
- add(issue, issueType = null) {
4804
+ add(issue, workspaceId, issueType = null) {
4967
4805
  const { store } = this.client;
4968
4806
  const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
4969
4807
  const state = store.getState();
4970
- const workspaceId = state.workspaceReducer.activeWorkspaceId;
4971
4808
  const currentUserId = state.userReducer.currentUser.id;
4972
4809
  dateWithoutMilliseconds.setMilliseconds(0);
4973
4810
  if (!workspaceId) {
@@ -5478,10 +5315,6 @@ var __publicField = (obj, key, value) => {
5478
5315
  if (!project) {
5479
5316
  throw new Error("Expected project to exist");
5480
5317
  }
5481
- const activeProjectId = state.projectReducer.activeProjectId;
5482
- if (activeProjectId === projectId) {
5483
- this.dispatch({ type: "project/setActiveProjectId", payload: null });
5484
- }
5485
5318
  const filesToDelete = selectProjectFiles(state).filter((file) => file.project === projectId);
5486
5319
  this.dispatch(removeProjectFilesOfProject(project.id));
5487
5320
  const attachmentsOfProject = selectAttachmentsOfProject(project.id)(state);
@@ -5508,7 +5341,6 @@ var __publicField = (obj, key, value) => {
5508
5341
  this.dispatch(setProjectAccesses(Object.values(projectAccesses)));
5509
5342
  this.dispatch(addOrReplaceProjectFiles(filesToDelete));
5510
5343
  this.dispatch(setProjectAttachments(attachmentsOfProject));
5511
- this.dispatch(setActiveProjectId(activeProjectId));
5512
5344
  this.dispatch({ type: "rehydrated/setRehydrated", payload: true });
5513
5345
  if (license) {
5514
5346
  this.dispatch(updateLicense({ ...license, project: project.id }));
@@ -5579,7 +5411,7 @@ var __publicField = (obj, key, value) => {
5579
5411
  }
5580
5412
  return { fields: newFields, images };
5581
5413
  };
5582
- class UserFormService extends BaseApiService {
5414
+ class FormService extends BaseApiService {
5583
5415
  constructor() {
5584
5416
  super(...arguments);
5585
5417
  // Attach images to revision, after uploading them to S3
@@ -5785,17 +5617,17 @@ var __publicField = (obj, key, value) => {
5785
5617
  async delete(formId) {
5786
5618
  const { store } = this.client;
5787
5619
  const state = store.getState();
5788
- const userForm = selectForm(formId)(state);
5789
- if (!userForm) {
5790
- throw new Error("Expected userForm to exist");
5620
+ const form = selectForm(formId)(state);
5621
+ if (!form) {
5622
+ throw new Error("Expected form to exist");
5791
5623
  }
5792
- const userFormSubmissions = selectFormSubmissionsOfForm(formId)(state);
5793
- if (userFormSubmissions && userFormSubmissions.length > 0) {
5794
- this.dispatch(deleteFormSubmissions(userFormSubmissions.map(({ offline_id }) => offline_id)));
5624
+ const formSubmissions = selectFormSubmissionsOfForm(formId)(state);
5625
+ if (formSubmissions && formSubmissions.length > 0) {
5626
+ this.dispatch(deleteFormSubmissions(formSubmissions.map(({ offline_id }) => offline_id)));
5795
5627
  }
5796
- const userFormRevisions = selectFormRevisionsOfForm(formId)(state);
5797
- if (userFormRevisions && userFormRevisions.length > 0) {
5798
- this.dispatch(deleteFormRevisions(userFormRevisions.map(({ offline_id }) => offline_id)));
5628
+ const formRevisions = selectFormRevisionsOfForm(formId)(state);
5629
+ if (formRevisions && formRevisions.length > 0) {
5630
+ this.dispatch(deleteFormRevisions(formRevisions.map(({ offline_id }) => offline_id)));
5799
5631
  }
5800
5632
  this.dispatch(deleteForm(formId));
5801
5633
  try {
@@ -5807,12 +5639,12 @@ var __publicField = (obj, key, value) => {
5807
5639
  blocks: []
5808
5640
  });
5809
5641
  } catch (e) {
5810
- this.dispatch(addForm(userForm));
5811
- if (userFormRevisions && userFormRevisions.length > 0) {
5812
- this.dispatch(addFormRevisions(userFormRevisions));
5642
+ this.dispatch(addForm(form));
5643
+ if (formRevisions && formRevisions.length > 0) {
5644
+ this.dispatch(addFormRevisions(formRevisions));
5813
5645
  }
5814
- if (userFormSubmissions && userFormSubmissions.length > 0) {
5815
- this.dispatch(addFormSubmissions(userFormSubmissions));
5646
+ if (formSubmissions && formSubmissions.length > 0) {
5647
+ this.dispatch(addFormSubmissions(formSubmissions));
5816
5648
  }
5817
5649
  throw e;
5818
5650
  }
@@ -5898,7 +5730,7 @@ var __publicField = (obj, key, value) => {
5898
5730
  }
5899
5731
  return { values: newValues, files };
5900
5732
  };
5901
- class UserFormSubmissionService extends BaseApiService {
5733
+ class FormSubmissionService extends BaseUploadService {
5902
5734
  constructor() {
5903
5735
  super(...arguments);
5904
5736
  // Attach files to submission, after uploading them to S3
@@ -5979,7 +5811,6 @@ var __publicField = (obj, key, value) => {
5979
5811
  // TODO: adapt the support bulk adding to any model type
5980
5812
  async bulkAdd(args, batchSize) {
5981
5813
  const { formRevision, commonFieldValues, fieldValuesByAsset } = args;
5982
- const allFilesRecord = {};
5983
5814
  const { values: fileSeperatedCommonFieldValues, files: commonFiles } = separateFilesFromValues(commonFieldValues);
5984
5815
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
5985
5816
  const transactionId = uuid.v4();
@@ -6021,7 +5852,6 @@ var __publicField = (obj, key, value) => {
6021
5852
  file_type: file.type,
6022
5853
  size: file.size
6023
5854
  };
6024
- allFilesRecord[sha1] = filePayload;
6025
5855
  filePaylods.push(filePayload);
6026
5856
  }
6027
5857
  return {
@@ -6057,22 +5887,7 @@ var __publicField = (obj, key, value) => {
6057
5887
  blocks: blocks2
6058
5888
  });
6059
5889
  void promise.then(({ presigned_urls }) => {
6060
- for (const [sha1, presignedUrl] of Object.entries(presigned_urls)) {
6061
- const file = allFilesRecord[sha1];
6062
- if (!file)
6063
- continue;
6064
- void this.enqueueRequest({
6065
- url: presignedUrl.url,
6066
- description: "Upload file",
6067
- method: HttpMethod.POST,
6068
- isExternalUrl: true,
6069
- isAuthNeeded: false,
6070
- attachmentHash: sha1,
6071
- blockers: [`s3-${file.sha1}.${file.extension}`],
6072
- blocks: [sha1],
6073
- s3url: presignedUrl
6074
- });
6075
- }
5890
+ this.processPresignedUrls(presigned_urls);
6076
5891
  });
6077
5892
  prevBatchId = batchId;
6078
5893
  batchPromises.push(promise);
@@ -6543,7 +6358,7 @@ var __publicField = (obj, key, value) => {
6543
6358
  });
6544
6359
  }
6545
6360
  async update(organization) {
6546
- const promise = this.enqueueRequest({
6361
+ return this.enqueueRequest({
6547
6362
  description: "Edit organization",
6548
6363
  method: HttpMethod.PATCH,
6549
6364
  url: `/organizations/${organization.id}/`,
@@ -6551,10 +6366,6 @@ var __publicField = (obj, key, value) => {
6551
6366
  blockers: [`add-org-${organization.name}`, organization.id.toString()],
6552
6367
  blocks: [organization.id.toString()]
6553
6368
  });
6554
- return promise.then((result) => {
6555
- this.dispatch(updateActiveOrganization(organization));
6556
- return result;
6557
- });
6558
6369
  }
6559
6370
  async invite(organizationId, email) {
6560
6371
  return this.enqueueRequest({
@@ -7132,6 +6943,179 @@ var __publicField = (obj, key, value) => {
7132
6943
  this.dispatch(setUsers(Object.values(usersRecord)));
7133
6944
  }
7134
6945
  }
6946
+ class GeoImageService extends BaseUploadService {
6947
+ async add(payload) {
6948
+ const { store } = this.client;
6949
+ const { file, ...payloadWithoutFile } = payload;
6950
+ const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
6951
+ const currentUser = store.getState().userReducer.currentUser;
6952
+ const projectId = payloadWithoutFile.project;
6953
+ const sha1 = await hashFile(file);
6954
+ const filePayload = {
6955
+ sha1,
6956
+ file_type: file.type,
6957
+ extension: file.name.split(".").pop(),
6958
+ size: file.size
6959
+ };
6960
+ const offlineMapImage = offline({
6961
+ ...payloadWithoutFile,
6962
+ file_name: file.name,
6963
+ file_sha1: sha1,
6964
+ file: URL.createObjectURL(file),
6965
+ submitted_at: submittedAt,
6966
+ created_by: currentUser.id
6967
+ });
6968
+ store.dispatch(addGeoImage(offlineMapImage));
6969
+ const promise = this.enqueueRequest({
6970
+ description: "Add geo image",
6971
+ method: HttpMethod.POST,
6972
+ url: "/geo-images/",
6973
+ payload: {
6974
+ offline_id: offlineMapImage.offline_id,
6975
+ submitted_at: submittedAt,
6976
+ title: offlineMapImage.title,
6977
+ description: offlineMapImage.description,
6978
+ geo_marker: offlineMapImage.geo_marker,
6979
+ canvas_marker: offlineMapImage.canvas_marker,
6980
+ sha1: offlineMapImage.file_sha1,
6981
+ project: offlineMapImage.project,
6982
+ file_name: offlineMapImage.file_name,
6983
+ direction: offlineMapImage.direction,
6984
+ original_date: offlineMapImage.original_date,
6985
+ file: filePayload
6986
+ },
6987
+ blocks: [projectId.toString()],
6988
+ blockers: [projectId.toString()]
6989
+ });
6990
+ promise.then((result) => {
6991
+ this.processPresignedUrls(result.presigned_urls);
6992
+ store.dispatch(setGeoImage(result.geo_image));
6993
+ }).catch(() => {
6994
+ store.dispatch(deleteGeoImage(offlineMapImage.offline_id));
6995
+ });
6996
+ return [offlineMapImage, promise.then((result) => result.geo_image)];
6997
+ }
6998
+ async bulkAdd(payloads, projectId) {
6999
+ const { store } = this.client;
7000
+ const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7001
+ const currentUser = store.getState().userReducer.currentUser;
7002
+ const offlineGeoImages = [];
7003
+ const offlineIds = [];
7004
+ const geoImagePayloads = [];
7005
+ const filePayloadRecord = {};
7006
+ for (const payloadAndFile of payloads) {
7007
+ const { file, ...payload } = payloadAndFile;
7008
+ const sha1 = await hashFile(file);
7009
+ if (!(sha1 in filePayloadRecord)) {
7010
+ filePayloadRecord[sha1] = {
7011
+ sha1,
7012
+ file_type: file.type,
7013
+ extension: file.name.split(".").pop(),
7014
+ size: file.size
7015
+ };
7016
+ await this.client.files.addCache(file, sha1);
7017
+ }
7018
+ const offlineMapImage = offline({
7019
+ ...payload,
7020
+ file_name: file.name,
7021
+ file_sha1: sha1,
7022
+ file: URL.createObjectURL(file),
7023
+ submitted_at: submittedAt,
7024
+ created_by: currentUser.id,
7025
+ project: projectId
7026
+ });
7027
+ offlineGeoImages.push(offlineMapImage);
7028
+ offlineIds.push(offlineMapImage.offline_id);
7029
+ geoImagePayloads.push({
7030
+ offline_id: offlineMapImage.offline_id,
7031
+ sha1: offlineMapImage.file_sha1,
7032
+ file_name: offlineMapImage.file_name,
7033
+ title: offlineMapImage.title,
7034
+ description: offlineMapImage.description,
7035
+ geo_marker: offlineMapImage.geo_marker,
7036
+ canvas_marker: offlineMapImage.canvas_marker,
7037
+ direction: offlineMapImage.direction,
7038
+ original_date: offlineMapImage.original_date
7039
+ });
7040
+ }
7041
+ store.dispatch(addGeoImages(offlineGeoImages));
7042
+ const promise = this.enqueueRequest({
7043
+ description: "Bulk add geo images",
7044
+ method: HttpMethod.POST,
7045
+ url: "/geo-images/bulk/",
7046
+ payload: {
7047
+ submitted_at: submittedAt,
7048
+ project: projectId,
7049
+ geo_images: geoImagePayloads,
7050
+ files: Object.values(filePayloadRecord)
7051
+ },
7052
+ blocks: [projectId.toString()],
7053
+ blockers: offlineIds
7054
+ });
7055
+ promise.then((result) => {
7056
+ this.processPresignedUrls(result.presigned_urls);
7057
+ store.dispatch(setGeoImages(result.geo_images));
7058
+ }).catch(() => {
7059
+ store.dispatch(deleteGeoImages(offlineIds));
7060
+ });
7061
+ return [offlineGeoImages, promise.then((result) => result.geo_images)];
7062
+ }
7063
+ update(payload) {
7064
+ const { store } = this.client;
7065
+ const state = store.getState();
7066
+ const geoImageToUpdate = selectGeoImageById(payload.offline_id)(state);
7067
+ if (!geoImageToUpdate) {
7068
+ throw new Error(`Map image with offline_id ${payload.offline_id} does not exist in the store`);
7069
+ }
7070
+ const updatedGeoImage = { ...geoImageToUpdate, ...payload };
7071
+ store.dispatch(updateGeoImage(updatedGeoImage));
7072
+ const promise = this.enqueueRequest({
7073
+ description: "Update geo image",
7074
+ method: HttpMethod.PATCH,
7075
+ url: `/geo-images/${payload.offline_id}/`,
7076
+ payload,
7077
+ blocks: [payload.offline_id],
7078
+ blockers: [payload.offline_id]
7079
+ });
7080
+ promise.then((result) => {
7081
+ store.dispatch(setGeoImage(result));
7082
+ }).catch(() => {
7083
+ store.dispatch(setGeoImage(geoImageToUpdate));
7084
+ });
7085
+ return [updatedGeoImage, promise];
7086
+ }
7087
+ async delete(geoImageId) {
7088
+ const { store } = this.client;
7089
+ const state = store.getState();
7090
+ const geoImageToDelete = selectGeoImageById(geoImageId)(state);
7091
+ if (!geoImageToDelete) {
7092
+ throw new Error(`Map image with offline_id ${geoImageId} does not exist in the store`);
7093
+ }
7094
+ store.dispatch(deleteGeoImage(geoImageId));
7095
+ const promise = this.enqueueRequest({
7096
+ description: "Delete geo image",
7097
+ method: HttpMethod.DELETE,
7098
+ url: `/geo-images/${geoImageId}/`,
7099
+ blocks: [geoImageId],
7100
+ blockers: [geoImageId]
7101
+ });
7102
+ promise.catch(() => {
7103
+ store.dispatch(setGeoImage(geoImageToDelete));
7104
+ });
7105
+ return promise;
7106
+ }
7107
+ async refreshStore(projectId) {
7108
+ const { store } = this.client;
7109
+ const result = await this.enqueueRequest({
7110
+ description: "Get geo images",
7111
+ method: HttpMethod.GET,
7112
+ url: `/projects/${projectId}/geo-images/`,
7113
+ blocks: [projectId.toString()],
7114
+ blockers: []
7115
+ });
7116
+ store.dispatch(initializeGeoImages(result));
7117
+ }
7118
+ }
7135
7119
  exports2.APIError = APIError;
7136
7120
  exports2.AgentService = AgentService;
7137
7121
  exports2.AssetAttachmentService = AssetAttachmentService;
@@ -7154,7 +7138,10 @@ var __publicField = (obj, key, value) => {
7154
7138
  exports2.EmailDomainsService = EmailDomainsService;
7155
7139
  exports2.EmailVerificationService = EmailVerificationService;
7156
7140
  exports2.FileService = FileService;
7141
+ exports2.FormService = FormService;
7142
+ exports2.FormSubmissionService = FormSubmissionService;
7157
7143
  exports2.GREEN = GREEN;
7144
+ exports2.GeoImageService = GeoImageService;
7158
7145
  exports2.HttpMethod = HttpMethod;
7159
7146
  exports2.IssueAttachmentService = IssueAttachmentService;
7160
7147
  exports2.IssueCommentService = IssueCommentService;
@@ -7180,8 +7167,6 @@ var __publicField = (obj, key, value) => {
7180
7167
  exports2.ProjectFileService = ProjectFileService;
7181
7168
  exports2.ProjectService = ProjectService;
7182
7169
  exports2.TeamService = TeamService;
7183
- exports2.UserFormService = UserFormService;
7184
- exports2.UserFormSubmissionService = UserFormSubmissionService;
7185
7170
  exports2.UserService = UserService;
7186
7171
  exports2.VERSION_REDUCER_KEY = VERSION_REDUCER_KEY;
7187
7172
  exports2.VerificationCodeType = VerificationCodeType;
@@ -7216,6 +7201,8 @@ var __publicField = (obj, key, value) => {
7216
7201
  exports2.addFormSubmissionAttachments = addFormSubmissionAttachments;
7217
7202
  exports2.addFormSubmissions = addFormSubmissions;
7218
7203
  exports2.addForms = addForms;
7204
+ exports2.addGeoImage = addGeoImage;
7205
+ exports2.addGeoImages = addGeoImages;
7219
7206
  exports2.addIssue = addIssue;
7220
7207
  exports2.addIssueAttachment = addIssueAttachment;
7221
7208
  exports2.addIssueAttachments = addIssueAttachments;
@@ -7291,6 +7278,8 @@ var __publicField = (obj, key, value) => {
7291
7278
  exports2.deleteFormSubmissionAttachment = deleteFormSubmissionAttachment;
7292
7279
  exports2.deleteFormSubmissionAttachments = deleteFormSubmissionAttachments;
7293
7280
  exports2.deleteFormSubmissions = deleteFormSubmissions;
7281
+ exports2.deleteGeoImage = deleteGeoImage;
7282
+ exports2.deleteGeoImages = deleteGeoImages;
7294
7283
  exports2.deleteIssue = deleteIssue;
7295
7284
  exports2.deleteIssueAttachment = deleteIssueAttachment;
7296
7285
  exports2.deleteIssueAttachments = deleteIssueAttachments;
@@ -7324,6 +7313,7 @@ var __publicField = (obj, key, value) => {
7324
7313
  exports2.fileReducer = fileReducer;
7325
7314
  exports2.fileSlice = fileSlice;
7326
7315
  exports2.fileToBlob = fileToBlob;
7316
+ exports2.flipBounds = flipBounds;
7327
7317
  exports2.flipCoordinates = flipCoordinates;
7328
7318
  exports2.formReducer = formReducer;
7329
7319
  exports2.formRevisionAttachmentReducer = formRevisionAttachmentReducer;
@@ -7338,6 +7328,8 @@ var __publicField = (obj, key, value) => {
7338
7328
  exports2.fullAssetMarkerSize = fullAssetMarkerSize;
7339
7329
  exports2.generateBadgeColors = generateBadgeColors;
7340
7330
  exports2.genericMemo = genericMemo;
7331
+ exports2.geoImageReducer = geoImageReducer;
7332
+ exports2.geoImageSlice = geoImageSlice;
7341
7333
  exports2.getFileIdentifier = getFileIdentifier;
7342
7334
  exports2.getFileS3Key = getFileS3Key;
7343
7335
  exports2.getLocalDateString = getLocalDateString;
@@ -7346,8 +7338,6 @@ var __publicField = (obj, key, value) => {
7346
7338
  exports2.getRenamedFile = getRenamedFile;
7347
7339
  exports2.getStageColor = getStageColor;
7348
7340
  exports2.hashFile = hashFile;
7349
- exports2.hideAllCategories = hideAllCategories;
7350
- exports2.hideCategory = hideCategory;
7351
7341
  exports2.initSDK = initSDK;
7352
7342
  exports2.initializeAssetAttachments = initializeAssetAttachments;
7353
7343
  exports2.initializeAssetTypeAttachments = initializeAssetTypeAttachments;
@@ -7360,6 +7350,7 @@ var __publicField = (obj, key, value) => {
7360
7350
  exports2.initializeFormRevisionAttachments = initializeFormRevisionAttachments;
7361
7351
  exports2.initializeFormRevisions = initializeFormRevisions;
7362
7352
  exports2.initializeFormSubmissionAttachments = initializeFormSubmissionAttachments;
7353
+ exports2.initializeGeoImages = initializeGeoImages;
7363
7354
  exports2.initializeIssueAttachments = initializeIssueAttachments;
7364
7355
  exports2.initializeIssueTypes = initializeIssueTypes;
7365
7356
  exports2.initializeIssueUpdates = initializeIssueUpdates;
@@ -7432,18 +7423,12 @@ var __publicField = (obj, key, value) => {
7432
7423
  exports2.searchIssues = searchIssues;
7433
7424
  exports2.selectAccessToken = selectAccessToken;
7434
7425
  exports2.selectActiveLicense = selectActiveLicense;
7435
- exports2.selectActiveOrganization = selectActiveOrganization;
7436
7426
  exports2.selectActiveOrganizationAccess = selectActiveOrganizationAccess;
7437
- exports2.selectActiveOrganizationId = selectActiveOrganizationId;
7438
- exports2.selectActiveOrganizationLicenses = selectActiveOrganizationLicenses;
7439
- exports2.selectActiveOrganizationProjects = selectActiveOrganizationProjects;
7440
7427
  exports2.selectActiveProject = selectActiveProject;
7441
7428
  exports2.selectActiveProjectAccess = selectActiveProjectAccess;
7442
7429
  exports2.selectActiveProjectFileId = selectActiveProjectFileId;
7443
7430
  exports2.selectActiveProjectId = selectActiveProjectId;
7444
7431
  exports2.selectActiveStatusLicenses = selectActiveStatusLicenses;
7445
- exports2.selectActiveWorkspace = selectActiveWorkspace;
7446
- exports2.selectActiveWorkspaceId = selectActiveWorkspaceId;
7447
7432
  exports2.selectAllDocumentAttachments = selectAllDocumentAttachments;
7448
7433
  exports2.selectAllProjectAttachments = selectAllProjectAttachments;
7449
7434
  exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
@@ -7480,7 +7465,6 @@ var __publicField = (obj, key, value) => {
7480
7465
  exports2.selectCategoriesOfWorkspace = selectCategoriesOfWorkspace;
7481
7466
  exports2.selectCategoryById = selectCategoryById;
7482
7467
  exports2.selectCategoryMapping = selectCategoryMapping;
7483
- exports2.selectCategoryVisibility = selectCategoryVisibility;
7484
7468
  exports2.selectCommentsOfIssue = selectCommentsOfIssue;
7485
7469
  exports2.selectCompletedStageIdsForAsset = selectCompletedStageIdsForAsset;
7486
7470
  exports2.selectCompletedStages = selectCompletedStages;
@@ -7497,8 +7481,6 @@ var __publicField = (obj, key, value) => {
7497
7481
  exports2.selectEmailDomains = selectEmailDomains;
7498
7482
  exports2.selectEmailDomainsAsMapping = selectEmailDomainsAsMapping;
7499
7483
  exports2.selectEmailDomainsOfOrganization = selectEmailDomainsOfOrganization;
7500
- exports2.selectEnabledProjectFileMapping = selectEnabledProjectFileMapping;
7501
- exports2.selectEnabledProjectFiles = selectEnabledProjectFiles;
7502
7484
  exports2.selectFavouriteProjects = selectFavouriteProjects;
7503
7485
  exports2.selectFilteredForms = selectFilteredForms;
7504
7486
  exports2.selectForm = selectForm;
@@ -7506,6 +7488,7 @@ var __publicField = (obj, key, value) => {
7506
7488
  exports2.selectFormOfAssetType = selectFormOfAssetType;
7507
7489
  exports2.selectFormOfIssueType = selectFormOfIssueType;
7508
7490
  exports2.selectFormRevision = selectFormRevision;
7491
+ exports2.selectFormRevisionAttachmentsMapping = selectFormRevisionAttachmentsMapping;
7509
7492
  exports2.selectFormRevisionMapping = selectFormRevisionMapping;
7510
7493
  exports2.selectFormRevisions = selectFormRevisions;
7511
7494
  exports2.selectFormRevisionsOfForm = selectFormRevisionsOfForm;
@@ -7522,8 +7505,10 @@ var __publicField = (obj, key, value) => {
7522
7505
  exports2.selectFormsCount = selectFormsCount;
7523
7506
  exports2.selectFormsMapping = selectFormsMapping;
7524
7507
  exports2.selectGeneralFormCount = selectGeneralFormCount;
7525
- exports2.selectHiddenAssetTypeIds = selectHiddenAssetTypeIds;
7526
- exports2.selectHiddenCategoryCount = selectHiddenCategoryCount;
7508
+ exports2.selectGeoImageById = selectGeoImageById;
7509
+ exports2.selectGeoImageMapping = selectGeoImageMapping;
7510
+ exports2.selectGeoImages = selectGeoImages;
7511
+ exports2.selectGeoImagesOfProject = selectGeoImagesOfProject;
7527
7512
  exports2.selectIsFetchingInitialData = selectIsFetchingInitialData;
7528
7513
  exports2.selectIsImportingProjectFile = selectIsImportingProjectFile;
7529
7514
  exports2.selectIsLoggedIn = selectIsLoggedIn;
@@ -7540,7 +7525,6 @@ var __publicField = (obj, key, value) => {
7540
7525
  exports2.selectIssueTypesOfOrganization = selectIssueTypesOfOrganization;
7541
7526
  exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
7542
7527
  exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
7543
- exports2.selectIssues = selectIssues;
7544
7528
  exports2.selectIssuesOfIssueType = selectIssuesOfIssueType;
7545
7529
  exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
7546
7530
  exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
@@ -7551,6 +7535,7 @@ var __publicField = (obj, key, value) => {
7551
7535
  exports2.selectLicenseForProject = selectLicenseForProject;
7552
7536
  exports2.selectLicenses = selectLicenses;
7553
7537
  exports2.selectLicensesForProjectsMapping = selectLicensesForProjectsMapping;
7538
+ exports2.selectLicensesOfOrganization = selectLicensesOfOrganization;
7554
7539
  exports2.selectMainWorkspace = selectMainWorkspace;
7555
7540
  exports2.selectNumberOfAssetTypesMatchingCaseInsensitiveName = selectNumberOfAssetTypesMatchingCaseInsensitiveName;
7556
7541
  exports2.selectNumberOfAssetsOfAssetType = selectNumberOfAssetsOfAssetType;
@@ -7559,6 +7544,7 @@ var __publicField = (obj, key, value) => {
7559
7544
  exports2.selectOrganizationAccessForUser = selectOrganizationAccessForUser;
7560
7545
  exports2.selectOrganizationAccessUserMapping = selectOrganizationAccessUserMapping;
7561
7546
  exports2.selectOrganizationAccesses = selectOrganizationAccesses;
7547
+ exports2.selectOrganizationById = selectOrganizationById;
7562
7548
  exports2.selectOrganizationUsersAsMapping = selectOrganizationUsersAsMapping;
7563
7549
  exports2.selectOrganizationUsersIds = selectOrganizationUsersIds;
7564
7550
  exports2.selectOrganizations = selectOrganizations;
@@ -7573,21 +7559,21 @@ var __publicField = (obj, key, value) => {
7573
7559
  exports2.selectProjectAccesses = selectProjectAccesses;
7574
7560
  exports2.selectProjectAttachment = selectProjectAttachment;
7575
7561
  exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
7576
- exports2.selectProjectFileVisibility = selectProjectFileVisibility;
7562
+ exports2.selectProjectFileById = selectProjectFileById;
7563
+ exports2.selectProjectFileMapping = selectProjectFileMapping;
7577
7564
  exports2.selectProjectFiles = selectProjectFiles;
7578
7565
  exports2.selectProjectUsersAsMapping = selectProjectUsersAsMapping;
7579
7566
  exports2.selectProjectUsersIds = selectProjectUsersIds;
7580
7567
  exports2.selectProjects = selectProjects;
7568
+ exports2.selectProjectsOfOrganization = selectProjectsOfOrganization;
7581
7569
  exports2.selectProjectsWithAccess = selectProjectsWithAccess;
7582
7570
  exports2.selectRecentIssueIds = selectRecentIssueIds;
7583
7571
  exports2.selectRecentIssuesAsSearchResults = selectRecentIssuesAsSearchResults;
7584
7572
  exports2.selectRehydrated = selectRehydrated;
7585
7573
  exports2.selectRootDocuments = selectRootDocuments;
7586
7574
  exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
7587
- exports2.selectSortedOrganizationLicenses = selectSortedOrganizationLicenses;
7588
7575
  exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
7589
7576
  exports2.selectSortedProjectUsers = selectSortedProjectUsers;
7590
- exports2.selectSortedProjects = selectSortedProjects;
7591
7577
  exports2.selectStage = selectStage;
7592
7578
  exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
7593
7579
  exports2.selectStageMapping = selectStageMapping;
@@ -7602,17 +7588,12 @@ var __publicField = (obj, key, value) => {
7602
7588
  exports2.selectTeamsOfUser = selectTeamsOfUser;
7603
7589
  exports2.selectUploadUrl = selectUploadUrl;
7604
7590
  exports2.selectUser = selectUser;
7605
- exports2.selectUserFormRevisionAttachmentsMapping = selectUserFormRevisionAttachmentsMapping;
7606
7591
  exports2.selectUsersAsMapping = selectUsersAsMapping;
7607
- exports2.selectVisibleStatuses = selectVisibleStatuses;
7608
- exports2.selectVisibleUserIds = selectVisibleUserIds;
7609
- exports2.selectWorkspace = selectWorkspace;
7592
+ exports2.selectWorkspaceById = selectWorkspaceById;
7610
7593
  exports2.selectWorkspaceMapping = selectWorkspaceMapping;
7611
7594
  exports2.selectWorkspaces = selectWorkspaces;
7612
- exports2.setActiveOrganizationId = setActiveOrganizationId;
7613
7595
  exports2.setActiveProjectFileId = setActiveProjectFileId;
7614
7596
  exports2.setActiveProjectId = setActiveProjectId;
7615
- exports2.setActiveWorkspaceId = setActiveWorkspaceId;
7616
7597
  exports2.setAsset = setAsset;
7617
7598
  exports2.setAssetAttachment = setAssetAttachment;
7618
7599
  exports2.setAssetAttachments = setAssetAttachments;
@@ -7633,6 +7614,8 @@ var __publicField = (obj, key, value) => {
7633
7614
  exports2.setFormSubmissionAttachments = setFormSubmissionAttachments;
7634
7615
  exports2.setFormSubmissions = setFormSubmissions;
7635
7616
  exports2.setForms = setForms;
7617
+ exports2.setGeoImage = setGeoImage;
7618
+ exports2.setGeoImages = setGeoImages;
7636
7619
  exports2.setIsFetchingInitialData = setIsFetchingInitialData;
7637
7620
  exports2.setIsImportingProjectFile = setIsImportingProjectFile;
7638
7621
  exports2.setIssueAttachment = setIssueAttachment;
@@ -7648,7 +7631,6 @@ var __publicField = (obj, key, value) => {
7648
7631
  exports2.setProjectAccesses = setProjectAccesses;
7649
7632
  exports2.setProjectAttachment = setProjectAttachment;
7650
7633
  exports2.setProjectAttachments = setProjectAttachments;
7651
- exports2.setProjectFileVisible = setProjectFileVisible;
7652
7634
  exports2.setProjects = setProjects;
7653
7635
  exports2.setRehydrated = setRehydrated;
7654
7636
  exports2.setStage = setStage;
@@ -7659,8 +7641,6 @@ var __publicField = (obj, key, value) => {
7659
7641
  exports2.setTourStep = setTourStep;
7660
7642
  exports2.setUploadUrl = setUploadUrl;
7661
7643
  exports2.setUsers = setUsers;
7662
- exports2.setVisibleStatuses = setVisibleStatuses;
7663
- exports2.setVisibleUserIds = setVisibleUserIds;
7664
7644
  exports2.setWorkspaces = setWorkspaces;
7665
7645
  exports2.settingReducer = settingReducer;
7666
7646
  exports2.settingSlice = settingSlice;
@@ -7672,11 +7652,7 @@ var __publicField = (obj, key, value) => {
7672
7652
  exports2.teamSlice = teamSlice;
7673
7653
  exports2.toFileNameSafeString = toFileNameSafeString;
7674
7654
  exports2.toOfflineIdRecord = toOfflineIdRecord;
7675
- exports2.toggleAssetTypeVisibility = toggleAssetTypeVisibility;
7676
7655
  exports2.truncate = truncate;
7677
- exports2.unhideAllCategories = unhideAllCategories;
7678
- exports2.unhideCategory = unhideCategory;
7679
- exports2.updateActiveOrganization = updateActiveOrganization;
7680
7656
  exports2.updateAsset = updateAsset;
7681
7657
  exports2.updateAssetAttachment = updateAssetAttachment;
7682
7658
  exports2.updateAssetAttachments = updateAssetAttachments;
@@ -7695,6 +7671,8 @@ var __publicField = (obj, key, value) => {
7695
7671
  exports2.updateFormSubmissionAttachment = updateFormSubmissionAttachment;
7696
7672
  exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
7697
7673
  exports2.updateFormSubmissions = updateFormSubmissions;
7674
+ exports2.updateGeoImage = updateGeoImage;
7675
+ exports2.updateGeoImages = updateGeoImages;
7698
7676
  exports2.updateIssue = updateIssue;
7699
7677
  exports2.updateIssueAttachment = updateIssueAttachment;
7700
7678
  exports2.updateIssueAttachments = updateIssueAttachments;