@overmap-ai/core 1.0.71-fields.4 → 1.0.71-fields.5

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.
@@ -2093,17 +2093,6 @@ var __publicField = (obj, key, value) => {
2093
2093
  }
2094
2094
  )
2095
2095
  );
2096
- const selectLatestFormRevisionByForm = toolkit.createSelector([selectFormRevisionMapping], (revisions) => {
2097
- const latestRevisions = {};
2098
- for (const revision of Object.values(revisions)) {
2099
- const formId = revision.form;
2100
- const currentLatestRevision = latestRevisions[formId];
2101
- if (!currentLatestRevision || currentLatestRevision.revision < revision.revision) {
2102
- latestRevisions[formId] = revision;
2103
- }
2104
- }
2105
- return latestRevisions;
2106
- });
2107
2096
  const formRevisionReducer = formRevisionsSlice.reducer;
2108
2097
  const formAdapter = createModelAdapter((form) => form.offline_id);
2109
2098
  const initialState$n = formAdapter.getInitialState({});
@@ -2128,6 +2117,9 @@ var __publicField = (obj, key, value) => {
2128
2117
  const selectForms = toolkit.createSelector([selectFormMapping], (formsMapping) => {
2129
2118
  return Object.values(formsMapping);
2130
2119
  });
2120
+ const selectFormById = (formId) => (state) => {
2121
+ return state.formReducer.instances[formId];
2122
+ };
2131
2123
  const selectFilteredForms = restructureCreateSelectorWithArgs(
2132
2124
  toolkit.createSelector(
2133
2125
  [
@@ -2153,15 +2145,6 @@ var __publicField = (obj, key, value) => {
2153
2145
  { memoizeOptions: { equalityCheck: shallowEqual } }
2154
2146
  )
2155
2147
  );
2156
- const selectFormById = (formId) => (state) => {
2157
- return state.formReducer.instances[formId];
2158
- };
2159
- const selectFormsCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
2160
- return Object.keys(formsMapping).length;
2161
- });
2162
- const selectGeneralFormCount = toolkit.createSelector([selectFormMapping], (formsMapping) => {
2163
- return Object.values(formsMapping).length;
2164
- });
2165
2148
  const submissionAdapter = createModelAdapter((submission) => submission.offline_id);
2166
2149
  const initialState$m = submissionAdapter.getInitialState({});
2167
2150
  const formSubmissionSlice = toolkit.createSlice({
@@ -2223,43 +2206,6 @@ var __publicField = (obj, key, value) => {
2223
2206
  }
2224
2207
  )
2225
2208
  );
2226
- const selectFormSubmissionsByFormRevisions = toolkit.createSelector([selectFormRevisionMapping, selectFormSubmissions], (revisions, submissions) => {
2227
- var _a2;
2228
- const submissionMapping = {};
2229
- for (const revisionId in revisions) {
2230
- submissionMapping[revisionId] = [];
2231
- }
2232
- for (const submission of submissions) {
2233
- (_a2 = submissionMapping[submission.form_revision]) == null ? void 0 : _a2.push(submission);
2234
- }
2235
- return submissionMapping;
2236
- });
2237
- const selectSortedFormSubmissionsOfForm = restructureCreateSelectorWithArgs(
2238
- toolkit.createSelector(
2239
- [
2240
- selectFormRevisionMapping,
2241
- selectFormSubmissionsByFormRevisions,
2242
- (_state, formId) => formId
2243
- ],
2244
- (revisionsMapping, submissionsByRevision, formId) => {
2245
- const submissionsByFormRevisions = {};
2246
- for (const revisionId in revisionsMapping) {
2247
- const revision = revisionsMapping[revisionId];
2248
- const submissionsOfRevision = submissionsByRevision[revisionId];
2249
- if (revision && submissionsOfRevision && revision.form === formId) {
2250
- submissionsByFormRevisions[revisionId] = submissionsOfRevision.sort(
2251
- (a, b) => a.submitted_at < b.submitted_at ? -1 : 1
2252
- );
2253
- }
2254
- }
2255
- return Object.entries(submissionsByFormRevisions).sort((a, b) => {
2256
- const aRevision = revisionsMapping[a[0]];
2257
- const bRevision = revisionsMapping[b[0]];
2258
- return formRevisionSortFn(aRevision, bRevision);
2259
- }).map(([_revisionId, submissions]) => submissions).flat();
2260
- }
2261
- )
2262
- );
2263
2209
  const selectFormSubmissionsOfIssue = restructureCreateSelectorWithArgs(
2264
2210
  toolkit.createSelector(
2265
2211
  [selectFormSubmissions, (_state, issueId) => issueId],
@@ -8617,14 +8563,11 @@ var __publicField = (obj, key, value) => {
8617
8563
  exports2.selectFormSubmissionAttachmentsMapping = selectFormSubmissionAttachmentsMapping;
8618
8564
  exports2.selectFormSubmissionById = selectFormSubmissionById;
8619
8565
  exports2.selectFormSubmissions = selectFormSubmissions;
8620
- exports2.selectFormSubmissionsByFormRevisions = selectFormSubmissionsByFormRevisions;
8621
8566
  exports2.selectFormSubmissionsMapping = selectFormSubmissionsMapping;
8622
8567
  exports2.selectFormSubmissionsOfAsset = selectFormSubmissionsOfAsset;
8623
8568
  exports2.selectFormSubmissionsOfForm = selectFormSubmissionsOfForm;
8624
8569
  exports2.selectFormSubmissionsOfIssue = selectFormSubmissionsOfIssue;
8625
8570
  exports2.selectForms = selectForms;
8626
- exports2.selectFormsCount = selectFormsCount;
8627
- exports2.selectGeneralFormCount = selectGeneralFormCount;
8628
8571
  exports2.selectGeoImageById = selectGeoImageById;
8629
8572
  exports2.selectGeoImageMapping = selectGeoImageMapping;
8630
8573
  exports2.selectGeoImages = selectGeoImages;
@@ -8671,7 +8614,6 @@ var __publicField = (obj, key, value) => {
8671
8614
  exports2.selectIssuesOfIssueType = selectIssuesOfIssueType;
8672
8615
  exports2.selectIssuesOfIssueTypeCount = selectIssuesOfIssueTypeCount;
8673
8616
  exports2.selectLatestAssetTypeFieldsOfAssetType = selectLatestAssetTypeFieldsOfAssetType;
8674
- exports2.selectLatestFormRevisionByForm = selectLatestFormRevisionByForm;
8675
8617
  exports2.selectLatestFormRevisionOfForm = selectLatestFormRevisionOfForm;
8676
8618
  exports2.selectLatestIssueTypeFieldsOfIssueType = selectLatestIssueTypeFieldsOfIssueType;
8677
8619
  exports2.selectLatestRetryTime = selectLatestRetryTime;
@@ -8710,7 +8652,6 @@ var __publicField = (obj, key, value) => {
8710
8652
  exports2.selectProjectsOfOrganization = selectProjectsOfOrganization;
8711
8653
  exports2.selectRehydrated = selectRehydrated;
8712
8654
  exports2.selectRootDocuments = selectRootDocuments;
8713
- exports2.selectSortedFormSubmissionsOfForm = selectSortedFormSubmissionsOfForm;
8714
8655
  exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
8715
8656
  exports2.selectSortedProjectUsers = selectSortedProjectUsers;
8716
8657
  exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;