@overmap-ai/core 1.0.78-view-sets-cleanup.2 → 1.0.78-workflows.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/defaults.d.ts +1 -2
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/issue.d.ts +7 -5
- package/dist/enums/workflows.d.ts +5 -0
- package/dist/overmap-core.js +11119 -6871
- package/dist/overmap-core.umd.cjs +11 -11
- package/dist/sdk/base.d.ts +6 -2
- package/dist/sdk/constants.d.ts +4 -5
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/index.d.ts +5 -1
- package/dist/sdk/middleware/OfflineAnalyticsMiddleware.d.ts +6 -0
- package/dist/sdk/middleware/OfflineMiddleware.d.ts +13 -0
- package/dist/sdk/middleware/RateLimitingMiddleware.d.ts +6 -0
- package/dist/sdk/middleware/constants.d.ts +1 -0
- package/dist/sdk/middleware/index.d.ts +5 -0
- package/dist/sdk/middleware/utils.d.ts +2 -0
- package/dist/sdk/outbox/globals.d.ts +2 -0
- package/dist/sdk/{classes → outbox}/index.d.ts +1 -0
- package/dist/sdk/performRequest.d.ts +6 -0
- package/dist/sdk/services/AgentService.d.ts +2 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +25 -27
- package/dist/sdk/services/AssetProcedureService.d.ts +23 -6
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +20 -3
- package/dist/sdk/services/AssetProcedureStepFieldValuesService.d.ts +22 -12
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +20 -3
- package/dist/sdk/services/AssetProcedureStepFieldsService.d.ts +21 -4
- package/dist/sdk/services/AssetProcedureStepService.d.ts +21 -4
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +39 -0
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +33 -0
- package/dist/sdk/services/AssetProcedureTypeFieldValuesService.d.ts +33 -0
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/AssetProcedureTypeFieldsService.d.ts +26 -0
- package/dist/sdk/services/AssetProcedureTypeService.d.ts +28 -0
- package/dist/sdk/services/AssetService.d.ts +23 -5
- package/dist/sdk/services/AssetStageCompletionService.d.ts +21 -4
- package/dist/sdk/services/AssetStageService.d.ts +21 -4
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +25 -26
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +22 -10
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +21 -4
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeIdentifierService.d.ts +28 -0
- package/dist/sdk/services/AssetTypeIdentifierValueService.d.ts +28 -0
- package/dist/sdk/services/AssetTypeService.d.ts +21 -4
- package/dist/sdk/services/AssetTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/BaseModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseOfflineAttachmentModelService.d.ts +23 -0
- package/dist/sdk/services/BaseOfflineModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseService.d.ts +5 -3
- package/dist/sdk/services/CategoryService.d.ts +22 -5
- package/dist/sdk/services/DocumentAttachmentService.d.ts +25 -26
- package/dist/sdk/services/DocumentService.d.ts +22 -5
- package/dist/sdk/services/EmailDomainsService.d.ts +21 -4
- package/dist/sdk/services/FileService.d.ts +5 -1
- package/dist/sdk/services/FormIdentifierService.d.ts +28 -0
- package/dist/sdk/services/FormIdentifierValueService.d.ts +28 -0
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +20 -3
- package/dist/sdk/services/FormRevisionService.d.ts +20 -3
- package/dist/sdk/services/FormService.d.ts +20 -3
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +22 -5
- package/dist/sdk/services/FormSubmissionService.d.ts +22 -5
- package/dist/sdk/services/GeoImageService.d.ts +22 -5
- package/dist/sdk/services/IssueAssociationService.d.ts +21 -4
- package/dist/sdk/services/IssueAttachmentService.d.ts +25 -27
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +25 -27
- package/dist/sdk/services/IssueCommentService.d.ts +22 -5
- package/dist/sdk/services/IssueService.d.ts +23 -5
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +25 -27
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +21 -4
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +21 -4
- package/dist/sdk/services/IssueTypeIdentifierService.d.ts +28 -0
- package/dist/sdk/services/IssueTypeIdentifierValueService.d.ts +28 -0
- package/dist/sdk/services/IssueTypeService.d.ts +21 -4
- package/dist/sdk/services/IssueTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/IssueUpdateService.d.ts +186 -3
- package/dist/sdk/services/JWTAuthService.d.ts +1 -1
- package/dist/sdk/services/OrganizationAccessService.d.ts +21 -4
- package/dist/sdk/services/OrganizationService.d.ts +20 -3
- package/dist/sdk/services/ProjectAccessService.d.ts +24 -6
- package/dist/sdk/services/ProjectAttachmentService.d.ts +25 -26
- package/dist/sdk/services/ProjectFileService.d.ts +20 -3
- package/dist/sdk/services/ProjectService.d.ts +22 -5
- package/dist/sdk/services/TeamMembershipService.d.ts +22 -4
- package/dist/sdk/services/TeamService.d.ts +21 -4
- package/dist/sdk/services/UserService.d.ts +24 -3
- package/dist/sdk/services/WorkflowService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepAssigneeService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepCommentAttachmentService.d.ts +39 -0
- package/dist/sdk/services/WorkflowStepCommentService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepCompletionService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/WorkflowStepFieldValuesService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/WorkflowStepFieldsService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepReviewRequestService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepReviewService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepService.d.ts +28 -0
- package/dist/sdk/services/WorkflowTypeService.d.ts +28 -0
- package/dist/sdk/services/index.d.ts +30 -6
- package/dist/sdk/typings.d.ts +15 -58
- package/dist/sdk/utils.d.ts +2 -0
- package/dist/store/adapters/modelAdapter.d.ts +13 -14
- package/dist/store/adapters/typings.d.ts +19 -0
- package/dist/store/reducers.d.ts +81 -18
- package/dist/store/selectors/index.d.ts +1 -0
- package/dist/store/selectors/utils.d.ts +1 -0
- package/dist/store/slices/agentsSlice.d.ts +11 -38
- package/dist/store/slices/assetAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/assetProcedureSlice.d.ts +118 -41
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +38 -44
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +40 -45
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +38 -43
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +65 -49
- package/dist/store/slices/assetProcedureStepSlice.d.ts +42 -47
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +105 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +125 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +126 -0
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +125 -0
- package/dist/store/slices/assetProcedureTypeFieldsSlice.d.ts +23 -0
- package/dist/store/slices/assetProcedureTypeSlice.d.ts +22 -0
- package/dist/store/slices/assetSlice.d.ts +39 -45
- package/dist/store/slices/assetStageCompletionSlice.d.ts +38 -44
- package/dist/store/slices/assetStageSlice.d.ts +41 -47
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +38 -44
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +38 -43
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +38 -43
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +38 -43
- package/dist/store/slices/assetTypeIdentifierSlice.d.ts +22 -0
- package/dist/store/slices/assetTypeIdentifierValueSlice.d.ts +23 -0
- package/dist/store/slices/assetTypeSlice.d.ts +11 -38
- package/dist/store/slices/assetTypeStatusSlice.d.ts +125 -0
- package/dist/store/slices/categorySlice.d.ts +38 -44
- package/dist/store/slices/documentAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/documentSlice.d.ts +17 -24
- package/dist/store/slices/emailDomainsSlice.d.ts +40 -44
- package/dist/store/slices/formIdentifierSlice.d.ts +22 -0
- package/dist/store/slices/formIdentifierValueSlice.d.ts +23 -0
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +116 -37
- package/dist/store/slices/formRevisionSlice.d.ts +38 -43
- package/dist/store/slices/formSlice.d.ts +38 -43
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +13 -38
- package/dist/store/slices/formSubmissionSlice.d.ts +12 -40
- package/dist/store/slices/geoImageSlice.d.ts +38 -43
- package/dist/store/slices/index.d.ts +27 -6
- package/dist/store/slices/issueAssociationSlice.d.ts +38 -43
- package/dist/store/slices/issueAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/issueCommentAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/issueCommentSlice.d.ts +11 -37
- package/dist/store/slices/issueSlice.d.ts +11 -38
- package/dist/store/slices/issueTypeAttachmentSlice.d.ts +12 -38
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +38 -44
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +38 -43
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +38 -43
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +38 -43
- package/dist/store/slices/issueTypeIdentifierSlice.d.ts +22 -0
- package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +23 -0
- package/dist/store/slices/issueTypeSlice.d.ts +12 -43
- package/dist/store/slices/issueTypeStatusSlice.d.ts +125 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +262 -38
- package/dist/store/slices/organizationAccessSlice.d.ts +11 -37
- package/dist/store/slices/organizationSlice.d.ts +38 -43
- package/dist/store/slices/outboxSlice.d.ts +6 -7
- package/dist/store/slices/projectAccessSlice.d.ts +11 -37
- package/dist/store/slices/projectAttachmentSlice.d.ts +13 -39
- package/dist/store/slices/projectFileSlice.d.ts +39 -45
- package/dist/store/slices/projectSlice.d.ts +38 -43
- package/dist/store/slices/teamMembershipSlice.d.ts +11 -37
- package/dist/store/slices/teamSlice.d.ts +11 -38
- package/dist/store/slices/userSlice.d.ts +38 -44
- package/dist/store/slices/workflowSlice.d.ts +23 -0
- package/dist/store/slices/workflowStepAssigneeSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepCommentAttachmentSlice.d.ts +22 -0
- package/dist/store/slices/workflowStepCommentSlice.d.ts +126 -0
- package/dist/store/slices/workflowStepCompletionSlice.d.ts +126 -0
- package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +125 -0
- package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +125 -0
- package/dist/store/slices/workflowStepFieldsSlice.d.ts +230 -0
- package/dist/store/slices/workflowStepReviewRequestSlice.d.ts +126 -0
- package/dist/store/slices/workflowStepReviewSlice.d.ts +126 -0
- package/dist/store/slices/workflowStepSlice.d.ts +125 -0
- package/dist/store/slices/workflowTypeSlice.d.ts +22 -0
- package/dist/store/store.d.ts +4 -14
- package/dist/store/typings.d.ts +18 -1
- package/dist/typings/files.d.ts +15 -14
- package/dist/typings/index.d.ts +0 -3
- package/dist/typings/models/agents.d.ts +2 -1
- package/dist/typings/models/assets.d.ts +80 -51
- package/dist/typings/models/base.d.ts +19 -13
- package/dist/typings/models/categories.d.ts +5 -6
- package/dist/typings/models/documents.d.ts +6 -3
- package/dist/typings/models/emailDomain.d.ts +2 -1
- package/dist/typings/models/emailVerification.d.ts +7 -5
- package/dist/typings/models/fields.d.ts +7 -7
- package/dist/typings/models/forms.d.ts +15 -10
- package/dist/typings/models/geoImages.d.ts +7 -7
- package/dist/typings/models/index.d.ts +1 -2
- package/dist/typings/models/issues.d.ts +67 -31
- package/dist/typings/models/organizations.d.ts +1 -1
- package/dist/typings/models/projects.d.ts +8 -4
- package/dist/typings/models/teams.d.ts +4 -4
- package/dist/typings/models/users.d.ts +4 -2
- package/dist/typings/models/workflows.d.ts +67 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/models/assets.d.ts +5 -0
- package/dist/utils/models/documents.d.ts +4 -0
- package/dist/utils/models/index.d.ts +3 -0
- package/dist/utils/models/issues.d.ts +2 -0
- package/dist/utils/utils.d.ts +0 -7
- package/dist/utils/uuid.d.ts +7 -0
- package/package.json +35 -49
- package/dist/sdk/services/AssetProcedureAttachmentService.d.ts +0 -40
- package/dist/sdk/services/AssetProcedureFieldValuesAttachmentService.d.ts +0 -16
- package/dist/sdk/services/AssetProcedureFieldValuesService.d.ts +0 -22
- package/dist/sdk/services/AssetProcedureFieldsAttachmentService.d.ts +0 -13
- package/dist/sdk/services/AssetProcedureFieldsService.d.ts +0 -9
- package/dist/sdk/services/AssetProcedureInstanceService.d.ts +0 -11
- package/dist/sdk/services/BaseAttachmentService.d.ts +0 -38
- package/dist/sdk/services/BaseUploadService.d.ts +0 -10
- package/dist/store/slices/assetProcedureAttachmentSlice.d.ts +0 -48
- package/dist/store/slices/assetProcedureFieldValuesAttachmentSlice.d.ts +0 -131
- package/dist/store/slices/assetProcedureFieldValuesSlice.d.ts +0 -131
- package/dist/store/slices/assetProcedureFieldsAttachmentSlice.d.ts +0 -130
- package/dist/store/slices/assetProcedureFieldsSlice.d.ts +0 -49
- package/dist/store/slices/assetProcedureInstanceSlice.d.ts +0 -132
- package/dist/typings/colors.d.ts +0 -8
- package/dist/typings/json.d.ts +0 -6
- package/dist/typings/memoization.d.ts +0 -1
- package/dist/typings/models/attachments.d.ts +0 -31
- package/dist/typings/models/issueTypes.d.ts +0 -7
- package/dist/typings/models/store.d.ts +0 -0
- package/dist/typings/search.d.ts +0 -23
- package/dist/utils/coordinates.d.ts +0 -4
- package/dist/utils/offline.d.ts +0 -13
- /package/dist/sdk/{classes → outbox}/OutboxCoordinator.d.ts +0 -0
- /package/dist/sdk/{classes → outbox}/OutboxCoordinator.spec.d.ts +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(s,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("react"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("buffer"),require("localforage"),require("redux-persist-migrate"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","file-saver","react","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","buffer","localforage","redux-persist-migrate","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(s=typeof globalThis<"u"?globalThis:s||self,U(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.react,s.reduxOffline,s.offlineConfig,null,s.localforage,s.createMigration,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,U,d,Le,Ne,pm,Am,fm,pc,RP,ym,Sm,vP,gm,bm,Pm){"use strict";var OP=Object.defineProperty;var _P=(s,U,d)=>U in s?OP(s,U,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[U]=d;var S=(s,U,d)=>_P(s,typeof U!="symbol"?U+"":U,d);var mm;const Ac=Object.freeze([]),fc=Object.freeze({});var yc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(yc||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Sc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Sc||{}),$t=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))($t||{}),Lt=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(Lt||{}),j=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(j||{});const Fm=Lt.BACKLOG,Tm=$t.MEDIUM,gc=6e4;function I(t){return{addOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},addMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},setOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},setMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},updateOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},updateMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},deleteOne:(p,A)=>{delete p.instances[A.payload]},deleteMany:(p,A)=>{for(const f of A.payload)delete p.instances[f]},initialize:(p,A)=>{p.instances={};const f=new Set;for(const b of A.payload){const P=t(b);f.add(P),p.instances[P]=b}f.size!==A.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function Im(){return{initializeSelection:(m,u)=>{m.selection=Array.from(new Set(u.payload))},selectOne:(m,u)=>{new Set(m.selection).has(u.payload)||m.selection.push(u.payload)},selectMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)||o.add(p);m.selection=Array.from(o)},unselectOne:(m,u)=>{const o=new Set(m.selection);o.has(u.payload)&&(o.delete(u.payload),m.selection=Array.from(o))},unselectMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)&&o.delete(p);m.selection=Array.from(o)},toggleOne:(m,u)=>{const o=new Set(m.selection);o.has(u.payload)?o.delete(u.payload):o.add(u.payload),m.selection=Array.from(o)},toggleMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)?o.delete(p):o.add(p);m.selection=Array.from(o)},getInitialState:m=>({...m,selection:[]})}}const Ze="versioning",F=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),O=d.createAction("RESET_ORGANIZATION_STATE");mm=Symbol.toStringTag;class bc{constructor(){S(this,mm,"Promise");S(this,"_promise");S(this,"_resolve");S(this,"_reject");S(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((e,i)=>{this._resolve=e,this._reject=i})}get state(){return this._state}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}resolve(e){if(!this._resolve)throw new Error("No resolve callback");this._resolve(e),this._state="fulfilled"}reject(e){if(!this._reject)throw e;this._reject(e),this._state="rejected"}finally(e){throw new Error("`finally` not implemented")}}const Om=t=>({type:"Point",coordinates:t}),_m=t=>({type:"MultiPoint",coordinates:t}),Rm=(t,e)=>t[0]===e[0]&&t[1]===e[1];let Nt=!1;["true","1"].includes("".toLowerCase())&&(Nt=!0);function vm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;const i=Object.keys(t),a=Object.keys(e),c=i.length;if(c!==a.length)return!1;for(let n=0;n<c;n++){const r=i[n];if(!Object.prototype.hasOwnProperty.call(e,r)||t[r]!==e[r])return!1}return!0}function Ht(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(Nt&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(Nt&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function wm(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const g=t=>t.length===0?Ac:t,ht=t=>Object.keys(t).length===0?fc:t,Pc=Ht(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===Wt.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),Mm=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Em=1e3*86400,Wt=new Date,jm=t=>new Date(t).toDateString()===Wt.toDateString(),qm=Ht((t,e,i)=>{const a=Math.round((new Date(t).getTime()-Wt.getTime())/Em);return a<e||a>i?Pc(t):Mm.format(a,"days")});function Vm(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const Yt=async(t,e)=>{e||(e=await He(t));let i=t.type;if(i.includes("/")&&(i=i.split("/")[1]),!i)throw new Error(`Could not extract file type from ${t.type}`);return`${e}.${i}`};function He(t){return new Promise((e,i)=>{const a=new FileReader;a.onload=()=>{const c=a.result;if(!c){i(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",c).then(n=>{const r=Vm(n);e(r)})},a.readAsArrayBuffer(t)})}function zm(t){if(!t.name||!t.type||!t.size){const e="File has no name, type, and/or size";throw new Error(e)}return`${t.name}&${t.type}${t.size}`}function Fc(t,e){return new File([t],e,{type:t.type})}function Um(t,e){const i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}const Dm=async t=>{const e={};for(const i of t){const a=await He(i);e[a]={sha1:a,extension:i.name.split(".").pop()||"",file_type:i.type,size:i.size}}return Object.values(e)},Tc=async t=>(await fetch(t)).blob(),Cm=t=>new Promise((e,i)=>{const a=new FileReader;a.onloadend=()=>{var c;e(((c=a.result)==null?void 0:c.toString())||"")},a.readAsDataURL(t)});function km(t){const e=new Blob([t]);pm.saveAs(e,t.name)}const Ic={};function Bm(t,e,i,...a){const c=Ic[t];let n=!1;c?c[e]||(c[e]=!0,n=!0):(Ic[t]={[e]:!0},n=!0),n&&console[i](...a)}const Oc=["created_at","updated_at","index","revision"];function T(t){return{...t,uuid:Ne.v4()}}function _c(t){const e={};for(const i of t)e[i.uuid]=i;return e}function Gm(t,e=void 0,i=255){let a=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!e){const n=t.split(".");n.length>1&&(e=n[n.length-1])}e&&!e.startsWith(".")&&(e="."+e);const c=e?e.length:0;return a.length+c>i&&(a=a.slice(0,i-c)+(e||"")),a}function $m(t){return t.toLowerCase().replace(" ","-")}function Lm(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function Nm(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const y=t=>e=>i=>t(i,e);function Rc(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function Hm(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const Wm=/^.+@.+\..+$/;function w(t){const e={...t};for(const i of[...Oc,"created_by"])i in e&&delete e[i];return e}const k=I(t=>t.uuid),vc=k.getInitialState({}),Kt=d.createSlice({name:"agents",initialState:vc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,vc)),reducers:{initializeConversations:k.initialize,addConversation:k.addOne,addConversations:k.addMany,setConversation:k.setOne,setConversations:k.setMany,updateConversation:k.updateOne,updateConversations:k.updateMany,deleteConversation:k.deleteOne,deleteConversations:k.deleteMany}}),{initializeConversations:wc,addConversation:Mc,addConversations:Ym,setConversation:Ec,setConversations:Km,updateConversation:jc,updateConversations:Zm,deleteConversation:Jm,deleteConversations:Xm}=Kt.actions,Zt=t=>t.agentsReducer.instances,Qm=d.createSelector([Zt],t=>Object.values(t)),xm=y(d.createSelector([Zt,(t,e)=>e],(t,e)=>t[e])),qc=Kt.reducer,B=I(t=>t.uuid),Vc=B.getInitialState({}),Jt=d.createSlice({name:"assetAttachments",initialState:Vc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Vc)),reducers:{initializeAssetAttachments:B.initialize,addAssetAttachment:B.addOne,addAssetAttachments:B.addMany,setAssetAttachment:B.setOne,setAssetAttachments:B.setMany,updateAssetAttachment:B.updateOne,updateAssetAttachments:B.updateMany,deleteAssetAttachment:B.deleteOne,deleteAssetAttachments:B.deleteMany}}),{initializeAssetAttachments:Xt,addAssetAttachment:ep,addAssetAttachments:Qt,setAssetAttachment:zc,setAssetAttachments:tp,updateAssetAttachment:sp,updateAssetAttachments:Uc,deleteAssetAttachment:Dc,deleteAssetAttachments:xt}=Jt.actions,Cc=t=>t.assetAttachmentReducer.instances,kc=d.createSelector([Cc],t=>Object.values(t)),Bc=t=>e=>e.assetAttachmentReducer.instances[t],Gc=y(d.createSelector([kc,(t,e)=>e],(t,e)=>g(t.filter(({asset:i})=>e===i)))),$c=Jt.reducer,G=I(t=>t.uuid),Lc=G.getInitialState({}),es=d.createSlice({name:"assetProcedureAttachments",initialState:Lc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lc)),reducers:{initializeAssetProcedureAttachments:G.initialize,addAssetProcedureAttachment:G.addOne,addAssetProcedureAttachments:G.addMany,setAssetProcedureAttachment:G.setOne,setAssetProcedureAttachments:G.setMany,updateAssetProcedureAttachment:G.updateOne,updateAssetProcedureAttachments:G.updateMany,deleteAssetProcedureAttachment:G.deleteOne,deleteAssetProcedureAttachments:G.deleteMany}}),{initializeAssetProcedureAttachments:Nc,addAssetProcedureAttachment:ip,addAssetProcedureAttachments:Hc,setAssetProcedureAttachment:Wc,setAssetProcedureAttachments:ap,updateAssetProcedureAttachment:cp,updateAssetProcedureAttachments:Yc,deleteAssetProcedureAttachment:Kc,deleteAssetProcedureAttachments:Zc}=es.actions,Jc=es.reducer,Xc=t=>t.assetProcedureAttachmentReducer.instances,Qc=d.createSelector([Xc],t=>Object.values(t)),xc=t=>e=>e.assetProcedureAttachmentReducer.instances[t],np=y(d.createSelector([Qc,(t,e)=>e],(t,e)=>g(t.filter(({asset_procedure:i})=>e===i)))),$=I(t=>t.uuid),en=$.getInitialState({}),ts=d.createSlice({name:"assetProcedureFieldsAttachments",initialState:en,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,en)),reducers:{initializeAssetProcedureFieldsAttachments:$.initialize,addAssetProcedureFieldsAttachment:$.addOne,addAssetProcedureFieldsAttachments:$.addMany,setAssetProcedureFieldsAttachment:$.setOne,setAssetProcedureFieldsAttachments:$.setMany,updateAssetProcedureFieldsAttachment:$.updateOne,updateAssetProcedureFieldsAttachments:$.updateMany,deleteAssetProcedureFieldsAttachment:$.deleteOne,deleteAssetProcedureFieldsAttachments:$.deleteMany}}),{initializeAssetProcedureFieldsAttachments:tn,addAssetProcedureFieldsAttachment:rp,addAssetProcedureFieldsAttachments:sn,setAssetProcedureFieldsAttachment:dp,setAssetProcedureFieldsAttachments:up,updateAssetProcedureFieldsAttachment:op,updateAssetProcedureFieldsAttachments:an,deleteAssetProcedureFieldsAttachment:lp,deleteAssetProcedureFieldsAttachments:cn}=ts.actions,nn=t=>t.assetProcedureFieldsAttachmentReducer.instances,rn=d.createSelector([nn],t=>Object.values(t)),hp=y(d.createSelector([rn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),mp=t=>e=>e.assetProcedureFieldsAttachmentReducer.instances[t],dn=ts.reducer,L=I(t=>t.uuid),un=L.getInitialState({}),ss=d.createSlice({name:"assetProcedureFields",initialState:un,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,un)),reducers:{initializeAssetProcedureFields:L.initialize,addAssetProcedureFields:L.addOne,addAssetProcedureFieldsMany:L.addMany,setAssetProcedureFields:L.setOne,setAssetProcedureFieldsMany:L.setMany,updateAssetProcedureFields:L.updateOne,updateAssetProcedureFieldsMany:L.updateMany,deleteAssetProcedureFields:L.deleteOne,deleteAssetProcedureFieldsMany:L.deleteMany}}),{initializeAssetProcedureFields:on,addAssetProcedureFields:ln,addAssetProcedureFieldsMany:pp,setAssetProcedureFields:Ap,setAssetProcedureFieldsMany:fp,updateAssetProcedureFields:hn,updateAssetProcedureFieldsMany:yp,deleteAssetProcedureFields:mn,deleteAssetProcedureFieldsMany:Sp}=ss.actions,pn=t=>t.assetProcedureFieldsReducer.instances,is=d.createSelector([pn],t=>Object.values(t)),gp=y(d.createSelector([is,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),bp=y(d.createSelector([is,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Pp=t=>e=>e.assetProcedureFieldsReducer.instances[t],An=ss.reducer,N=I(t=>t.uuid),fn=N.getInitialState({}),as=d.createSlice({name:"assetProcedureFieldValuesAttachments",initialState:fn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,fn)),reducers:{initializeAssetProcedureFieldValuesAttachments:N.initialize,addAssetProcedureFieldValuesAttachment:N.addOne,addAssetProcedureFieldValuesAttachments:N.addMany,setAssetProcedureFieldValuesAttachment:N.setOne,setAssetProcedureFieldValuesAttachments:N.setMany,updateAssetProcedureFieldValuesAttachment:N.updateOne,updateAssetProcedureFieldValuesAttachments:N.updateMany,deleteAssetProcedureFieldValuesAttachment:N.deleteOne,deleteAssetProcedureFieldValuesAttachments:N.deleteMany}}),{initializeAssetProcedureFieldValuesAttachments:yn,addAssetProcedureFieldValuesAttachment:Fp,addAssetProcedureFieldValuesAttachments:mt,setAssetProcedureFieldValuesAttachment:Tp,setAssetProcedureFieldValuesAttachments:Ip,updateAssetProcedureFieldValuesAttachment:Op,updateAssetProcedureFieldValuesAttachments:Sn,deleteAssetProcedureFieldValuesAttachment:_p,deleteAssetProcedureFieldValuesAttachments:pt}=as.actions,cs=t=>t.assetProcedureFieldValuesAttachmentReducer.instances,gn=d.createSelector([cs],t=>Object.values(t)),Rp=t=>e=>e.assetProcedureFieldValuesAttachmentReducer.instances[t],bn=y(d.createSelector([cs,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),Pn=y(d.createSelector([gn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),Fn=as.reducer,H=I(t=>t.uuid),Tn=H.getInitialState({}),ns=d.createSlice({name:"assetProcedureFieldValues",initialState:Tn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Tn)),reducers:{initializeAssetProcedureFieldValues:H.initialize,addAssetProcedureFieldValues:H.addOne,addAssetProcedureFieldValuesMany:H.addMany,setAssetProcedureFieldValues:H.setOne,setAssetProcedureFieldValuesMany:H.setMany,updateAssetProcedureFieldValues:H.updateOne,updateAssetProcedureFieldValuesMany:H.updateMany,deleteAssetProcedureFieldValues:H.deleteOne,deleteAssetProcedureFieldValuesMany:H.deleteMany}}),{initializeAssetProcedureFieldValues:In,addAssetProcedureFieldValues:rs,addAssetProcedureFieldValuesMany:On,setAssetProcedureFieldValues:vp,setAssetProcedureFieldValuesMany:wp,updateAssetProcedureFieldValues:Je,updateAssetProcedureFieldValuesMany:_n,deleteAssetProcedureFieldValues:ds,deleteAssetProcedureFieldValuesMany:Rn}=ns.actions,vn=ns.reducer,wn=t=>t.assetProcedureFieldValuesReducer.instances,us=d.createSelector([wn],t=>Object.values(t)),Mp=y(d.createSelector([us,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),Ep=y(d.createSelector([us,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_instance===e)))),os=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],W=I(t=>t.uuid),Mn=W.getInitialState({}),ls=d.createSlice({name:"assetProcedureInstances",initialState:Mn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Mn)),reducers:{initializeAssetProcedureInstances:W.initialize,addAssetProcedureInstance:W.addOne,addAssetProcedureInstances:W.addMany,setAssetProcedureInstance:W.setOne,setAssetProcedureInstances:W.setMany,updateAssetProcedureInstance:W.updateOne,updateAssetProcedureInstances:W.updateMany,deleteAssetProcedureInstance:W.deleteOne,deleteAssetProcedureInstances:W.deleteMany}}),{initializeAssetProcedureInstances:En,addAssetProcedureInstance:hs,addAssetProcedureInstances:jn,updateAssetProcedureInstance:Xe,updateAssetProcedureInstances:jp,deleteAssetProcedureInstance:ms,deleteAssetProcedureInstances:qn,setAssetProcedureInstance:qp,setAssetProcedureInstances:Vp}=ls.actions,Vn=ls.reducer,ps=t=>t.assetProcedureInstanceReducer.instances,As=d.createSelector([ps],t=>Object.values(t)),zn=y(d.createSelector([As,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),zp=y(d.createSelector([As,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),fs=t=>e=>e.assetProcedureInstanceReducer.instances[t],Up=y(d.createSelector([ps,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),Y=I(t=>t.uuid),Un=Y.getInitialState({}),ys=d.createSlice({name:"assetProcedures",initialState:Un,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Un)),reducers:{initializeAssetProcedures:Y.initialize,addAssetProcedure:Y.addOne,addAssetProcedures:Y.addMany,setAssetProcedure:Y.setOne,setAssetProcedures:Y.setMany,updateAssetProcedure:Y.updateOne,updateAssetProcedures:Y.updateMany,deleteAssetProcedure:Y.deleteOne,deleteAssetProcedures:Y.deleteMany}}),{initializeAssetProcedures:Dn,addAssetProcedure:Ss,addAssetProcedures:Dp,updateAssetProcedure:Qe,updateAssetProcedures:Cp,deleteAssetProcedure:gs,deleteAssetProcedures:kp,setAssetProcedure:Bp,setAssetProcedures:Gp}=ys.actions,Cn=ys.reducer,bs=t=>t.assetProcedureReducer.instances,kn=d.createSelector([bs],t=>Object.values(t)),Ps=t=>e=>e.assetProcedureReducer.instances[t],$p=y(d.createSelector([bs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),Lp=y(d.createSelector([kn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),K=I(t=>t.uuid),Bn=K.getInitialState({}),Fs=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Bn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Bn)),reducers:{initializeAssetProcedureStepFieldsAttachments:K.initialize,addAssetProcedureStepFieldsAttachment:K.addOne,addAssetProcedureStepFieldsAttachments:K.addMany,setAssetProcedureStepFieldsAttachment:K.setOne,setAssetProcedureStepFieldsAttachments:K.setMany,updateAssetProcedureStepFieldsAttachment:K.updateOne,updateAssetProcedureStepFieldsAttachments:K.updateMany,deleteAssetProcedureStepFieldsAttachment:K.deleteOne,deleteAssetProcedureStepFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Gn,addAssetProcedureStepFieldsAttachment:Np,addAssetProcedureStepFieldsAttachments:$n,setAssetProcedureStepFieldsAttachment:Hp,setAssetProcedureStepFieldsAttachments:Wp,updateAssetProcedureStepFieldsAttachment:Yp,updateAssetProcedureStepFieldsAttachments:Ln,deleteAssetProcedureStepFieldsAttachment:Kp,deleteAssetProcedureStepFieldsAttachments:Nn}=Fs.actions,Hn=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Wn=d.createSelector([Hn],t=>Object.values(t)),Zp=y(d.createSelector([Wn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),Jp=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],Yn=Fs.reducer,Z=I(t=>t.uuid),Kn=Z.getInitialState({}),Ts=d.createSlice({name:"assetProcedureStepFields",initialState:Kn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Kn)),reducers:{initializeAssetProcedureStepFields:Z.initialize,addAssetProcedureStepFields:Z.addOne,addAssetProcedureStepFieldsMany:Z.addMany,setAssetProcedureStepFields:Z.setOne,setAssetProcedureStepFieldsMany:Z.setMany,updateAssetProcedureStepFields:Z.updateOne,updateAssetProcedureStepFieldsMany:Z.updateMany,deleteAssetProcedureStepFields:Z.deleteOne,deleteAssetProcedureStepFieldsMany:Z.deleteMany}}),{initializeAssetProcedureStepFields:Zn,addAssetProcedureStepFields:Is,addAssetProcedureStepFieldsMany:Xp,setAssetProcedureStepFields:Qp,setAssetProcedureStepFieldsMany:xp,updateAssetProcedureStepFields:xe,updateAssetProcedureStepFieldsMany:eA,deleteAssetProcedureStepFields:Os,deleteAssetProcedureStepFieldsMany:tA}=Ts.actions,_s=t=>t.assetProcedureStepFieldsReducer.instances,Rs=d.createSelector([_s],t=>Object.values(t)),sA=y(d.createSelector([Rs,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_step===e)))),iA=y(d.createSelector([Rs,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure_step===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),aA=d.createSelector([_s],t=>{const e={};for(const i of Object.values(t)){const a=e[i.asset_procedure_step];(!a||a.submitted_at<i.submitted_at)&&(e[i.asset_procedure_step]=i)}return e}),cA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Jn=Ts.reducer,J=I(t=>t.uuid),Xn=J.getInitialState({}),vs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Xn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Xn)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:J.initialize,addAssetProcedureStepFieldValuesAttachment:J.addOne,addAssetProcedureStepFieldValuesAttachments:J.addMany,setAssetProcedureStepFieldValuesAttachment:J.setOne,setAssetProcedureStepFieldValuesAttachments:J.setMany,updateAssetProcedureStepFieldValuesAttachment:J.updateOne,updateAssetProcedureStepFieldValuesAttachments:J.updateMany,deleteAssetProcedureStepFieldValuesAttachment:J.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Qn,addAssetProcedureStepFieldValuesAttachment:nA,addAssetProcedureStepFieldValuesAttachments:At,setAssetProcedureStepFieldValuesAttachment:rA,setAssetProcedureStepFieldValuesAttachments:dA,updateAssetProcedureStepFieldValuesAttachment:uA,updateAssetProcedureStepFieldValuesAttachments:xn,deleteAssetProcedureStepFieldValuesAttachment:oA,deleteAssetProcedureStepFieldValuesAttachments:ft}=vs.actions,ws=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,er=d.createSelector([ws],t=>Object.values(t)),lA=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],tr=y(d.createSelector([ws,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),sr=y(d.createSelector([er,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),ir=vs.reducer,X=I(t=>t.uuid),ar=X.getInitialState({}),Ms=d.createSlice({name:"assetProcedureStepFieldValues",initialState:ar,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ar)),reducers:{initializeAssetProcedureStepFieldValues:X.initialize,addAssetProcedureStepFieldValues:X.addOne,addAssetProcedureStepFieldValuesMany:X.addMany,setAssetProcedureStepFieldValues:X.setOne,setAssetProcedureStepFieldValuesMany:X.setMany,updateAssetProcedureStepFieldValues:X.updateOne,updateAssetProcedureStepFieldValuesMany:X.updateMany,deleteAssetProcedureStepFieldValues:X.deleteOne,deleteAssetProcedureStepFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureStepFieldValues:cr,addAssetProcedureStepFieldValues:Es,addAssetProcedureStepFieldValuesMany:nr,setAssetProcedureStepFieldValues:hA,setAssetProcedureStepFieldValuesMany:mA,updateAssetProcedureStepFieldValues:et,updateAssetProcedureStepFieldValuesMany:rr,deleteAssetProcedureStepFieldValues:js,deleteAssetProcedureStepFieldValuesMany:dr}=Ms.actions,ur=t=>t.assetProcedureStepFieldValuesReducer.instances,yt=d.createSelector([ur],t=>Object.values(t)),pA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),AA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_instance===e)))),fA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_step===e)))),qs=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],or=Ms.reducer,Q=I(t=>t.uuid),lr=Q.getInitialState({}),Vs=d.createSlice({name:"assetProcedureSteps",initialState:lr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,lr)),reducers:{initializeAssetProcedureSteps:Q.initialize,setAssetProcedureStep:Q.setOne,setAssetProcedureSteps:Q.setMany,addAssetProcedureStep:Q.addOne,addAssetProcedureSteps:Q.addMany,updateAssetProcedureStep:Q.updateOne,updateAssetProcedureSteps:Q.updateMany,deleteAssetProcedureStep:Q.deleteOne,deleteAssetProcedureSteps:Q.deleteMany}}),{initializeAssetProcedureSteps:hr,setAssetProcedureStep:mr,setAssetProcedureSteps:yA,addAssetProcedureStep:zs,addAssetProcedureSteps:SA,updateAssetProcedureStep:St,updateAssetProcedureSteps:gA,deleteAssetProcedureStep:Us,deleteAssetProcedureSteps:bA}=Vs.actions,pr=Vs.reducer,gt=t=>t.assetProcedureStepReducer.instances,Ds=t=>e=>e.assetProcedureStepReducer.instances[t],Ar=d.createSelector([gt],t=>Object.values(t)),PA=y(d.createSelector([gt,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure===e&&(i[a]=c);return ht(i)})),FA=y(d.createSelector([Ar,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),TA=y(d.createSelector([gt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetProcedureStepsByIds: No step exists with the id",a)}return g(i)})),x=I(t=>t.uuid),fr=x.getInitialState({}),Cs=d.createSlice({name:"assets",initialState:fr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,fr)),reducers:{initializeAssets:x.initialize,addAsset:x.addOne,addAssets:x.addMany,setAsset:x.setOne,setAssets:x.setMany,updateAsset:x.updateOne,updateAssets:x.updateMany,deleteAsset:x.deleteOne,deleteAssets:x.deleteMany}}),{initializeAssets:yr,addAsset:ks,addAssets:bt,updateAsset:tt,updateAssets:IA,deleteAsset:Bs,deleteAssets:Gs,setAsset:OA,setAssets:_A}=Cs.actions,$s=t=>t.assetReducer.instances,Sr=d.createSelector([$s],t=>g(Object.values(t))),Ls=y(d.createSelector([Sr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),Ns=t=>e=>e.assetReducer.instances[t],gr=y(d.createSelector([$s,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),RA=t=>e=>Ls(t)(e).length,br=Cs.reducer,ee=I(t=>t.uuid),Pr=ee.getInitialState({}),Hs=d.createSlice({name:"assetStageCompletions",initialState:Pr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Pr)),reducers:{initializeAssetStageCompletions:ee.initialize,addAssetStageCompletion:ee.addOne,addAssetStageCompletions:ee.addMany,setAssetStageCompletion:ee.setOne,setAssetStageCompletions:ee.setMany,updateAssetStageCompletion:ee.updateOne,updateAssetStageCompletions:ee.updateMany,deleteAssetStageCompletion:ee.deleteOne,deleteAssetStageCompletions:ee.deleteMany}}),{initializeAssetStageCompletions:Fr,addAssetStageCompletion:Ws,addAssetStageCompletions:Ys,setAssetStageCompletion:vA,setAssetStageCompletions:wA,updateAssetStageCompletion:Tr,updateAssetStageCompletions:Ir,deleteAssetStageCompletion:Ks,deleteAssetStageCompletions:Zs}=Hs.actions,Or=Hs.reducer,Js=t=>t.assetStageCompletionReducer.instances,MA=d.createSelector([Js],t=>Object.values(t)),_r=t=>e=>e.assetStageCompletionReducer.instances[t],Rr=y(d.createSelector([Js,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),te=I(t=>t.uuid),vr=te.getInitialState({}),Xs=d.createSlice({name:"assetStages",initialState:vr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,vr)),reducers:{initializeAssetStages:te.initialize,setAssetStage:te.setOne,setAssetStages:te.setMany,addAssetStage:te.addOne,addAssetStages:te.addMany,updateAssetStage:te.updateOne,updateAssetStages:te.updateMany,deleteAssetStage:te.deleteOne,deleteAssetStages:te.deleteMany}}),{initializeAssetStages:wr,setAssetStage:Mr,setAssetStages:EA,addAssetStage:Qs,addAssetStages:jA,updateAssetStage:Pt,updateAssetStages:qA,deleteAssetStage:xs,deleteAssetStages:VA}=Xs.actions,Er=Xs.reducer,Ft=t=>t.assetStageReducer.instances,ei=t=>e=>e.assetStageReducer.instances[t],jr=d.createSelector([Ft],t=>Object.values(t)),zA=y(d.createSelector([Ft,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure===e&&(i[a]=c);return ht(i)})),UA=y(d.createSelector([jr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),DA=y(d.createSelector([Ft,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectStagesFromStageIds: No stage exists with the id",a)}return g(i)})),se=I(t=>t.uuid),qr=se.getInitialState({}),ti=d.createSlice({name:"assetTypeAttachments",initialState:qr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,qr)),reducers:{initializeAssetTypeAttachments:se.initialize,addAssetTypeAttachment:se.addOne,addAssetTypeAttachments:se.addMany,setAssetTypeAttachment:se.setOne,setAssetTypeAttachments:se.setMany,updateAssetTypeAttachment:se.updateOne,updateAssetTypeAttachments:se.updateMany,deleteAssetTypeAttachment:se.deleteOne,deleteAssetTypeAttachments:se.deleteMany}}),{initializeAssetTypeAttachments:Vr,addAssetTypeAttachment:CA,addAssetTypeAttachments:si,setAssetTypeAttachment:zr,setAssetTypeAttachments:kA,updateAssetTypeAttachment:BA,updateAssetTypeAttachments:Ur,deleteAssetTypeAttachment:Dr,deleteAssetTypeAttachments:ii}=ti.actions,Cr=t=>t.assetTypeAttachmentReducer.instances,kr=d.createSelector([Cr],t=>Object.values(t)),Br=t=>e=>e.assetTypeAttachmentReducer.instances[t],Gr=y(d.createSelector([kr,(t,e)=>e],(t,e)=>g(t.filter(({asset_type:i})=>e===i)))),$r=ti.reducer,ie=I(t=>t.uuid),Lr=ie.getInitialState({}),ai=d.createSlice({name:"assetTypeFieldsAttachments",initialState:Lr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lr)),reducers:{initializeAssetTypeFieldsAttachments:ie.initialize,addAssetTypeFieldsAttachment:ie.addOne,addAssetTypeFieldsAttachments:ie.addMany,setAssetTypeFieldsAttachment:ie.setOne,setAssetTypeFieldsAttachments:ie.setMany,updateAssetTypeFieldsAttachment:ie.updateOne,updateAssetTypeFieldsAttachments:ie.updateMany,deleteAssetTypeFieldsAttachment:ie.deleteOne,deleteAssetTypeFieldsAttachments:ie.deleteMany}}),{initializeAssetTypeFieldsAttachments:Nr,addAssetTypeFieldsAttachment:GA,addAssetTypeFieldsAttachments:Hr,setAssetTypeFieldsAttachment:$A,setAssetTypeFieldsAttachments:LA,updateAssetTypeFieldsAttachment:NA,updateAssetTypeFieldsAttachments:Wr,deleteAssetTypeFieldsAttachment:HA,deleteAssetTypeFieldsAttachments:Yr}=ai.actions,Kr=t=>t.assetTypeFieldsAttachmentReducer.instances,Zr=d.createSelector([Kr],t=>Object.values(t)),WA=y(d.createSelector([Zr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),YA=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],Jr=ai.reducer,ae=I(t=>t.uuid),Xr=ae.getInitialState({}),ci=d.createSlice({name:"assetTypeFields",initialState:Xr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Xr)),reducers:{initializeAssetTypeFields:ae.initialize,addAssetTypeFields:ae.addOne,addAssetTypeFieldsMany:ae.addMany,setAssetTypeFields:ae.setOne,setAssetTypeFieldsMany:ae.setMany,updateAssetTypeFields:ae.updateOne,updateAssetTypeFieldsMany:ae.updateMany,deleteAssetTypeFields:ae.deleteOne,deleteAssetTypeFieldsMany:ae.deleteMany}}),{initializeAssetTypeFields:Qr,addAssetTypeFields:xr,addAssetTypeFieldsMany:KA,setAssetTypeFields:ZA,setAssetTypeFieldsMany:JA,updateAssetTypeFields:ed,updateAssetTypeFieldsMany:XA,deleteAssetTypeFields:td,deleteAssetTypeFieldsMany:QA}=ci.actions,sd=t=>t.assetTypeFieldsReducer.instances,Tt=d.createSelector([sd],t=>Object.values(t)),xA=y(d.createSelector([Tt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),ef=y(d.createSelector([Tt,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),tf=t=>e=>e.assetTypeFieldsReducer.instances[t],id=ci.reducer,ce=I(t=>t.uuid),ad=ce.getInitialState({}),ni=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:ad,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ad)),reducers:{initializeAssetTypeFieldValuesAttachments:ce.initialize,addAssetTypeFieldValuesAttachment:ce.addOne,addAssetTypeFieldValuesAttachments:ce.addMany,setAssetTypeFieldValuesAttachment:ce.setOne,setAssetTypeFieldValuesAttachments:ce.setMany,updateAssetTypeFieldValuesAttachment:ce.updateOne,updateAssetTypeFieldValuesAttachments:ce.updateMany,deleteAssetTypeFieldValuesAttachment:ce.deleteOne,deleteAssetTypeFieldValuesAttachments:ce.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:cd,addAssetTypeFieldValuesAttachment:sf,addAssetTypeFieldValuesAttachments:It,setAssetTypeFieldValuesAttachment:af,setAssetTypeFieldValuesAttachments:cf,updateAssetTypeFieldValuesAttachment:nf,updateAssetTypeFieldValuesAttachments:nd,deleteAssetTypeFieldValuesAttachment:rf,deleteAssetTypeFieldValuesAttachments:Ot}=ni.actions,ri=t=>t.assetTypeFieldValuesAttachmentReducer.instances,rd=d.createSelector([ri],t=>Object.values(t)),df=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],dd=y(d.createSelector([ri,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),ud=y(d.createSelector([rd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),od=ni.reducer,ne=I(t=>t.uuid),ld=ne.getInitialState({}),di=d.createSlice({name:"assetTypeFieldValues",initialState:ld,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ld)),reducers:{initializeAssetTypeFieldValues:ne.initialize,addAssetTypeFieldValues:ne.addOne,addAssetTypeFieldValuesMany:ne.addMany,setAssetTypeFieldValues:ne.setOne,setAssetTypeFieldValuesMany:ne.setMany,updateAssetTypeFieldValues:ne.updateOne,updateAssetTypeFieldValuesMany:ne.updateMany,deleteAssetTypeFieldValues:ne.deleteOne,deleteAssetTypeFieldValuesMany:ne.deleteMany}}),{initializeAssetTypeFieldValues:hd,addAssetTypeFieldValues:ui,addAssetTypeFieldValuesMany:md,setAssetTypeFieldValues:uf,setAssetTypeFieldValuesMany:of,updateAssetTypeFieldValues:st,updateAssetTypeFieldValuesMany:pd,deleteAssetTypeFieldValues:oi,deleteAssetTypeFieldValuesMany:Ad}=di.actions,fd=t=>t.assetTypeFieldValuesReducer.instances,li=d.createSelector([fd],t=>Object.values(t)),lf=y(d.createSelector([li,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),hf=y(d.createSelector([Tt,li,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.asset_type===i).map(c=>c.uuid));return g(e.filter(c=>a.has(c.fields_revision)))})),hi=t=>e=>e.assetTypeFieldValuesReducer.instances[t],yd=di.reducer,re=I(t=>t.uuid),Sd=re.getInitialState({}),mi=d.createSlice({name:"assetTypes",initialState:Sd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Sd)),reducers:{initializeAssetTypes:re.initialize,setAssetType:re.setOne,setAssetTypes:re.setMany,addAssetType:re.addOne,addAssetTypes:re.addMany,updateAssetType:re.updateOne,updateAssetTypes:re.updateMany,deleteAssetType:re.deleteOne,deleteAssetTypes:re.deleteMany}}),{initializeAssetTypes:gd,setAssetType:mf,setAssetTypes:pf,addAssetType:pi,addAssetTypes:Af,updateAssetType:it,updateAssetTypes:ff,deleteAssetType:Ai,deleteAssetTypes:yf}=mi.actions,fi=t=>t.assetTypeReducer.instances,bd=d.createSelector([fi],t=>Object.values(t)),yi=t=>e=>e.assetTypeReducer.instances[t],Sf=y(d.createSelector([fi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetTypesByIds: No assetType exists with the id",a)}return g(i)})),gf=y(d.createSelector([bd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),Pd=mi.reducer,Fd={accessToken:"",refreshToken:"",isLoggedIn:!1},_t=d.createSlice({name:"auth",initialState:Fd,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Fd)),reducers:{setTokens:(t,e)=>{t.accessToken=e.payload.accessToken,t.refreshToken=e.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,e)=>{e.payload||_t.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:bf,clearTokens:Pf,setLoggedIn:Td}=_t.actions,Ff=t=>t.authReducer.accessToken,Tf=t=>t.authReducer.isLoggedIn,Id=_t.reducer,de=I(t=>t.uuid),Od=de.getInitialState({}),Si=d.createSlice({name:"categories",initialState:Od,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Od)),reducers:{initializeCategories:de.initialize,addCategory:de.addOne,addCategories:de.addMany,setCategory:de.setOne,setCategories:de.setMany,updateCategory:de.updateOne,updateCategories:de.updateMany,deleteCategory:de.deleteOne,deleteCategories:de.deleteMany}}),{initializeCategories:_d,addCategory:gi,addCategories:If,setCategory:Of,setCategories:_f,updateCategory:Rd,updateCategories:Rf,deleteCategory:vd,deleteCategories:vf}=Si.actions,bi=t=>t.categoryReducer.instances,wd=d.createSelector([bi],t=>Object.values(t)),Pi=t=>e=>e.categoryReducer.instances[t],wf=y(d.createSelector([bi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectCategoryByIds: No category exists with the id",a)}return g(i)})),Mf=y(d.createSelector([wd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.project===e)))),Md=Si.reducer,ue=I(t=>t.uuid),Ed=ue.getInitialState({}),Fi=d.createSlice({name:"documentAttachments",initialState:Ed,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Ed)),reducers:{initializeDocumentAttachments:ue.initialize,addDocumentAttachment:ue.addOne,addDocumentAttachments:ue.addMany,setDocumentAttachment:ue.setOne,setDocumentAttachments:ue.setMany,updateDocumentAttachment:ue.updateOne,updateDocumentAttachments:ue.updateMany,deleteDocumentAttachment:ue.deleteOne,deleteDocumentAttachments:ue.deleteMany}}),{initializeDocumentAttachments:jd,addDocumentAttachment:Ef,addDocumentAttachments:qd,setDocumentAttachment:Vd,setDocumentAttachments:jf,updateDocumentAttachment:qf,updateDocumentAttachments:zd,deleteDocumentAttachment:Ud,deleteDocumentAttachments:Dd}=Fi.actions,Cd=t=>t.documentAttachmentReducer.instances,kd=d.createSelector([Cd],t=>Object.values(t)),Bd=t=>e=>e.documentAttachmentReducer.instances[t],Vf=y(d.createSelector([kd,(t,e)=>e],(t,e)=>g(t.filter(({document:i})=>e===i)))),Gd=Fi.reducer,$d={documents:{}},Ti=d.createSlice({name:"documents",initialState:$d,extraReducers:t=>t.addCase(F,e=>{Object.assign(e,$d)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(Rc).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=_c(e.payload)},addDocuments:(t,e)=>{for(const i of e.payload)if(i.uuid in t.documents)throw new Error(`attempting to add a document with uuid ${i.uuid} which already exists in state.documents.`);for(const i of e.payload){if(i.parent_document&&t.documents[i.parent_document]){const a=t.documents[i.parent_document];t.documents[i.parent_document]={...a,children_documents:[...a.children_documents,i.uuid]}}t.documents[i.uuid]=i}},updateDocuments:(t,e)=>{for(const i of e.payload)if(!(i.uuid in t.documents))throw new Error(`attempting to update a document with uuid ${i.uuid} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i.uuid];if(i.organization!==void 0&&i.organization!==a.organization)throw new Error("organization cannot be updated");if(i.project!==void 0&&i.project!==a.project)throw new Error("project cannot be updated");t.documents[i.uuid]={...a,...i}}},removeDocuments:(t,e)=>{for(const i of e.payload)if(!(i in t.documents))throw new Error(`attempting to delete a document with uuid ${i} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i];if(a.parent_document&&t.documents[a.parent_document]){const c=t.documents[a.parent_document];t.documents[a.parent_document]={...c,children_documents:c.children_documents.filter(n=>n!==a.uuid)}}delete t.documents[i]}}}}),{setDocuments:Ld,addDocuments:Nd,updateDocuments:We,removeDocuments:Ii}=Ti.actions,Rt=t=>t.documentsReducer.documents,Oi=d.createSelector([Rt],t=>Object.values(t)),Hd=t=>e=>e.documentsReducer.documents[t],zf=y(d.createSelector([Rt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectDocumentByIds: No document exists with the id",a)}return g(i)})),Uf=y(d.createSelector([Oi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Df=y(d.createSelector([Oi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),Wd=Ti.reducer,oe=I(t=>t.uuid),Yd=oe.getInitialState({}),_i=d.createSlice({name:"emailDomains",initialState:Yd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Yd)),reducers:{initializeEmailDomains:oe.initialize,addEmailDomain:oe.addOne,addEmailDomains:oe.addMany,setEmailDomain:oe.setOne,setEmailDomains:oe.setMany,updateEmailDomain:oe.updateOne,updateEmailDomains:oe.updateMany,deleteEmailDomain:oe.deleteOne,deleteEmailDomains:oe.deleteMany}}),{initializeEmailDomains:Kd,addEmailDomain:Zd,addEmailDomains:Cf,setEmailDomain:kf,setEmailDomains:Bf,updateEmailDomain:Gf,updateEmailDomains:$f,deleteEmailDomain:Jd,deleteEmailDomains:Lf}=_i.actions,Xd=t=>t.emailDomainsReducer.instances,Qd=d.createSelector([Xd],t=>Object.values(t)),Nf=y(d.createSelector([Qd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),xd=_i.reducer,eu={s3Urls:{}},tu=1e3*60*60,Hf=tu*24*7,Ri=d.createSlice({name:"file",initialState:eu,extraReducers:t=>t.addCase(F,e=>Object.assign(e,eu)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:c}=e.payload,n=new Date,r=new Date(n.getTime()+Hf);t.s3Urls[c]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:su}=Ri.actions,iu=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<tu))return i},au=Ri.reducer,le=I(t=>t.uuid),cu=le.getInitialState({}),vi=d.createSlice({name:"formRevisionAttachments",initialState:cu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,cu)),reducers:{initializeFormRevisionAttachments:le.initialize,addFormRevisionAttachment:le.addOne,addFormRevisionAttachments:le.addMany,setFormRevisionAttachment:le.setOne,setFormRevisionAttachments:le.setMany,updateFormRevisionAttachment:le.updateOne,updateFormRevisionAttachments:le.updateMany,deleteFormRevisionAttachment:le.deleteOne,deleteFormRevisionAttachments:le.deleteMany}}),{initializeFormRevisionAttachments:nu,addFormRevisionAttachment:Wf,addFormRevisionAttachments:ru,setFormRevisionAttachment:Yf,setFormRevisionAttachments:Kf,updateFormRevisionAttachment:Zf,updateFormRevisionAttachments:du,deleteFormRevisionAttachment:Jf,deleteFormRevisionAttachments:uu}=vi.actions,ou=t=>t.formRevisionAttachmentReducer.instances,Xf=y(d.createSelector([ou,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.form_revision===e)))),lu=vi.reducer,he=I(t=>t.uuid),hu=he.getInitialState({}),wi=d.createSlice({name:"formRevisions",initialState:hu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,hu)),reducers:{initializeFormRevisions:he.initialize,addFormRevision:he.addOne,addFormRevisions:he.addMany,setFormRevision:he.setOne,setFormRevisions:he.setMany,updateFormRevision:he.updateOne,updateFormRevisions:he.updateMany,deleteFormRevision:he.deleteOne,deleteFormRevisions:he.deleteMany}}),{initializeFormRevisions:mu,addFormRevision:Mi,addFormRevisions:pu,setFormRevision:Au,setFormRevisions:Qf,updateFormRevision:xf,updateFormRevisions:ey,deleteFormRevision:Ei,deleteFormRevisions:fu}=wi.actions,ji=t=>t.formRevisionReducer.instances,qi=d.createSelector([ji],t=>Object.values(t)),ty=t=>e=>e.formRevisionReducer.instances[t],sy=y(d.createSelector([qi,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),yu=y(d.createSelector([qi,(t,e)=>e],(t,e)=>g(t.filter(i=>i.form===e)))),Su=wi.reducer,me=I(t=>t.uuid),gu=me.getInitialState({}),Vi=d.createSlice({name:"forms",initialState:gu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,gu)),reducers:{initializeForms:me.initialize,addForm:me.addOne,addForms:me.addMany,setForm:me.setOne,setForms:me.setMany,updateForm:me.updateOne,updateForms:me.updateMany,deleteForm:me.deleteOne,deleteForms:me.deleteMany}}),{initializeForms:bu,addForm:zi,addForms:iy,setForm:ay,setForms:cy,updateForm:ny,updateForms:ry,deleteForm:Ui,deleteForms:dy}=Vi.actions,Pu=Vi.reducer,Fu=t=>t.formReducer.instances,Tu=d.createSelector([Fu],t=>Object.values(t)),Iu=t=>e=>e.formReducer.instances[t],uy=y(d.createSelector([Tu,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),pe=I(t=>t.uuid),Ou=pe.getInitialState({}),Di=d.createSlice({name:"formSubmissionAttachments",initialState:Ou,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Ou)),reducers:{initializeFormSubmissionAttachments:pe.initialize,addFormSubmissionAttachment:pe.addOne,addFormSubmissionAttachments:pe.addMany,setFormSubmissionAttachment:pe.setOne,setFormSubmissionAttachments:pe.setMany,updateFormSubmissionAttachment:pe.updateOne,updateFormSubmissionAttachments:pe.updateMany,deleteFormSubmissionAttachment:pe.deleteOne,deleteFormSubmissionAttachments:pe.deleteMany}}),{initializeFormSubmissionAttachments:_u,addFormSubmissionAttachment:oy,addFormSubmissionAttachments:vt,setFormSubmissionAttachment:ly,setFormSubmissionAttachments:hy,updateFormSubmissionAttachment:my,updateFormSubmissionAttachments:Ru,deleteFormSubmissionAttachment:py,deleteFormSubmissionAttachments:wt}=Di.actions,vu=t=>t.formSubmissionAttachmentReducer.instances,Ci=d.createSelector([vu],t=>Object.values(t)),wu=y(d.createSelector([Ci,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(t.filter(a=>i.has(a.uuid)))})),Mu=y(d.createSelector([Ci,(t,e)=>e],(t,e)=>g(t.filter(i=>i.form_submission===e)))),Eu=Di.reducer,Ae=I(t=>t.uuid),ju=Ae.getInitialState({}),ki=d.createSlice({name:"formSubmissions",initialState:ju,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ju)),reducers:{initializeFormSubmissions:Ae.initialize,setFormSubmission:Ae.setOne,setFormSubmissions:Ae.setMany,addFormSubmission:Ae.addOne,addFormSubmissions:Ae.addMany,updateFormSubmission:Ae.updateOne,updateFormSubmissions:Ae.updateMany,deleteFormSubmission:Ae.deleteOne,deleteFormSubmissions:Ae.deleteMany}}),{initializeFormSubmissions:qu,setFormSubmission:Mt,setFormSubmissions:Ay,addFormSubmission:Bi,addFormSubmissions:Et,updateFormSubmission:Vu,updateFormSubmissions:fy,deleteFormSubmission:Gi,deleteFormSubmissions:jt}=ki.actions,$i=t=>t.formSubmissionReducer.instances,Li=d.createSelector([$i],t=>Object.values(t)),Ni=t=>e=>e.formSubmissionReducer.instances[t],zu=y(d.createSelector([$i,ji,(t,e)=>e],(t,e,i)=>{const a=new Set;for(const c of Object.values(e))c.form===i&&a.add(c.uuid);return Object.values(t).filter(c=>a.has(c.form_revision))})),Uu=y(d.createSelector([Li,(t,e)=>e],(t,e)=>Object.values(t).filter(i=>i.issue===e))),Du=y(d.createSelector([Li,(t,e)=>e],(t,e)=>t.filter(i=>i.asset===e))),Cu=ki.reducer,fe=I(t=>t.uuid),ku=fe.getInitialState({}),Hi=d.createSlice({name:"geoImages",initialState:ku,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ku)),reducers:{initializeGeoImages:fe.initialize,setGeoImage:fe.setOne,setGeoImages:fe.setMany,addGeoImage:fe.addOne,addGeoImages:fe.addMany,updateGeoImage:fe.updateOne,updateGeoImages:fe.updateMany,deleteGeoImage:fe.deleteOne,deleteGeoImages:fe.deleteMany}}),{initializeGeoImages:Bu,setGeoImage:at,setGeoImages:Gu,addGeoImage:$u,addGeoImages:Lu,updateGeoImage:Nu,updateGeoImages:yy,deleteGeoImage:Wi,deleteGeoImages:Hu}=Hi.actions,Wu=t=>t.geoImageReducer.instances,Yu=d.createSelector([Wu],t=>Object.values(t)),Yi=t=>e=>e.geoImageReducer.instances[t],Sy=y(d.createSelector([Yu,(t,e)=>e],(t,e)=>g(t.filter(i=>i.project===e)))),Ku=Hi.reducer,ye=I(t=>t.uuid),Zu=ye.getInitialState({}),Ki=d.createSlice({name:"issueAssociations",initialState:Zu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Zu)),reducers:{initializeIssueAssociations:ye.initialize,addIssueAssociation:ye.addOne,addIssueAssociations:ye.addMany,setIssueAssociation:ye.setOne,setIssueAssociations:ye.setMany,updateIssueAssociation:ye.updateOne,updateIssueAssociations:ye.updateMany,deleteIssueAssociation:ye.deleteOne,deleteIssueAssociations:ye.deleteMany}}),{initializeIssueAssociations:Ju,setIssueAssociations:gy,setIssueAssociation:by,updateIssueAssociation:Xu,updateIssueAssociations:Py,addIssueAssociation:Zi,addIssueAssociations:Ji,deleteIssueAssociation:Xi,deleteIssueAssociations:Qi}=Ki.actions,ct=t=>t.issueAssociationReducer.instances,Fy=d.createSelector([ct],t=>Object.values(t)),Qu=t=>e=>e.issueAssociationReducer.instances[t],xu=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.associated_issue===e)))),eo=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.issue===e)))),to=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.asset===e)))),so=Ki.reducer,Se=I(t=>t.uuid),io=Se.getInitialState({}),xi=d.createSlice({name:"issueAttachments",initialState:io,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,io)),reducers:{initializeIssueAttachments:Se.initialize,addIssueAttachment:Se.addOne,addIssueAttachments:Se.addMany,setIssueAttachment:Se.setOne,setIssueAttachments:Se.setMany,updateIssueAttachment:Se.updateOne,updateIssueAttachments:Se.updateMany,deleteIssueAttachment:Se.deleteOne,deleteIssueAttachments:Se.deleteMany}}),{initializeIssueAttachments:ea,addIssueAttachment:Ty,addIssueAttachments:ta,setIssueAttachment:ao,setIssueAttachments:Iy,updateIssueAttachment:Oy,updateIssueAttachments:co,deleteIssueAttachment:no,deleteIssueAttachments:sa}=xi.actions,ro=t=>t.issueAttachmentReducer.instances,uo=d.createSelector([ro],t=>Object.values(t)),oo=y(d.createSelector([uo,(t,e)=>e],(t,e)=>g(t.filter(({issue:i})=>e===i)))),lo=t=>e=>e.issueAttachmentReducer.instances[t],ho=xi.reducer,ge=I(t=>t.uuid),mo=ge.getInitialState({}),ia=d.createSlice({name:"issueCommentAttachments",initialState:mo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,mo)),reducers:{initializeIssueCommentAttachments:ge.initialize,addIssueCommentAttachment:ge.addOne,addIssueCommentAttachments:ge.addMany,setIssueCommentAttachment:ge.setOne,setIssueCommentAttachments:ge.setMany,updateIssueCommentAttachment:ge.updateOne,updateIssueCommentAttachments:ge.updateMany,deleteIssueCommentAttachment:ge.deleteOne,deleteIssueCommentAttachments:ge.deleteMany}}),{initializeIssueCommentAttachments:aa,addIssueCommentAttachment:_y,addIssueCommentAttachments:po,setIssueCommentAttachment:Ao,setIssueCommentAttachments:Ry,updateIssueCommentAttachment:vy,updateIssueCommentAttachments:fo,deleteIssueCommentAttachment:yo,deleteIssueCommentAttachments:So}=ia.actions,go=t=>t.issueCommentAttachmentReducer.instances,bo=d.createSelector([go],t=>Object.values(t)),Po=t=>e=>e.issueCommentAttachmentReducer.instances[t],wy=y(d.createSelector([bo,(t,e)=>e],(t,e)=>g(t.filter(({issue_comment:i})=>e===i)))),Fo=ia.reducer,be=I(t=>t.uuid),To=be.getInitialState({}),ca=d.createSlice({name:"issueComments",initialState:To,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,To)),reducers:{initializeIssueComments:be.initialize,addIssueComment:be.addOne,addIssueComments:be.addMany,setIssueComment:be.setOne,setIssueComments:be.setMany,updateIssueComment:be.updateOne,updateIssueComments:be.updateMany,deleteIssueComment:be.deleteOne,deleteIssueComments:be.deleteMany}}),{initializeIssueComments:My,addIssueComment:na,addIssueComments:Ey,setIssueComment:ra,setIssueComments:Io,updateIssueComment:jy,updateIssueComments:qy,deleteIssueComment:da,deleteIssueComments:Vy}=ca.actions,Oo=t=>t.issueCommentReducer.instances,ua=t=>e=>e.issueCommentReducer.instances[t],zy=y(d.createSelector([Oo,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.issue===e)))),_o=ca.reducer,Pe=I(t=>t.uuid),Ro=Pe.getInitialState({}),oa=d.createSlice({name:"issues",initialState:Ro,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Ro)),reducers:{initializeIssues:Pe.initialize,addIssue:Pe.addOne,addIssues:Pe.addMany,setIssue:Pe.setOne,setIssues:Pe.setMany,updateIssue:Pe.updateOne,updateIssues:Pe.updateMany,deleteIssue:Pe.deleteOne,deleteIssues:Pe.deleteMany}}),{initializeIssues:vo,addIssue:la,addIssues:wo,setIssue:Uy,setIssues:Dy,updateIssue:qt,updateIssues:Cy,deleteIssue:ha,deleteIssues:Mo}=oa.actions,ma=t=>t.issueReducer.instances,pa=d.createSelector([ma],t=>Object.values(t)),Aa=t=>e=>e.issueReducer.instances[t],ky=y(d.createSelector([ma,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssuesByIds: No issue exists with the id",a)}return g(i)})),By=y(d.createSelector([pa,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Eo=y(d.createSelector([pa,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),jo=oa.reducer,Fe=I(t=>t.uuid),qo=Fe.getInitialState({}),fa=d.createSlice({name:"issueTypeAttachments",initialState:qo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,qo)),reducers:{initializeIssueTypeAttachments:Fe.initialize,addIssueTypeAttachment:Fe.addOne,addIssueTypeAttachments:Fe.addMany,setIssueTypeAttachment:Fe.setOne,setIssueTypeAttachments:Fe.setMany,updateIssueTypeAttachment:Fe.updateOne,updateIssueTypeAttachments:Fe.updateMany,deleteIssueTypeAttachment:Fe.deleteOne,deleteIssueTypeAttachments:Fe.deleteMany}}),{initializeIssueTypeAttachments:ya,addIssueTypeAttachment:Gy,addIssueTypeAttachments:Vo,setIssueTypeAttachment:zo,setIssueTypeAttachments:$y,updateIssueTypeAttachment:Ly,updateIssueTypeAttachments:Uo,deleteIssueTypeAttachment:Do,deleteIssueTypeAttachments:Co}=fa.actions,ko=t=>t.issueTypeAttachmentReducer.instances,Bo=d.createSelector([ko],t=>Object.values(t)),Go=t=>e=>e.issueTypeAttachmentReducer.instances[t],Ny=y(d.createSelector([Bo,(t,e)=>e],(t,e)=>g(t.filter(({issue_type:i})=>e===i)))),$o=fa.reducer,Te=I(t=>t.uuid),Lo=Te.getInitialState({}),Sa=d.createSlice({name:"issueTypeFieldsAttachments",initialState:Lo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lo)),reducers:{initializeIssueTypeFieldsAttachments:Te.initialize,addIssueTypeFieldsAttachment:Te.addOne,addIssueTypeFieldsAttachments:Te.addMany,setIssueTypeFieldsAttachment:Te.setOne,setIssueTypeFieldsAttachments:Te.setMany,updateIssueTypeFieldsAttachment:Te.updateOne,updateIssueTypeFieldsAttachments:Te.updateMany,deleteIssueTypeFieldsAttachment:Te.deleteOne,deleteIssueTypeFieldsAttachments:Te.deleteMany}}),{initializeIssueTypeFieldsAttachments:No,addIssueTypeFieldsAttachment:Hy,addIssueTypeFieldsAttachments:Ho,setIssueTypeFieldsAttachment:Wy,setIssueTypeFieldsAttachments:Yy,updateIssueTypeFieldsAttachment:Ky,updateIssueTypeFieldsAttachments:Wo,deleteIssueTypeFieldsAttachment:Zy,deleteIssueTypeFieldsAttachments:Yo}=Sa.actions,Ko=t=>t.issueTypeFieldsAttachmentReducer.instances,Zo=d.createSelector([Ko],t=>Object.values(t)),Jy=y(d.createSelector([Zo,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),Xy=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],Jo=Sa.reducer,Ie=I(t=>t.uuid),Xo=Ie.getInitialState({}),ga=d.createSlice({name:"issueTypeFieldValues",initialState:Xo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Xo)),reducers:{initializeIssueTypeFieldValues:Ie.initialize,addIssueTypeFieldValues:Ie.addOne,addIssueTypeFieldValuesMany:Ie.addMany,setIssueTypeFieldValues:Ie.setOne,setIssueTypeFieldValuesMany:Ie.setMany,updateIssueTypeFieldValues:Ie.updateOne,updateIssueTypeFieldValuesMany:Ie.updateMany,deleteIssueTypeFieldValues:Ie.deleteOne,deleteIssueTypeFieldValuesMany:Ie.deleteMany}}),{initializeIssueTypeFieldValues:Qo,addIssueTypeFieldValues:ba,addIssueTypeFieldValuesMany:Qy,setIssueTypeFieldValues:xy,setIssueTypeFieldValuesMany:eS,updateIssueTypeFieldValues:nt,updateIssueTypeFieldValuesMany:tS,deleteIssueTypeFieldValues:Pa,deleteIssueTypeFieldValuesMany:sS}=ga.actions,xo=t=>t.issueTypeFieldValuesReducer.instances,Fa=d.createSelector([xo],t=>Object.values(t)),iS=y(d.createSelector([Fa,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue===e)))),Ta=t=>e=>e.issueTypeFieldValuesReducer.instances[t],el=ga.reducer,Oe=I(t=>t.uuid),tl=Oe.getInitialState({}),Ia=d.createSlice({name:"issueTypeFields",initialState:tl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,tl)),reducers:{initializeIssueTypeFields:Oe.initialize,addIssueTypeFields:Oe.addOne,addIssueTypeFieldsMany:Oe.addMany,setIssueTypeFields:Oe.setOne,setIssueTypeFieldsMany:Oe.setMany,updateIssueTypeFields:Oe.updateOne,updateIssueTypeFieldsMany:Oe.updateMany,deleteIssueTypeFields:Oe.deleteOne,deleteIssueTypeFieldsMany:Oe.deleteMany}}),{initializeIssueTypeFields:sl,addIssueTypeFields:il,addIssueTypeFieldsMany:aS,setIssueTypeFields:cS,setIssueTypeFieldsMany:nS,updateIssueTypeFields:al,updateIssueTypeFieldsMany:rS,deleteIssueTypeFields:cl,deleteIssueTypeFieldsMany:dS}=Ia.actions,nl=t=>t.issueTypeFieldsReducer.instances,Vt=d.createSelector([nl],t=>Object.values(t)),uS=y(d.createSelector([Vt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue_type===e)))),oS=y(d.createSelector([Vt,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),lS=y(d.createSelector([Vt,Fa,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.issue_type===i).map(c=>c.uuid));return g(e.filter(c=>a.has(c.fields_revision)))})),hS=t=>e=>e.issueTypeFieldsReducer.instances[t],rl=Ia.reducer,_e=I(t=>t.uuid),dl=_e.getInitialState({}),Oa=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:dl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,dl)),reducers:{initializeIssueTypeFieldValuesAttachments:_e.initialize,addIssueTypeFieldValuesAttachment:_e.addOne,addIssueTypeFieldValuesAttachments:_e.addMany,setIssueTypeFieldValuesAttachment:_e.setOne,setIssueTypeFieldValuesAttachments:_e.setMany,updateIssueTypeFieldValuesAttachment:_e.updateOne,updateIssueTypeFieldValuesAttachments:_e.updateMany,deleteIssueTypeFieldValuesAttachment:_e.deleteOne,deleteIssueTypeFieldValuesAttachments:_e.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:ul,addIssueTypeFieldValuesAttachment:mS,addIssueTypeFieldValuesAttachments:zt,setIssueTypeFieldValuesAttachment:pS,setIssueTypeFieldValuesAttachments:AS,updateIssueTypeFieldValuesAttachment:fS,updateIssueTypeFieldValuesAttachments:ol,deleteIssueTypeFieldValuesAttachment:yS,deleteIssueTypeFieldValuesAttachments:Ut}=Oa.actions,ll=t=>t.issueTypeFieldValuesAttachmentReducer.instances,_a=d.createSelector([ll],t=>Object.values(t)),SS=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],hl=y(d.createSelector([_a,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(t.filter(a=>i.has(a.uuid)))})),ml=y(d.createSelector([_a,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),pl=Oa.reducer,C=I(t=>t.uuid),Al=C.getInitialState({}),Ra=d.createSlice({name:"issueTypes",initialState:Al,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Al)),reducers:{initializeIssueTypes:C.initialize,addIssueType:C.addOne,addIssueTypes:C.addMany,setIssueType:C.setOne,setIssueTypes:C.setMany,updateIssueType:C.updateOne,updateIssueTypes:C.updateMany,deleteIssueType:C.deleteOne,deleteIssueTypes:C.deleteMany,removeIssueType:C.deleteOne}}),{initializeIssueTypes:fl,addIssueType:yl,addIssueTypes:gS,setIssueType:rt,setIssueTypes:bS,updateIssueType:Sl,updateIssueTypes:PS,deleteIssueType:FS,deleteIssueTypes:TS,removeIssueType:va}=Ra.actions,wa=t=>t.issueTypeReducer.instances,gl=d.createSelector(wa,t=>Object.values(t)),Ma=t=>e=>e.issueTypeReducer.instances[t],IS=y(d.createSelector([wa,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssueTypesByIds: No issue type exists with the id",a)}return i})),OS=y(d.createSelector([gl,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),bl=Ra.reducer,Re=I(t=>t.uuid),Pl=Re.getInitialState({}),Ea=d.createSlice({name:"issueUpdates",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Pl)),reducers:{initializeIssueUpdates:Re.initialize,addIssueUpdate:Re.addOne,addIssueUpdates:Re.addMany,setIssueUpdate:Re.setOne,setIssueUpdates:Re.setMany,updateIssueUpdate:Re.updateOne,updateIssueUpdates:Re.updateMany,deleteIssueUpdate:Re.deleteOne,deleteIssueUpdates:Re.deleteMany}}),{initializeIssueUpdates:Fl,addIssueUpdate:Tl,addIssueUpdates:Il,setIssueUpdate:_S,setIssueUpdates:RS,updateIssueUpdate:vS,updateIssueUpdates:wS,deleteIssueUpdate:Ol,deleteIssueUpdates:_l}=Ea.actions,Rl=t=>t.issueUpdateReducer.instances,vl=d.createSelector([Rl],t=>Object.values(t)),wl=y(d.createSelector([vl,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue===e)))),Ml=Ea.reducer,ve=I(t=>t.id),El=ve.getInitialState({currentUser:null}),ja=d.createSlice({name:"users",initialState:El,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,El)),reducers:{initializeUsers:ve.initialize,setUsers:ve.setMany,setUser:ve.setOne,addUsers:ve.addMany,addUser:ve.addOne,updateUsers:ve.updateMany,updateUser:ve.updateOne,deleteUser:ve.deleteOne,deleteUsers:ve.deleteMany,setCurrentUser:(t,e)=>{t.currentUser=e.payload},setProfilePicture:(t,e)=>{if(!t.currentUser)return;t.currentUser.profile.file=e.payload.file??null,t.currentUser.profile.file_sha1=e.payload.file_sha1??null;const i=t.instances[t.currentUser.id];if(!i)throw new Error("Unable to find current user in users slice");i.profile.file=e.payload.file??null,i.profile.file_sha1=e.payload.file_sha1??null}}}),{initializeUsers:jl,setUsers:MS,setUser:ES,addUsers:jS,addUser:ql,updateUsers:qS,updateUser:VS,deleteUser:Vl,deleteUsers:zS,setCurrentUser:US,setProfilePicture:DS}=ja.actions,zl=ja.reducer,Ul=t=>t.userReducer.currentUser,Dt=t=>t.userReducer.instances,qa=d.createSelector([Dt],t=>Object.values(t)),Dl=t=>e=>e.userReducer.instances[t],CS=y(d.createSelector([Dt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectUsersByIds: No user exists with the id",a)}return g(i)})),we=I(t=>t.uuid),Cl=we.getInitialState({}),Va=d.createSlice({name:"organizationAccess",initialState:Cl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Cl)),reducers:{initializeOrganizationAccesses:we.initialize,addOrganizationAccess:we.addOne,addOrganizationAccesses:we.addMany,setOrganizationAccess:we.setOne,setOrganizationAccesses:we.setMany,updateOrganizationAccess:we.updateOne,updateOrganizationAccesses:we.updateMany,deleteOrganizationAccess:we.deleteOne,deleteOrganizationAccesses:we.deleteMany}}),{initializeOrganizationAccesses:kl,addOrganizationAccess:Bl,addOrganizationAccesses:kS,setOrganizationAccess:BS,setOrganizationAccesses:GS,updateOrganizationAccess:Ct,updateOrganizationAccesses:$S,deleteOrganizationAccess:Gl,deleteOrganizationAccesses:LS}=Va.actions,$l=Va.reducer,za=t=>t.organizationAccessReducer.instances,Ua=t=>e=>e.organizationAccessReducer.instances[t],NS=d.createSelector([Ul,za],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),Ll=d.createSelector([za],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return ht(e)}),HS=y(d.createSelector([Dt,Ll,(t,e)=>e],(t,e,i)=>g(Object.values(t).filter(a=>{const c=e[a.id];return!!c&&c.organization===i})))),Me=I(t=>t.uuid),Nl=Me.getInitialState({}),Da=d.createSlice({name:"organizations",initialState:Nl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Nl)),reducers:{initializeOrganizations:Me.initialize,setOrganizations:Me.setMany,setOrganization:Me.setOne,addOrganizations:Me.addMany,addOrganization:Me.addOne,updateOrganizations:Me.updateMany,updateOrganization:Me.updateOne,deleteOrganization:Me.deleteOne,deleteOrganizations:Me.deleteMany}}),{initializeOrganizations:Hl,setOrganizations:WS,setOrganization:YS,addOrganizations:KS,addOrganization:Wl,updateOrganizations:ZS,updateOrganization:Yl,deleteOrganization:JS,deleteOrganizations:XS}=Da.actions,Kl=t=>t.organizationReducer.instances,QS=d.createSelector([Kl],t=>Object.values(t)),xS=t=>e=>e.organizationReducer.instances[t],Zl=Da.reducer,Jl=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Ne.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},Xl={deletedRequests:[],latestRetryTime:0},Ca=d.createSlice({name:"outbox",initialState:Xl,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Xl)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return Jl(a,e,i)}},markForDeletion(t,e){t.deletedRequests.push(e.payload)},markAsDeleted(t,e){const i=t.deletedRequests.indexOf(e.payload);i!==-1&&t.deletedRequests.splice(i,1)},_setLatestRetryTime:(t,e)=>{t.latestRetryTime=e.payload}}}),eg=t=>t.outboxReducer.deletedRequests,tg=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Ql,markForDeletion:sg,markAsDeleted:xl,_setLatestRetryTime:eh}=Ca.actions,th=Ca.reducer,Ee=I(t=>t.uuid),sh=Ee.getInitialState({}),ka=d.createSlice({name:"projectAccess",initialState:sh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,sh)),reducers:{initializeProjectAccesses:Ee.initialize,addProjectAccess:Ee.addOne,addProjectAccesses:Ee.addMany,setProjectAccess:Ee.setOne,setProjectAccesses:Ee.setMany,updateProjectAccess:Ee.updateOne,updateProjectAccesses:Ee.updateMany,deleteProjectAccess:Ee.deleteOne,deleteProjectAccesses:Ee.deleteMany}}),{initializeProjectAccesses:ih,addProjectAccess:Ba,addProjectAccesses:ah,setProjectAccess:ig,setProjectAccesses:ag,updateProjectAccess:dt,updateProjectAccesses:cg,deleteProjectAccess:Ga,deleteProjectAccesses:ch}=ka.actions,nh=ka.reducer,$a=t=>t.projectAccessReducer.instances,kt=d.createSelector($a,t=>Object.values(t)),La=t=>e=>e.projectAccessReducer.instances[t],rh=y(d.createSelector([$a,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.project===e)))),ng=y(d.createSelector([kt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.project===e))i[a.user]=a;return i})),rg=y(d.createSelector([qa,kt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.project===i).map(c=>c.user));return g(t.filter(c=>a.has(c.id)))})),je=I(t=>t.uuid),dh=je.getInitialState({}),Na=d.createSlice({name:"projectAttachments",initialState:dh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,dh)),reducers:{initializeProjectAttachments:je.initialize,addProjectAttachment:je.addOne,addProjectAttachments:je.addMany,setProjectAttachment:je.setOne,setProjectAttachments:je.setMany,updateProjectAttachment:je.updateOne,updateProjectAttachments:je.updateMany,deleteProjectAttachment:je.deleteOne,deleteProjectAttachments:je.deleteMany}}),{initializeProjectAttachments:uh,addProjectAttachment:dg,addProjectAttachments:oh,setProjectAttachment:lh,setProjectAttachments:hh,updateProjectAttachment:ug,updateProjectAttachments:mh,deleteProjectAttachment:ph,deleteProjectAttachments:Ha}=Na.actions,Ah=t=>t.projectAttachmentReducer.instances,fh=d.createSelector([Ah],t=>Object.values(t)),yh=t=>e=>e.projectAttachmentReducer.instances[t],Sh=y(d.createSelector([fh,(t,e)=>e],(t,e)=>g(t.filter(({project:i})=>e===i)))),gh=Na.reducer,qe=I(t=>t.uuid),bh=qe.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),Wa=d.createSlice({name:"projectFiles",initialState:bh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,bh)),reducers:{initializeProjectFiles:qe.initialize,setProjectFile:qe.setOne,setProjectFiles:qe.setMany,addProjectFile:qe.addOne,addProjectFiles:qe.addMany,updateProjectFile:qe.updateOne,updateProjectFiles:qe.updateMany,deleteProjectFile:qe.deleteOne,deleteProjectFiles:qe.deleteMany,setIsImportingProjectFile:(t,e)=>{t.isImportingProjectFile=e.payload},saveActiveProjectFileBounds:(t,e)=>{const i=t.activeProjectFileId;if(!i)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[i])throw new Error(`Tried to save bounds for active project file, but project file with ID ${i}
|
|
2
|
-
doesn't exist.`);t.instances[i].bounds=e.payload},setActiveProjectFileId:(t,e)=>{t.activeProjectFileId=e.payload},resetProjectFileObjectUrls:(t,...e)=>{for(const i in t.instances)delete t.instances[i].objectURL}}}),{initializeProjectFiles:Ph,setProjectFile:og,setProjectFiles:lg,addProjectFile:hg,addProjectFiles:Fh,updateProjectFile:Ya,updateProjectFiles:mg,deleteProjectFile:Th,deleteProjectFiles:Ih,setIsImportingProjectFile:Oh,setActiveProjectFileId:_h,saveActiveProjectFileBounds:Rh,resetProjectFileObjectUrls:pg}=Wa.actions,vh=t=>t.projectFileReducer.instances,wh=d.createSelector([vh],t=>g(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),Ag=t=>e=>e.projectFileReducer.instances[t],fg=t=>t.projectFileReducer.activeProjectFileId,yg=t=>t.projectFileReducer.isImportingProjectFile,Mh=Wa.reducer,Ve=I(t=>t.uuid),Eh=Ve.getInitialState({}),Ka=d.createSlice({name:"projects",initialState:Eh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Eh)),reducers:{initializeProjects:Ve.initialize,setProjects:Ve.setMany,setProject:Ve.setOne,addProjects:Ve.addMany,addProject:Ve.addOne,updateProjects:Ve.updateMany,updateProject:Ve.updateOne,deleteProject:Ve.deleteOne,deleteProjects:Ve.deleteMany}}),{initializeProjects:jh,setProjects:Sg,setProject:gg,addProjects:bg,addProject:Za,updateProjects:Pg,updateProject:qh,deleteProject:Ja,deleteProjects:Fg}=Ka.actions,Vh=Ka.reducer,zh=t=>t.projectReducer.instances,Xa=d.createSelector([zh],t=>g(Object.values(t))),Uh=t=>e=>e.projectReducer.instances[t],Tg=y(d.createSelector([Xa,kt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.user===i).map(c=>c.project));return g(t.filter(c=>a.has(c.uuid)))})),Ig=y(d.createSelector([Xa,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization_owner===e)))),Og={isRehydrated:!1},Qa=d.createSlice({name:"rehydrated",initialState:Og,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:_g}=Qa.actions,Rg=t=>t.rehydratedReducer.isRehydrated,Dh=Qa.reducer,ze=I(t=>t.uuid),Ch=ze.getInitialState({}),xa=d.createSlice({name:"teamMemberships",initialState:Ch,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Ch)),reducers:{initializeTeamMemberships:ze.initialize,addTeamMembership:ze.addOne,addTeamMemberships:ze.addMany,setTeamMembership:ze.setOne,setTeamMemberships:ze.setMany,updateTeamMembership:ze.updateOne,updateTeamMemberships:ze.updateMany,deleteTeamMembership:ze.deleteOne,deleteTeamMemberships:ze.deleteMany}}),{initializeTeamMemberships:kh,addTeamMembership:Bh,addTeamMemberships:vg,setTeamMembership:ec,setTeamMemberships:wg,updateTeamMembership:Mg,updateTeamMemberships:Eg,deleteTeamMembership:tc,deleteTeamMemberships:jg}=xa.actions,Gh=xa.reducer,$h=t=>t.teamMembershipReducer.instances,sc=d.createSelector([$h],t=>Object.values(t)),Lh=t=>e=>e.teamMembershipReducer.instances[t],qg=y(d.createSelector([sc,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.team===e))i[a.user]=a;return i})),Vg=y(d.createSelector([qa,sc,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.team===i).map(c=>c.user));return g(t.filter(c=>a.has(c.id)))})),Ue=I(t=>t.uuid),Nh=Ue.getInitialState({}),ic=d.createSlice({name:"teams",initialState:Nh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Nh)),reducers:{initializeTeams:Ue.initialize,addTeam:Ue.addOne,addTeams:Ue.addMany,setTeam:Ue.setOne,setTeams:Ue.setMany,updateTeam:Ue.updateOne,updateTeams:Ue.updateMany,deleteTeam:Ue.deleteOne,deleteTeams:Ue.deleteMany}}),{initializeTeams:Hh,addTeam:Wh,addTeams:zg,setTeam:ut,setTeams:Ug,updateTeam:Yh,updateTeams:Dg,deleteTeam:ac,deleteTeams:Cg}=ic.actions,cc=t=>t.teamReducer.instances,Kh=d.createSelector([cc],t=>Object.values(t)),nc=t=>e=>e.teamReducer.instances[t],kg=y(d.createSelector([cc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectTeamsByIds: No team exists with the id",a)}return g(i)})),Bg=y(d.createSelector([Kh,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),Zh=ic.reducer,Gg={version:0},Jh=d.createSlice({name:"versioning",initialState:Gg,reducers:{}}),Xh=Jh.reducer,rc={outboxReducer:th,fileReducer:au,authReducer:Id},$g=d.combineReducers(rc),Qh={...rc,[Ze]:Xh,categoryReducer:Md,assetReducer:br,assetAttachmentReducer:$c,assetStageCompletionReducer:Or,assetStageReducer:Er,assetTypeReducer:Pd,assetTypeAttachmentReducer:$r,issueReducer:jo,issueAttachmentReducer:ho,issueTypeReducer:bl,issueTypeAttachmentReducer:$o,organizationReducer:Zl,projectReducer:Vh,projectAttachmentReducer:gh,projectAccessReducer:nh,organizationAccessReducer:$l,projectFileReducer:Mh,rehydratedReducer:Dh,formReducer:Pu,formRevisionReducer:Su,formRevisionAttachmentReducer:lu,formSubmissionAttachmentReducer:Eu,formSubmissionReducer:Cu,userReducer:zl,emailDomainsReducer:xd,documentsReducer:Wd,documentAttachmentReducer:Gd,teamReducer:Zh,agentsReducer:qc,issueCommentReducer:_o,issueCommentAttachmentReducer:Fo,issueUpdateReducer:Ml,geoImageReducer:Ku,issueAssociationReducer:so,issueTypeFieldsReducer:rl,issueTypeFieldValuesReducer:el,issueTypeFieldsAttachmentReducer:Jo,issueTypeFieldValuesAttachmentReducer:pl,assetTypeFieldsReducer:id,assetTypeFieldValuesReducer:yd,assetTypeFieldsAttachmentReducer:Jr,assetTypeFieldValuesAttachmentReducer:od,assetProcedureReducer:Cn,assetProcedureInstanceReducer:Vn,assetProcedureFieldsReducer:An,assetProcedureFieldValuesReducer:vn,assetProcedureFieldsAttachmentReducer:dn,assetProcedureFieldValuesAttachmentReducer:Fn,assetProcedureAttachmentReducer:Jc,assetProcedureStepFieldsAttachmentReducer:Yn,assetProcedureStepFieldsReducer:Jn,assetProcedureStepFieldValuesAttachmentReducer:ir,assetProcedureStepFieldValuesReducer:or,assetProcedureStepReducer:pr,teamMembershipReducer:Gh},Lg=d.combineReducers(Qh);function Ng(t,e){return Am.useMemo(t,e)}class Hg{constructor(e){S(this,"operations",[]);S(this,"getData");this.getData=e}performOperations(e){let i=e;for(const a of this.operations)i=a(i);return i}filter(e,i){return this.operations.push(a=>a.filter(c=>c[e]===i)),this}exclude(e,i){return this.operations.push(a=>a.filter(c=>c[e]!==i)),this}orderBy(e){return this.operations.push(i=>[...i].sort((a,c)=>a[e]<=c[e]?1:-1)),this}reverse(){return this.operations.push(e=>[...e].reverse()),this}all(){return this.operations.push(e=>e),this}get(e,i){return d.createSelector([this.getData],a=>this.performOperations(a).find(c=>c[e]===i))}count(){return d.createSelector([this.getData],e=>this.performOperations(e).length)}first(){return d.createSelector([this.getData],e=>this.performOperations(e)[0])}last(){return d.createSelector([this.getData],e=>{const i=this.performOperations(e);return i[i.length-1]})}exists(){return d.createSelector([this.getData],e=>this.performOperations(e).length>0)}toSelector(){return d.createSelector([this.getData],e=>g(this.performOperations(e)))}}let xh;function Wg(t){xh=t}function ot(){return xh}let em;function Yg(t){em=t}function Kg(){return em}const tm={};class sm{constructor(e){S(this,"client");tm[this.constructor.name]=this,this.client=e}async enqueueRequest(e,i){return this.client.enqueueRequest(e,this.host,this.constructor.name,i)}async performPagination(e,i,a){const c=[];let n=await this.client.enqueueRequest(e,this.host,this.constructor.name,a);for(c.push(n.results);n.next;)n=await this.client.enqueueRequest(i(n.next),this.host,this.constructor.name,a),c.push(n.results);return c}dispatch(e){this.client.store.dispatch(e)}}const im=()=>nm.length-1,am=t=>(t[Ze]={version:im()},t),cm=()=>am({}),Zg=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),Jg=t=>e=>{var i;return e===void 0&&(e={}),((i=e[Ze])==null?void 0:i.version)===im()?e:t(e)},nm=[am,cm,cm,Zg],Xg=Object.fromEntries(nm.map((t,e)=>[e,Jg(t)]));let dc=null;function Ge(){const t=ot();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(dc)return dc;const e=t.getState().offline.outbox,i=Ke._fromOutbox(e);return dc=i,i}const Qg=t=>{if(t)throw t;const e=ot();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},rm=(t,e,i)=>{const a=Ge();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},dm=(t,e,i)=>{const a=Ge();if(!a)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const n=e.meta.offlineAction.payload.uuid;return a.remove(n),a.getQueue()};async function xg(t,e){if(!e.payload)throw new Error("Received empty payload");return db(e)}const eb={...pc,effect:xg,discard:oc,returnPromises:!0,persistCallback:Qg,retry:ob,persistOptions:{storage:ym},queue:{...pc.queue,enqueue:rm,dequeue:dm,peek:(...t)=>ub(...t)}},tb=Sm(Xg,Ze),sb=d.compose(fm.offline(eb),tb);function ib(t){function e(i){return typeof i=="object"&&i!==null&&["ok","redirect","clientError","serverError","error"].every(c=>c in i)}if(e(t))return t;if(typeof t=="object"&&t!==null){const i=t;if(e(i.response))return i.response;if(i.response&&e(i.response.response))return i.response.response}}async function uc(t,e,i){const a=tm[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const c=a instanceof v;if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");c&&t.payload.checkAuth!==!1&&await a.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},l=t.meta.offline.effect,{payload:m,headers:u,method:o,queryParams:p,attachmentHash:A,isExternalUrl:f,isAuthNeeded:b,isResponseBlob:P}={...r,...l.request},_=l.request;let R=_.url;const z=A?await e.files.fetchCache(A):void 0;if(A&&!z)throw new Error(`Cannot upload file ${A} because it's not cached.`);!f&&!R.startsWith("http")&&(!R.startsWith("/")&&!R.startsWith("blob:")&&(R="/"+R),R=t.meta.offline.effect.BASE_URL+R);const De=V=>{if(A){const Ce=_.s3url;if(!Ce)throw new Error(`No S3 URL for file ${A}`);if("warning"in Ce)throw new Error(`S3 URL warning for file ${A}`);if(!z)throw new Error(`No file for file ${A}`);const lt=Ce.fields["x-amz-checksum-sha1"];if(!lt)throw new Error(`No checksum for file ${A}`);return V.set("x-amz-checksum-sha1",lt).field({...m,...Ce.fields}).attach("file",z)}return V.send(m)},IP={[h.GET]:()=>P?Le.get(R.toString()).responseType("blob"):Le.get(R.toString()),[h.POST]:()=>{const V=Le.post(R.toString());return De(V)},[h.PATCH]:()=>{const V=Le.patch(R.toString());return De(V)},[h.PUT]:()=>{const V=Le.put(R.toString());return De(V)},[h.DELETE]:()=>{const V=Le.delete(R.toString());return De(V)}}[o];let Be=IP();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",_),Be.abort()}),b&&c){const V=a.auth.getAuthHeader();Be=Be.set("Authorization",V)}u&&(Be=Be.set(u));try{return await Be.query(p)}catch(V){const Ce=ib(V),lt=Ce==null?void 0:Ce.status;if(c&<===401)return await a.auth.handleUnauthorized(Be,Ce),Be.query(p);throw new D({response:Ce,innerError:V,discard:om.includes(lt)})}}class ab{constructor(e){S(this,"_all");S(this,"_previous");this._all=[e],this._previous=e,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(e){return this._previous&&(this._previous.next=e),this._all.push(e),this._previous=e,{then:this.then,compile:this.compile}}compile(){return this._all}}class um{constructor(){S(this,"next");this.next=null}then(e){return new ab(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!ot())throw new Error("Client store not set");const a=Kg();if(!a)throw new Error("Client SDK not set");return uc(e,a)}}}class cb extends um{async run(e){return super.run(e)}}class nb extends um{async run(e){return super.run(e)}}const rb=new cb().then(new nb).compile();function db(t){var e;return(e=rb[0])==null?void 0:e.run(t)}const om=[400,409,403,404,405,500];function oc(t,e,i=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
-
|
|
4
|
-
Retries:`,
|
|
5
|
-
Action:`,
|
|
6
|
-
`):
|
|
7
|
-
`):`${
|
|
8
|
-
`)}catch(c){console.error("Failed to extract error message from response body",c)}}else typeof t.body=="string"&&(i=t.body);else t!=null&&t.text?i=t.text:e instanceof Error&&(i=e.message);return!i||i.length>lb?Ye:i}class D extends Error{constructor(i){super(Ye);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:c}=i;this.message=i.message??hb(a,c)??Ye,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class mb extends sm{constructor(e){super(e)}}class v extends sm{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class pb extends v{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(Mc(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(c=>{this.dispatch(jc(c))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(Ec(i))})}async rate(e,i){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${e}/rate/`,payload:{rating:i},blockers:["rate"],blocks:["rate"]})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get agent conversation history",method:h.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(wc(a)),a}}const Ab=5e4,E=1e3,fb="limit";class q extends v{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:c,documentAttachmentReducer:n,projectAttachmentReducer:r,formRevisionAttachmentReducer:l,formSubmissionAttachmentReducer:m,geoImageReducer:u,assetTypeFieldsAttachmentReducer:o,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:A,issueTypeFieldValuesAttachmentReducer:f}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(c.instances),Object.values(n.instances),Object.values(r.instances),Object.values(l.instances),Object.values(m.instances),Object.values(u.instances),Object.values(o.instances),Object.values(p.instances),Object.values(A.instances),Object.values(f.instances)).filter(P=>P.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,c]of Object.entries(e))i[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return i}async getFilePayload(e){const i=await He(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class ke extends q{async _bulkAdd(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=[],r=[],l={};for(const o of e){const{modelUuid:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in l||(l[f.sha1]=f);const b=this.buildOfflineAttachment({file:A,file_sha1:f.sha1,submitted_at:c,created_by:a,description:"",modelUuid:p});n.push(b),r.push(this.buildAttachmentPayload({uuid:b.uuid,file_name:b.file_name,file_sha1:b.file_sha1,file_extension:f.extension,description:b.description,modelUuid:p}))}this.dispatch(this.addAttachments(n));const m=this.enqueueRequest({description:`Add ${this.name}`,method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:c,attachments:r,files:Object.values(l)},blocks:n.map(o=>o.uuid),blockers:n.map(o=>o.file_sha1)});return m.then(({attachments:o,presigned_urls:p})=>{this.dispatch(this.updateAttachments(o)),this.processPresignedUrls(p)}).catch(()=>{this.dispatch(this.removeAttachments(n.map(o=>o.uuid)))}),[n,m.then(({attachments:o})=>o)]}async _delete(e){const{store:i}=this.client,a=this.selectAttachment(e)(i.getState());if(!a)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(this.removeAttachment(a.uuid));const c=this.enqueueRequest({description:`Delete ${this.name}`,method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return c.then(()=>{this.getNumberOfAttachmentsWithSha1(a.file_sha1)===0&&this.client.files.removeCache(a.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(a))}),c}}class yb extends ke{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",Xt);S(this,"addAttachments",Qt);S(this,"updateAttachments",Uc);S(this,"removeAttachments",xt);S(this,"removeAttachment",Dc);S(this,"setAttachment",zc);S(this,"selectAttachment",Bc)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Xt(n)),n}}class Sb extends ke{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-attachments");S(this,"addAttachments",Hc);S(this,"updateAttachments",Yc);S(this,"removeAttachments",Zc);S(this,"removeAttachment",Kc);S(this,"setAttachment",Wc);S(this,"selectAttachment",xc)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:h.GET,url:`${this.url}/`,queryParams:{asset_procedure__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Nc(c)),c}}class gb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(sn(n));const l=this.enqueueRequest({description:"Add asset procedure fields attachments",method:h.POST,url:"/asset-procedure-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(an(u.attachments))}).catch(()=>{this.dispatch(cn(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure fields attachments",method:h.GET,url:"/asset-procedure-fields-attachments/",queryParams:{fields_revision__asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(tn(a)),a}}class bb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(ln(n));const r=this.enqueueRequest({description:"Add Asset Procedure Fields",method:h.POST,url:"/asset-procedure-fields/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(hn(m))}).catch(m=>{throw this.dispatch(mn(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Fields",method:h.GET,url:"/asset-procedure-fields/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(on(a)),a}}function $e(t,e){const i=[];let a=0;const c=t.length;for(;a<c;)i.push(t.slice(a,a+=e));return i}class Pb extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(mt(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset procedure field values attachments",method:h.POST,url:"/asset-procedure-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(Sn(p))}).catch(o=>{throw this.dispatch(pt(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=bn(e)(a);this.dispatch(pt(e));try{await this.enqueueRequest({description:"Delete asset procedure field values attachments",method:h.DELETE,url:"/asset-procedure-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(mt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure field values attachments",method:h.GET,url:"/asset-procedure-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yn(c)),c}}class Fb extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure field values",method:h.POST,url:"/asset-procedure-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[c.uuid]});return this.dispatch(rs(c)),n.then(l=>(this.dispatch(Je(l)),l)).catch(()=>{this.dispatch(ds(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(On(c));const l=[];for(const u of r){const o=u.field_values.map(P=>P.asset),p=u.field_values.map(P=>P.fields_revision),A=u.field_values.map(P=>P.asset_procedure_instance),f=u.field_values.map(P=>P.uuid),b=this.enqueueRequest({description:"Bulk add asset procedure field values",method:h.POST,url:"/asset-procedure-field-values/bulk/",payload:u,blockers:[...o,...p,...A],blocks:f});l.push(b)}return Promise.all(l).then(u=>{this.dispatch(_n(u.flat()))}).catch(()=>{this.dispatch(Rn(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=os(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Je(n));const r=this.enqueueRequest({description:"Update asset procedure field values",method:h.PATCH,url:`/asset-procedure-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure_instance],blocks:[n.uuid]});return r.then(l=>{this.dispatch(Je(l))}).catch(()=>{this.dispatch(Je(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=os(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Pn(e)(a);this.dispatch(ds(e)),this.dispatch(pt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure field values",method:h.DELETE,url:`/asset-procedure-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(rs(c)),this.dispatch(mt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure field values",method:h.GET,url:"/asset-procedure-field-values/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(In(c)),c}}class Tb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(hs(n));const r=this.enqueueRequest({description:"Create asset procedure instance",method:h.POST,url:"/asset-procedure-instances/",payload:w(n),blockers:[e.asset_procedure,e.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Xe(m))}).catch(()=>{this.dispatch(ms(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=fs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure instance with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Xe(c));const n=this.enqueueRequest({description:"Update asset procedure instance",method:h.PATCH,url:`/asset-procedure-instances/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Xe(r))}).catch(()=>{this.dispatch(Xe(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=fs(e)(a);if(!c)throw new Error(`Expected asset procedure instance with uuid ${e} to exist`);return this.dispatch(ms(e)),this.enqueueRequest({description:"Delete asset procedure instance",method:h.DELETE,url:`/asset-procedure-instances/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(hs(c)),n})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure instances",method:h.GET,url:"/asset-procedure-instances/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure instances",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(En(c)),c}}class Ib extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Ss(n));const r=this.enqueueRequest({description:"Create asset procedure",method:h.POST,url:"/asset-procedures/",payload:w(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Qe(m))}).catch(()=>{this.dispatch(gs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ps(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Qe(c));const n=this.enqueueRequest({description:"Update asset procedure",method:h.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Qe(r))}).catch(()=>{this.dispatch(Qe(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ps(e)(a);if(!c)throw new Error(`Expected asset procedure with uuid ${e} to exist`);const n=zn(e)(a);return this.dispatch(gs(e)),this.dispatch(qn(n.map(r=>r.uuid))),this.enqueueRequest({description:"Delete asset procedure",method:h.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(Ss(c)),this.dispatch(jn(n)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedures",method:h.GET,url:"/asset-procedures/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Dn(a)),a}}class Ob extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch($n(n));const l=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:h.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Ln(u.attachments))}).catch(()=>{this.dispatch(Nn(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:h.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Gn(a)),a}}class _b extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Is(n));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:h.POST,url:"/asset-procedure-step-fields/",payload:w(n),blockers:[n.asset_procedure_step],blocks:[n.uuid]});return r.then(m=>{this.dispatch(xe(m))}).catch(m=>{throw this.dispatch(Os(n.uuid)),m}),[n,r]}update(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const c={...a,...e};this.dispatch(xe(c));const n=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:h.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(xe(r))}).catch(r=>{throw this.dispatch(xe(a)),r}),[c,n]}delete(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(Os(e));const c=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:h.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return c.catch(n=>{throw this.dispatch(Is(a)),n}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:h.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Zn(a)),a}}class Rb extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(At(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:h.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(xn(p))}).catch(o=>{throw this.dispatch(ft(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=tr(e)(a);this.dispatch(ft(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:h.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(At(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:h.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qn(c)),c}}class vb extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure step field values",method:h.POST,url:"/asset-procedure-step-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[c.uuid]});return this.dispatch(Es(c)),n.then(l=>(this.dispatch(et(l)),l)).catch(()=>{this.dispatch(js(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(nr(c));const l=[];for(const u of r){const o=u.field_values.map(P=>P.asset),p=u.field_values.map(P=>P.fields_revision),A=u.field_values.map(P=>P.asset_procedure_instance),f=u.field_values.map(P=>P.uuid),b=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:h.POST,url:"/asset-procedure-step-field-values/bulk/",payload:u,blockers:[...o,...p,...A],blocks:f});l.push(b)}return Promise.all(l).then(u=>{this.dispatch(rr(u.flat()))}).catch(()=>{this.dispatch(dr(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=qs(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(et(n));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:h.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure_instance],blocks:[n.uuid]});return r.then(l=>{this.dispatch(et(l))}).catch(()=>{this.dispatch(et(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=qs(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=sr(e)(a);this.dispatch(js(e)),this.dispatch(ft(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:h.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Es(c)),this.dispatch(At(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:h.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(cr(c)),c}}class wb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(zs(n));const r=this.enqueueRequest({description:"Create asset procedure step",method:h.POST,url:"/asset-procedure-steps/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(Us(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ds(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(St(c));const n=this.enqueueRequest({description:"Update asset procedure step",method:h.PATCH,url:`/asset-procedure-steps/${a.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(mr(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ds(e)(a);if(!c)throw new Error(`No asset procedure step with uuid ${e} found in the store`);return this.dispatch(Us(e)),this.enqueueRequest({description:"Delete asset stage",method:h.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(zs(c)),n})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:h.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(hr(a)),a}}class Mb extends v{add(e){var l;const{store:i}=this.client;if(!e.canvas_marker&&!e.geo_marker)throw new Error("Asset must have either a canvas_marker or geo_marker");const a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(ks(n));const r=this.enqueueRequest({description:"Create asset",method:h.POST,url:"/assets/",payload:w(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(tt(m))}).catch(()=>{this.dispatch(Bs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ns(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const c={...a,...e};if(!c.canvas_marker&&!c.geo_marker)throw new Error("Asset must have either a canvas_marker or geo_marker");this.dispatch(tt(c));const n=this.enqueueRequest({description:"Edit asset",method:h.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(tt(r))}).catch(()=>{this.dispatch(tt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ns(e)(a);if(!c)throw new Error(`No asset with uuid ${e} found in the store`);const n=Gc(e)(a),r=Du(e)(a),l=to(e)(a);if(this.dispatch(Bs(e)),n.length>0){const m=n.map(({uuid:u})=>u);this.dispatch(xt(m))}if(r.length>0){const m=r.map(({uuid:u})=>u);this.dispatch(jt(m))}if(l.length>0){const m=l.map(({uuid:u})=>u);this.dispatch(Qi(m))}return this.enqueueRequest({description:"Delete asset",method:h.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(m=>{throw this.dispatch(ks(c)),this.dispatch(Qt(n)),this.dispatch(Et(r)),this.dispatch(Ji(l)),m})}bulkAdd(e,i,a,c){const n=new Date().toISOString(),r=Ne.v4(),l=$e(e,c).map(o=>{const p=o.map(A=>T(A));return{batchId:Ne.v4(),payload:{transaction_id:r,submitted_at:n,asset_type:i,project:a,assets:p}}}),m=[];let u=null;for(const o of l){const{batchId:p,payload:A}=o,f=A.assets.map(R=>R.uuid),b=[i];u&&b.push(u);const P=f;P.push(p);const _=this.enqueueRequest({description:"Batch create assets",method:h.POST,url:"/assets/bulk/",payload:A,blockers:b,blocks:P});u=o.batchId,m.push(_)}return Promise.all(m).then(o=>{const p=o.flat();this.dispatch(bt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=gr(e)(a);this.dispatch(Gs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:h.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(bt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get assets",method:h.GET,url:"/assets/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get assets",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yr(c)),c}}class Eb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Ws(n));const r=this.enqueueRequest({description:"Add asset stage completion",method:h.POST,url:"/asset-stage-completions/",payload:w(n),blockers:[e.asset,e.stage],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Tr(m))}).catch(()=>{this.dispatch(Ks(n.uuid))}),[n,r]}delete(e){const{store:i}=this.client,a=_r(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(Ks(e));const c=this.enqueueRequest({description:"Delete asset stage completion",method:h.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ws(a))}),c}bulkAdd(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=e.map(o=>T(o)),r=n.map(o=>({...o,created_by:c,submitted_at:a})),l=r.map(({uuid:o})=>o);this.dispatch(Ys(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:h.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:n},blockers:[...e.map(o=>o.asset_procedure_instance),...e.map(o=>o.stage),...e.map(o=>o.asset)],blocks:l});return m.then(o=>{this.dispatch(Ir(o))}).catch(()=>{this.dispatch(Zs(l))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Rr(e)(i.getState());this.dispatch(Zs(e));const c=this.enqueueRequest({description:"Deleting asset stage completions",method:h.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return c.catch(()=>{this.dispatch(Ys(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:h.GET,url:"/asset-stage-completions/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset stage completions",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fr(c)),c}}class jb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Qs(n));const r=this.enqueueRequest({description:"Create asset",method:h.POST,url:"/asset-stages/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Pt(m))}).catch(()=>{this.dispatch(xs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ei(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(Pt(c));const n=this.enqueueRequest({description:"Update asset stage",method:h.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Mr(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ei(e)(a);if(!c)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(xs(e)),this.enqueueRequest({description:"Delete asset stage",method:h.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(Qs(c)),n})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:h.GET,url:"/asset-stages/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(wr(a)),a}}class qb extends ke{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",si);S(this,"updateAttachments",Ur);S(this,"removeAttachments",ii);S(this,"removeAttachment",Dr);S(this,"setAttachment",zr);S(this,"selectAttachment",Br)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:h.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Vr(c)),c}}class Vb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(Hr(n));const l=this.enqueueRequest({description:"Add asset type fields attachments",method:h.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Wr(u.attachments))}).catch(()=>{this.dispatch(Yr(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:h.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Nr(a)),a}}class zb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(xr(n));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:h.POST,url:"/asset-type-fields/",payload:w(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ed(m))}).catch(m=>{throw this.dispatch(td(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:h.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qr(a)),a}}class Ub extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(It(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset type field values attachments",method:h.POST,url:"/asset-type-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(nd(p))}).catch(o=>{throw this.dispatch(Ot(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=dd(e)(a);this.dispatch(Ot(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:h.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(It(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:h.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(cd(c)),c}}class Db extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset type field values",method:h.POST,url:"/asset-type-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision],blocks:[c.uuid]});return this.dispatch(ui(c)),n.then(l=>(this.dispatch(st(l)),l)).catch(()=>{this.dispatch(oi(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(md(c));const l=[];for(const u of r){const o=u.field_values.map(b=>b.asset),p=u.field_values.map(b=>b.fields_revision),A=u.field_values.map(b=>b.uuid),f=this.enqueueRequest({description:"Bulk add asset type field values",method:h.POST,url:"/asset-type-field-values/bulk/",payload:u,blockers:[...o,...p],blocks:A});l.push(f)}return Promise.all(l).then(u=>{this.dispatch(pd(u.flat()))}).catch(()=>{this.dispatch(Ad(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=hi(e.uuid)(a);if(!c)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(st(n));const r=this.enqueueRequest({description:"Delete asset type field values",method:h.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.asset],blocks:[n.uuid]});return r.then(l=>{this.dispatch(st(l))}).catch(()=>{this.dispatch(st(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=hi(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ud(e)(a);this.dispatch(oi(e)),this.dispatch(Ot(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:h.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ui(c)),this.dispatch(It(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:h.GET,url:"/asset-type-field-values/",queryParams:{limit:E,paginate:!0,asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(hd(c)),c}}class Cb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(pi(n));const r=this.enqueueRequest({description:"Create asset type",method:h.POST,url:"/asset-types/",payload:w(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(it(m))}).catch(()=>{this.dispatch(Ai(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=yi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(it(c));const n=this.enqueueRequest({description:"Update asset type",method:h.PATCH,url:`/asset-types/${e.uuid}/`,payload:{icon:e.icon,color:e.color,name:e.name,description:e.description},blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(it(r))}).catch(()=>{this.dispatch(it(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=yi(e)(a);if(!c)throw new Error(`Expected asset type with uuid ${e} to exist`);const n=Ls(e)(a),r=Gr(e)(a);return this.dispatch(Ai(e)),this.dispatch(Gs(n.map(l=>l.uuid))),this.dispatch(ii(r.map(({uuid:l})=>l))),this.enqueueRequest({description:"Delete asset type",method:h.DELETE,url:`/asset-types/${e}/`,blockers:[e],blocks:[]}).catch(l=>{throw this.dispatch(pi(c)),this.dispatch(bt(n)),this.dispatch(si(r)),l})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:h.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(gd(a)),a}}class kb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(gi(n));const r=this.enqueueRequest({description:"Create Category",method:h.POST,url:"/categories/",payload:w(n),blockers:[e.project],blocks:[n.uuid]});return[n,r]}update(e){const i=this.client.store.getState(),a=Pi(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(Rd(c));const n=this.enqueueRequest({description:"Edit Category",method:h.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[c,n]}remove(e){const{store:i}=this.client,a=Pi(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(vd(e));const c=this.enqueueRequest({description:"Delete Category",method:h.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch(gi(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:h.GET,url:"/categories/",queryParams:{project__organization_owner:e},blocks:[],blockers:[]},i);return this.dispatch(_d(a)),a}}class Bb extends ke{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",qd);S(this,"updateAttachments",zd);S(this,"removeAttachments",Dd);S(this,"removeAttachment",Ud);S(this,"setAttachment",Vd);S(this,"selectAttachment",Bd)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,n=new Date().toISOString(),r=[],l=[],m={},u={};for(const A of i){const{documentUuid:f,file:b}=A,P=await this.getFilePayload(b);P.sha1 in m||(m[P.sha1]=P,u[P.sha1]=[]);const _=this.buildOfflineAttachment({file:b,file_sha1:P.sha1,submitted_at:n,created_by:c,description:"",modelUuid:f});r.push(_),l.push({uuid:_.uuid,file_name:_.file_name,file_sha1:_.file_sha1,file_extension:P.extension,description:_.description,document:f}),u[P.sha1].push(_.uuid)}this.dispatch(this.addAttachments(r));const o=this.enqueueRequest({description:"Attach files to document",method:h.POST,url:"/document-attachments/bulk/",payload:{submitted_at:n,attachments:l,files:Object.values(m)},blocks:r.map(A=>A.uuid),blockers:r.map(A=>A.file_sha1)});return o.then(({attachments:A,presigned_urls:f})=>{this.dispatch(this.updateAttachments(A));const b=this.processPresignedUrls(f);for(const[P,_]of Object.entries(b))_.then(()=>{const R=u[P];for(const z of R)this.makeReadable(z)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(A=>A.uuid)))}),[r,o.then(({attachments:A})=>A)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`/document-attachments/${i}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",i],blocks:["index-document-attachment"]})}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:h.GET,url:"/document-attachments/",queryParams:{document__project__organization_owner:i},blocks:[],blockers:[]},a),n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:h.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...c,...n];return this.dispatch(jd(r)),r}}class Gb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Nd([n]));const r=this.enqueueRequest({description:"Create Document",method:h.POST,url:"/documents/",payload:w(n),queryParams:{parent_document:n.parent_document??void 0},blockers:n.parent_document?[n.parent_document]:[],blocks:[n.uuid]});return r.catch(()=>{this.dispatch(Ii([n.uuid]))}),[n,r]}update(e){const{store:i}=this.client,a=i.getState().documentsReducer.documents[e.uuid];if(!a)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const c={...a,...e};this.dispatch(We([c]));const n=this.enqueueRequest({description:"Update Document",method:h.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{We([a])}),[c,n]}delete(e){const{store:i}=this.client,a=Rt(i.getState()),c=Hd(e)(i.getState());if(!c)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const n=c.parent_document?a[c.parent_document]:void 0;this.dispatch(Ii([e]));const r=this.enqueueRequest({description:"Delete Document",method:h.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(l=>{this.dispatch(We(l))}).catch(()=>{this.dispatch(We([c])),n&&this.dispatch(We([n]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:h.GET,url:"/documents/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]},i),c=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:h.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),n=[...await a,...await c];return this.dispatch(Ld(n)),n}}class $b extends v{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:h.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Jd(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:h.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(Zd(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:h.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Kd(a)),a}}class Lb extends v{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const Bt={},lc=new Set;let Gt=0,hc=0,mc=0;const Nb=20;class Hb extends v{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",gm.openDB("fileCache",1,{upgrade(i){i.createObjectStore("files")}}))}async renewUploadUrl(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const c=await Yt(a,i),n=await this.enqueueRequest({description:"Get S3 URL",method:h.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await He(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${c}`]});return"url"in n&&this.dispatch(su({sha1:i,...n})),n}async addCache(i,a){if(lc.has(a))return;if(!i.type){const r=i.name.split("."),l=r[r.length-1];i=new File([i],i.name,{type:l})}if(!i.name||!i.size||!i.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const c=await this._dbPromise;!!await c.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Gt++):(await c.put("files",i,a),hc++),lc.add(a),mc++,mc%Nb===0&&console.debug(`File cache summary: ${Gt} hits and ${hc} misses, ${Gt/(Gt+hc)*100}% hit rate over ${mc} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),lc.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return iu(i)(a)??await this.renewUploadUrl(i)}async uploadFileToS3(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const c=await Yt(a,i),n={file_name:a.name,file_sha1:i,file:c},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[n,Promise.resolve(void 0).then()];throw new Error(r.warning)}const l=r.url,m=this.enqueueRequest({url:l,description:"Upload file",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:i,blockers:[`s3-${c}`],blocks:[i],s3url:r});return[n,m]}async fetchFileFromUrl(i,a,c){const n=i.split("?")[0]??i,r=await this.fetchCache(a);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(i.startsWith("blob:")){const o=await Tc(i),p=new File([o],c??a,{type:o.type});return await this.addCache(p,a),p}let l=Bt[n],m=!0;l?m=!1:(l=new Promise(o=>{this.enqueueRequest({description:"Download file",method:h.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const A=new File([p],c??a,{type:p.type});o(A)})}),Bt[n]=l);let u;try{u=await l}catch(o){throw m&&o instanceof D&&delete Bt[n],o}if(m){const o=await He(u);if(o!==a){const f=`The hash of the file returned from the server (${o}) does not match the
|
|
9
|
-
expected hash (${
|
|
1
|
+
(function(i,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],D):(i=typeof globalThis<"u"?globalThis:i||self,D(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,D,u,yt,ht,Ng,Hg,Xa,Rt,Gg,Qa,Kg,Yg,uk,hk,Zg,Jg,Xg){"use strict";var lk=Object.defineProperty;var ok=(i,D,u)=>D in i?lk(i,D,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[D]=u;var p=(i,D,u)=>ok(i,typeof D!="symbol"?D+"":D,u);var Ug;const xa=Object.freeze([]),ec=Object.freeze({});var tc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(tc||{}),m=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(m||{}),sc=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(sc||{}),ic=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ic||{}),us=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(us||{}),j=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(j||{}),nc=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(nc||{}),ac=(t=>(t[t.COMMENT=0]="COMMENT",t[t.APPROVE=2]="APPROVE",t[t.DENY=4]="DENY",t))(ac||{});const Qg=us.MEDIUM,cc=6e4;function M(t){return{addOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},addMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},setOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},setMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},updateOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},updateMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},deleteOne:(h,y)=>{delete h.instances[y.payload]},deleteMany:(h,y)=>{for(const f of y.payload)delete h.instances[f]},initialize:(h,y)=>{h.instances={};const f=new Set;for(const A of y.payload){const O=t(A);f.add(O),h.instances[O]=A}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function xg(){return{initializeSelection:(l,r)=>{l.selection=Array.from(new Set(r.payload))},selectOne:(l,r)=>{new Set(l.selection).has(r.payload)||l.selection.push(r.payload)},selectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)||h.add(y);l.selection=Array.from(h)},unselectOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)&&(h.delete(r.payload),l.selection=Array.from(h))},unselectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)&&h.delete(y);l.selection=Array.from(h)},toggleOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)?h.delete(r.payload):h.add(r.payload),l.selection=Array.from(h)},toggleMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)?h.delete(y):h.add(y);l.selection=Array.from(h)},getInitialState:l=>({...l,selection:[]})}}const Ot="versioning",b=u.createAction("RESET"),W=u.createAction("RESET_PROJECT_STATE"),R=u.createAction("RESET_ORGANIZATION_STATE");function eb(t,s){return Ng.useMemo(t,s)}Ug=Symbol.toStringTag;class hs{constructor(){p(this,Ug,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ms=!1;["true","1"].includes("".toLowerCase())&&(ms=!0);function tb(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const d=e[c];if(!Object.prototype.hasOwnProperty.call(s,d)||t[d]!==s[d])return!1}return!0}function ps(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ms&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ms&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function sb(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const T=t=>t.length===0?xa:t,kt=t=>Object.keys(t).length===0?ec:t,rc=ps(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ys.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),ib=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),nb=1e3*86400,ys=new Date,ab=t=>new Date(t).toDateString()===ys.toDateString(),cb=ps((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ys.getTime())/nb);return n<s||n>e?rc(t):ib.format(n,"days")});function rb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}const fs=async(t,s)=>{s||(s=await ft(t));let e=t.type;if(e.includes("/")&&(e=e.split("/")[1]),!e)throw new Error(`Could not extract file type from ${t.type}`);return`${s}.${e}`};function ft(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const d=rb(c);s(d)})},n.readAsArrayBuffer(t)})}function db(t){if(!t.name||!t.type||!t.size){const s="File has no name, type, and/or size";throw new Error(s)}return`${t.name}&${t.type}${t.size}`}function dc(t,s){return new File([t],s,{type:t.type})}function lb(t,s){const e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s)),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const ob=async t=>{const s={};for(const e of t){const n=await ft(e);s[n]={sha1:n,extension:e.name.split(".").pop()||"",file_type:e.type,size:e.size}}return Object.values(s)},lc=async t=>(await fetch(t)).blob(),ub=t=>new Promise((s,e)=>{const n=new FileReader;n.onloadend=()=>{var a;s(((a=n.result)==null?void 0:a.toString())||"")},n.readAsDataURL(t)});function hb(t){const s=new Blob([t]);Hg.saveAs(s,t.name)}const oc={};function mb(t,s,e,...n){const a=oc[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(oc[t]={[s]:!0},c=!0),c&&console[e](...n)}const uc=["created_at","updated_at","index","revision"];function _(t){return{...t,uuid:ht.v4()}}function pb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function z(t){return t.map(({uuid:s})=>s)}function vt(t,s){return t.localeCompare(s)}function As(t,s){return vt(t.uuid,s.uuid)}function yb(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function fb(t){return t.toLowerCase().replace(" ","-")}function Ab(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Sb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Tb=/^.+@.+\..+$/;function E(t){const s={...t};for(const e of[...uc,"created_by"])e in s&&delete s[e];return s}const hc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Xa(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},wb=t=>{const{roots:s}=hc(t);return s.map(e=>new Rt.Tree(e))},mc=(t,s)=>{const{nodes:e}=hc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Rt.Tree(n)},pc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,yc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,fc=t=>Xa(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Ob=t=>{const{roots:s}=fc(t);return s.map(e=>new Rt.Tree(e))},Ac=(t,s)=>{const{nodes:e}=fc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Rt.Tree(n)};class Ib{constructor(s){p(this,"operations",[]);p(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return u.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return u.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return u.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return u.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return u.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return u.createSelector([this.getData],s=>T(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=M(t=>t.uuid),Sc={instances:{}},Ss=u.createSlice({name:"agents",initialState:Sc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Sc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:Tc,addConversation:wc,addConversations:Fb,setConversation:Oc,setConversations:Pb,updateConversation:Ic,updateConversations:gb,deleteConversation:bb,deleteConversations:_b}=Ss.actions,Ts=t=>t.agentsReducer.instances,Mb=u.createSelector([Ts],t=>Object.values(t)),Rb=S(u.createSelector([Ts,(t,s)=>s],(t,s)=>t[s])),Fc=Ss.reducer,H=M(t=>t.uuid),Pc={instances:{}},ws=u.createSlice({name:"assetAttachments",initialState:Pc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Pc)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:gc,addAssetAttachment:bc,addAssetAttachments:Os,setAssetAttachment:_c,setAssetAttachments:Mc,updateAssetAttachment:Rc,updateAssetAttachments:kc,deleteAssetAttachment:vc,deleteAssetAttachments:Is}=ws.actions,Ec=t=>t.assetAttachmentReducer.instances,Fs=u.createSelector([Ec],t=>Object.values(t)),Vc=t=>s=>s.assetAttachmentReducer.instances[t],Bc=S(u.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),zc=S(u.createSelector([Fs,(t,s)=>s],(t,s)=>T(t.filter(({asset:e})=>s===e)))),Wc=ws.reducer,G=M(({uuid:t})=>t),qc={instances:{}},Ps=u.createSlice({name:"assetProcedureTypeAttachments",initialState:qc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,qc)),reducers:{initializeAssetProcedureTypeAttachments:G.initialize,addAssetProcedureTypeAttachment:G.addOne,addAssetProcedureTypeAttachments:G.addMany,setAssetProcedureTypeAttachment:G.setOne,setAssetProcedureTypeAttachments:G.setMany,updateAssetProcedureTypeAttachment:G.updateOne,updateAssetProcedureTypeAttachments:G.updateMany,deleteAssetProcedureTypeAttachment:G.deleteOne,deleteAssetProcedureTypeAttachments:G.deleteMany}}),{initializeAssetProcedureTypeAttachments:Cc,addAssetProcedureTypeAttachment:jc,addAssetProcedureTypeAttachments:$c,setAssetProcedureTypeAttachment:Dc,setAssetProcedureTypeAttachments:Uc,updateAssetProcedureTypeAttachment:Lc,updateAssetProcedureTypeAttachments:Nc,deleteAssetProcedureTypeAttachment:Hc,deleteAssetProcedureTypeAttachments:Gc}=Ps.actions,Kc=Ps.reducer,Yc=t=>t.assetProcedureTypeAttachmentReducer.instances,gs=u.createSelector([Yc],t=>Object.values(t)),Zc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Jc=S(u.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),kb=S(u.createSelector([gs,(t,s)=>s],(t,s)=>T(t.filter(({asset_procedure_type:e})=>s===e)))),K=M(({uuid:t})=>t),Xc={instances:{}},bs=u.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Xc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Xc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Qc,addAssetProcedureTypeFieldsAttachment:xc,addAssetProcedureTypeFieldsAttachments:er,setAssetProcedureTypeFieldsAttachment:tr,setAssetProcedureTypeFieldsAttachments:sr,updateAssetProcedureTypeFieldsAttachment:ir,updateAssetProcedureTypeFieldsAttachments:nr,deleteAssetProcedureTypeFieldsAttachment:ar,deleteAssetProcedureTypeFieldsAttachments:cr}=bs.actions,rr=bs.reducer,dr=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,_s=u.createSelector([dr],t=>Object.values(t)),vb=S(u.createSelector([_s,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),lr=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],or=S(u.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Y=M(({uuid:t})=>t),ur={instances:{}},Ms=u.createSlice({name:"assetProcedureTypeFields",initialState:ur,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,ur)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:hr,addAssetProcedureTypeFields:mr,addAssetProcedureTypeFieldsMany:pr,setAssetProcedureTypeFields:yr,setAssetProcedureTypeFieldsMany:fr,updateAssetProcedureTypeFields:Ar,updateAssetProcedureTypeFieldsMany:Sr,deleteAssetProcedureTypeFields:Tr,deleteAssetProcedureTypeFieldsMany:wr}=Ms.actions,Or=Ms.reducer,Ir=t=>t.assetProcedureTypeFieldsReducer.instances,Et=u.createSelector([Ir],t=>Object.values(t)),Eb=S(u.createSelector([Et,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),Vb=S(u.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Fr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],Pr=S(u.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Z=M(({uuid:t})=>t),gr={instances:{}},Rs=u.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:gr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,gr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:br,addAssetProcedureTypeFieldValuesAttachment:_r,addAssetProcedureTypeFieldValuesAttachments:ks,setAssetProcedureTypeFieldValuesAttachment:Mr,setAssetProcedureTypeFieldValuesAttachments:Rr,updateAssetProcedureTypeFieldValuesAttachment:kr,updateAssetProcedureTypeFieldValuesAttachments:vr,deleteAssetProcedureTypeFieldValuesAttachment:Er,deleteAssetProcedureTypeFieldValuesAttachments:vs}=Rs.actions,Vr=Rs.reducer,Br=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Es=u.createSelector([Br],t=>Object.values(t)),zr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Wr=S(u.createSelector([Es,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qr=S(u.createSelector([Es,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),J=M(({uuid:t})=>t),Cr={instances:{}},Vs=u.createSlice({name:"assetProcedureTypeFieldValues",initialState:Cr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Cr)),reducers:{initializeAssetProcedureTypeFieldValues:J.initialize,addAssetProcedureTypeFieldValues:J.addOne,addAssetProcedureTypeFieldValuesMany:J.addMany,setAssetProcedureTypeFieldValues:J.setOne,setAssetProcedureTypeFieldValuesMany:J.setMany,updateAssetProcedureTypeFieldValues:J.updateOne,updateAssetProcedureTypeFieldValuesMany:J.updateMany,deleteAssetProcedureTypeFieldValues:J.deleteOne,deleteAssetProcedureTypeFieldValuesMany:J.deleteMany}}),{initializeAssetProcedureTypeFieldValues:jr,addAssetProcedureTypeFieldValues:$r,addAssetProcedureTypeFieldValuesMany:Dr,setAssetProcedureTypeFieldValues:Ur,setAssetProcedureTypeFieldValuesMany:Lr,updateAssetProcedureTypeFieldValues:Nr,updateAssetProcedureTypeFieldValuesMany:Hr,deleteAssetProcedureTypeFieldValues:Gr,deleteAssetProcedureTypeFieldValuesMany:Kr}=Vs.actions,Yr=Vs.reducer,Zr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Vt=u.createSelector([Zr],t=>Object.values(t)),Bb=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),zb=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),Jr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Xr=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),X=M(({uuid:t})=>t),Qr={instances:{}},Bs=u.createSlice({name:"assetProcedures",initialState:Qr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Qr)),reducers:{initializeAssetProcedures:X.initialize,addAssetProcedure:X.addOne,addAssetProcedures:X.addMany,setAssetProcedure:X.setOne,setAssetProcedures:X.setMany,updateAssetProcedure:X.updateOne,updateAssetProcedures:X.updateMany,deleteAssetProcedure:X.deleteOne,deleteAssetProcedures:X.deleteMany}}),{initializeAssetProcedures:xr,addAssetProcedure:ed,addAssetProcedures:zs,updateAssetProcedure:td,updateAssetProcedures:sd,deleteAssetProcedure:id,deleteAssetProcedures:Ws,setAssetProcedure:nd,setAssetProcedures:ad}=Bs.actions,cd=Bs.reducer,rd=t=>t.assetProcedureReducer.instances,Bt=u.createSelector([rd],t=>Object.values(t)),dd=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),Wb=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),ld=t=>s=>s.assetProcedureReducer.instances[t],od=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Q=M(t=>t.uuid),ud={instances:{}},qs=u.createSlice({name:"assetProcedureTypes",initialState:ud,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,ud)),reducers:{initializeAssetProcedureTypes:Q.initialize,addAssetProcedureType:Q.addOne,addAssetProcedureTypes:Q.addMany,setAssetProcedureType:Q.setOne,setAssetProcedureTypes:Q.setMany,updateAssetProcedureType:Q.updateOne,updateAssetProcedureTypes:Q.updateMany,deleteAssetProcedureType:Q.deleteOne,deleteAssetProcedureTypes:Q.deleteMany}}),{initializeAssetProcedureTypes:hd,addAssetProcedureType:md,addAssetProcedureTypes:pd,updateAssetProcedureType:yd,updateAssetProcedureTypes:fd,deleteAssetProcedureType:Ad,deleteAssetProcedureTypes:Sd,setAssetProcedureType:Td,setAssetProcedureTypes:wd}=qs.actions,Od=qs.reducer,Id=t=>t.assetProcedureTypeReducer.instances,Cs=u.createSelector([Id],t=>Object.values(t)),Fd=t=>s=>s.assetProcedureTypeReducer.instances[t],Pd=S(u.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qb=S(u.createSelector([Cs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),x=M(t=>t.uuid),gd={instances:{}},js=u.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:gd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gd)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:bd,addAssetProcedureStepFieldsAttachment:_d,addAssetProcedureStepFieldsAttachments:Md,setAssetProcedureStepFieldsAttachment:Rd,setAssetProcedureStepFieldsAttachments:kd,updateAssetProcedureStepFieldsAttachment:vd,updateAssetProcedureStepFieldsAttachments:Ed,deleteAssetProcedureStepFieldsAttachment:Vd,deleteAssetProcedureStepFieldsAttachments:Bd}=js.actions,zd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,$s=u.createSelector([zd],t=>Object.values(t)),Cb=S(u.createSelector([$s,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),Wd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],qd=S(u.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Cd=js.reducer,ee=M(t=>t.uuid),jd={instances:{}},Ds=u.createSlice({name:"assetProcedureStepFields",initialState:jd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,jd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:$d,addAssetProcedureStepFields:Dd,addAssetProcedureStepFieldsMany:Ud,setAssetProcedureStepFields:Ld,setAssetProcedureStepFieldsMany:Nd,updateAssetProcedureStepFields:Hd,updateAssetProcedureStepFieldsMany:Gd,deleteAssetProcedureStepFields:Kd,deleteAssetProcedureStepFieldsMany:Yd}=Ds.actions,Us=t=>t.assetProcedureStepFieldsReducer.instances,zt=u.createSelector([Us],t=>Object.values(t)),jb=S(u.createSelector([zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),$b=S(u.createSelector([zt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Db=u.createSelector([Us],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Zd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Jd=S(u.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Xd=Ds.reducer,te=M(t=>t.uuid),Qd={instances:{}},Ls=u.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Qd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Qd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:xd,addAssetProcedureStepFieldValuesAttachment:el,addAssetProcedureStepFieldValuesAttachments:Ns,setAssetProcedureStepFieldValuesAttachment:tl,setAssetProcedureStepFieldValuesAttachments:sl,updateAssetProcedureStepFieldValuesAttachment:il,updateAssetProcedureStepFieldValuesAttachments:nl,deleteAssetProcedureStepFieldValuesAttachment:al,deleteAssetProcedureStepFieldValuesAttachments:Hs}=Ls.actions,cl=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Gs=u.createSelector([cl],t=>Object.values(t)),rl=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],dl=S(u.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ll=S(u.createSelector([Gs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),ol=Ls.reducer,se=M(t=>t.uuid),ul={instances:{}},Ks=u.createSlice({name:"assetProcedureStepFieldValues",initialState:ul,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,ul)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:hl,addAssetProcedureStepFieldValues:ml,addAssetProcedureStepFieldValuesMany:pl,setAssetProcedureStepFieldValues:yl,setAssetProcedureStepFieldValuesMany:fl,updateAssetProcedureStepFieldValues:Al,updateAssetProcedureStepFieldValuesMany:Sl,deleteAssetProcedureStepFieldValues:Tl,deleteAssetProcedureStepFieldValuesMany:wl}=Ks.actions,Ol=t=>t.assetProcedureStepFieldValuesReducer.instances,It=u.createSelector([Ol],t=>Object.values(t)),Ub=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),Lb=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),Nb=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),Il=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Fl=S(u.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Pl=Ks.reducer,ie=M(t=>t.uuid),gl={instances:{}},Ys=u.createSlice({name:"assetProcedureSteps",initialState:gl,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gl)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:bl,setAssetProcedureStep:_l,setAssetProcedureSteps:Ml,addAssetProcedureStep:Rl,addAssetProcedureSteps:kl,updateAssetProcedureStep:vl,updateAssetProcedureSteps:El,deleteAssetProcedureStep:Vl,deleteAssetProcedureSteps:Bl}=Ys.actions,zl=Ys.reducer,Wt=t=>t.assetProcedureStepReducer.instances,Wl=t=>s=>s.assetProcedureStepReducer.instances[t],Zs=u.createSelector([Wt],t=>Object.values(t)),Hb=S(u.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return kt(e)})),Gb=S(u.createSelector([Zs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),ql=S(u.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Cl=S(u.createSelector([Wt,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=mc(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),ne=M(t=>t.uuid),jl={instances:{}},Js=u.createSlice({name:"assets",initialState:jl,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,jl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:$l,addAsset:Dl,addAssets:Xs,updateAsset:Ul,updateAssets:Ll,deleteAsset:Nl,deleteAssets:Qs,setAsset:Hl,setAssets:Gl}=Js.actions,Kl=t=>t.assetReducer.instances,qt=u.createSelector([Kl],t=>T(Object.values(t))),Kb=S(u.createSelector([qt,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>e===s)))),Yl=S(u.createSelector([qt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Zl=t=>s=>s.assetReducer.instances[t],Jl=S(u.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Xl=Js.reducer,ae=M(t=>t.uuid),Ql={instances:{}},xs=u.createSlice({name:"assetStageCompletions",initialState:Ql,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Ql)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:xl,addAssetStageCompletion:eo,addAssetStageCompletions:to,setAssetStageCompletion:so,setAssetStageCompletions:io,updateAssetStageCompletion:no,updateAssetStageCompletions:ao,deleteAssetStageCompletion:co,deleteAssetStageCompletions:ro}=xs.actions,lo=xs.reducer,oo=t=>t.assetStageCompletionReducer.instances,uo=u.createSelector([oo],t=>Object.values(t)),ho=t=>s=>s.assetStageCompletionReducer.instances[t],mo=S(u.createSelector([uo,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ce=M(t=>t.uuid),po={instances:{}},ei=u.createSlice({name:"assetStages",initialState:po,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,po)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:yo,setAssetStage:fo,setAssetStages:Ao,addAssetStage:So,addAssetStages:To,updateAssetStage:wo,updateAssetStages:Oo,deleteAssetStage:Io,deleteAssetStages:Fo}=ei.actions,Po=ei.reducer,ti=t=>t.assetStageReducer.instances,go=t=>s=>s.assetStageReducer.instances[t],si=u.createSelector([ti],t=>Object.values(t)),Yb=S(u.createSelector([ti,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return kt(e)})),Zb=S(u.createSelector([si,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),bo=S(u.createSelector([si,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),re=M(t=>t.uuid),_o={instances:{}},ii=u.createSlice({name:"assetTypeAttachments",initialState:_o,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,_o)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:Mo,addAssetTypeAttachment:Ro,addAssetTypeAttachments:ni,setAssetTypeAttachment:ko,setAssetTypeAttachments:vo,updateAssetTypeAttachment:Eo,updateAssetTypeAttachments:Vo,deleteAssetTypeAttachment:Bo,deleteAssetTypeAttachments:ai}=ii.actions,zo=t=>t.assetTypeAttachmentReducer.instances,ci=u.createSelector([zo],t=>Object.values(t)),Wo=t=>s=>s.assetTypeAttachmentReducer.instances[t],qo=S(u.createSelector([ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Co=S(u.createSelector([ci,(t,s)=>s],(t,s)=>T(t.filter(({asset_type:e})=>s===e)))),jo=ii.reducer,de=M(t=>t.uuid),$o={instances:{}},ri=u.createSlice({name:"assetTypeFieldsAttachments",initialState:$o,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,$o)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:Do,addAssetTypeFieldsAttachment:Uo,addAssetTypeFieldsAttachments:Lo,setAssetTypeFieldsAttachment:No,setAssetTypeFieldsAttachments:Ho,updateAssetTypeFieldsAttachment:Go,updateAssetTypeFieldsAttachments:Ko,deleteAssetTypeFieldsAttachment:Yo,deleteAssetTypeFieldsAttachments:Zo}=ri.actions,Jo=t=>t.assetTypeFieldsAttachmentReducer.instances,di=u.createSelector([Jo],t=>Object.values(t)),Jb=S(u.createSelector([di,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),Xo=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Qo=S(u.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),xo=ri.reducer,le=M(t=>t.uuid),eu={instances:{}},li=u.createSlice({name:"assetTypeFields",initialState:eu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,eu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:tu,addAssetTypeFields:su,addAssetTypeFieldsMany:iu,setAssetTypeFields:nu,setAssetTypeFieldsMany:au,updateAssetTypeFields:cu,updateAssetTypeFieldsMany:ru,deleteAssetTypeFields:du,deleteAssetTypeFieldsMany:lu}=li.actions,ou=t=>t.assetTypeFieldsReducer.instances,Ft=u.createSelector([ou],t=>Object.values(t)),Xb=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Qb=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),uu=t=>s=>s.assetTypeFieldsReducer.instances[t],hu=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),mu=li.reducer,oe=M(t=>t.uuid),pu={instances:{}},oi=u.createSlice({name:"assetTypeFieldValuesAttachments",initialState:pu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,pu)),reducers:{initializeAssetTypeFieldValuesAttachments:oe.initialize,addAssetTypeFieldValuesAttachment:oe.addOne,addAssetTypeFieldValuesAttachments:oe.addMany,setAssetTypeFieldValuesAttachment:oe.setOne,setAssetTypeFieldValuesAttachments:oe.setMany,updateAssetTypeFieldValuesAttachment:oe.updateOne,updateAssetTypeFieldValuesAttachments:oe.updateMany,deleteAssetTypeFieldValuesAttachment:oe.deleteOne,deleteAssetTypeFieldValuesAttachments:oe.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:yu,addAssetTypeFieldValuesAttachment:fu,addAssetTypeFieldValuesAttachments:ui,setAssetTypeFieldValuesAttachment:Au,setAssetTypeFieldValuesAttachments:Su,updateAssetTypeFieldValuesAttachment:Tu,updateAssetTypeFieldValuesAttachments:wu,deleteAssetTypeFieldValuesAttachment:Ou,deleteAssetTypeFieldValuesAttachments:hi}=oi.actions,Iu=t=>t.assetTypeFieldValuesAttachmentReducer.instances,mi=u.createSelector([Iu],t=>Object.values(t)),Fu=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Pu=S(u.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),gu=S(u.createSelector([mi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),bu=oi.reducer,ue=M(t=>t.uuid),_u={instances:{}},pi=u.createSlice({name:"assetTypeFieldValues",initialState:_u,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,_u)),reducers:{initializeAssetTypeFieldValues:ue.initialize,addAssetTypeFieldValues:ue.addOne,addAssetTypeFieldValuesMany:ue.addMany,setAssetTypeFieldValues:ue.setOne,setAssetTypeFieldValuesMany:ue.setMany,updateAssetTypeFieldValues:ue.updateOne,updateAssetTypeFieldValuesMany:ue.updateMany,deleteAssetTypeFieldValues:ue.deleteOne,deleteAssetTypeFieldValuesMany:ue.deleteMany}}),{initializeAssetTypeFieldValues:Mu,addAssetTypeFieldValues:Ru,addAssetTypeFieldValuesMany:ku,setAssetTypeFieldValues:vu,setAssetTypeFieldValuesMany:Eu,updateAssetTypeFieldValues:Vu,updateAssetTypeFieldValuesMany:Bu,deleteAssetTypeFieldValues:zu,deleteAssetTypeFieldValuesMany:Wu}=pi.actions,qu=t=>t.assetTypeFieldValuesReducer.instances,Ct=u.createSelector([qu],t=>Object.values(t)),xb=S(u.createSelector([Ct,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),e_=S(u.createSelector([Ft,Ct,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),Cu=t=>s=>s.assetTypeFieldValuesReducer.instances[t],ju=S(u.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$u=pi.reducer,he=M(t=>t.uuid),Du={instances:{}},yi=u.createSlice({name:"assetTypeIdentifiers",initialState:Du,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Du)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Uu,addAssetTypeIdentifier:Lu,addAssetTypeIdentifiers:Nu,setAssetTypeIdentifier:Hu,setAssetTypeIdentifiers:Gu,updateAssetTypeIdentifier:Ku,updateAssetTypeIdentifiers:Yu,deleteAssetTypeIdentifier:Zu,deleteAssetTypeIdentifiers:Ju}=yi.actions,Xu=t=>t.assetTypeIdentifierReducer.instances,fi=u.createSelector([Xu],t=>Object.values(t)),Qu=t=>s=>s.assetTypeIdentifierReducer.instances[t],xu=S(u.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),t_=S(u.createSelector([fi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),eh=yi.reducer,me=M(t=>t.uuid),th={instances:{}},Ai=u.createSlice({name:"assetTypeIdentifierValues",initialState:th,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,th)),reducers:{initializeAssetTypeIdentifierValues:me.initialize,addAssetTypeIdentifierValue:me.addOne,addAssetTypeIdentifierValues:me.addMany,setAssetTypeIdentifierValue:me.setOne,setAssetTypeIdentifierValues:me.setMany,updateAssetTypeIdentifierValue:me.updateOne,updateAssetTypeIdentifierValues:me.updateMany,deleteAssetTypeIdentifierValue:me.deleteOne,deleteAssetTypeIdentifierValues:me.deleteMany}}),{initializeAssetTypeIdentifierValues:sh,addAssetTypeIdentifierValue:ih,addAssetTypeIdentifierValues:nh,setAssetTypeIdentifierValue:ah,setAssetTypeIdentifierValues:ch,updateAssetTypeIdentifierValue:rh,updateAssetTypeIdentifierValues:dh,deleteAssetTypeIdentifierValue:lh,deleteAssetTypeIdentifierValues:oh}=Ai.actions,uh=t=>t.assetTypeIdentifierValueReducer.instances,jt=u.createSelector([uh],t=>Object.values(t)),hh=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],mh=S(u.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),s_=S(u.createSelector([jt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),i_=S(u.createSelector([jt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type_identifier===s)))),ph=Ai.reducer,pe=M(t=>t.uuid),yh={instances:{}},Si=u.createSlice({name:"assetTypes",initialState:yh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,yh)),reducers:{initializeAssetTypes:pe.initialize,setAssetType:pe.setOne,setAssetTypes:pe.setMany,addAssetType:pe.addOne,addAssetTypes:pe.addMany,updateAssetType:pe.updateOne,updateAssetTypes:pe.updateMany,deleteAssetType:pe.deleteOne,deleteAssetTypes:pe.deleteMany}}),{initializeAssetTypes:fh,setAssetType:Ah,setAssetTypes:Sh,addAssetType:Th,addAssetTypes:wh,updateAssetType:Oh,updateAssetTypes:Ih,deleteAssetType:Fh,deleteAssetTypes:Ph}=Si.actions,gh=t=>t.assetTypeReducer.instances,Ti=u.createSelector([gh],t=>Object.values(t)),bh=t=>s=>s.assetTypeReducer.instances[t],_h=S(u.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),n_=S(u.createSelector([Ti,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Mh=Si.reducer,ye=M(t=>t.uuid),Rh={instances:{}},wi=u.createSlice({name:"assetTypeStatuses",initialState:Rh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Rh)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:kh,addAssetTypeStatus:vh,addAssetTypeStatuses:Eh,setAssetTypeStatus:Vh,setAssetTypeStatuses:Bh,updateAssetTypeStatus:zh,updateAssetTypeStatuses:Wh,deleteAssetTypeStatus:qh,deleteAssetTypeStatuses:Ch}=wi.actions,jh=t=>t.assetTypeStatusReducer.instances,Oi=u.createSelector([jh],t=>T(Object.values(t).toSorted(pc))),$h=t=>s=>s.assetTypeStatusReducer.instances[t],Dh=S(u.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),a_=S(u.createSelector([Oi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Uh=wi.reducer,Lh={accessToken:"",refreshToken:"",isLoggedIn:!1},$t=u.createSlice({name:"auth",initialState:Lh,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Lh)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||$t.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:c_,clearTokens:r_,setLoggedIn:Nh}=$t.actions,d_=t=>t.authReducer.accessToken,l_=t=>t.authReducer.isLoggedIn,Hh=$t.reducer,fe=M(t=>t.uuid),Gh={instances:{}},Ii=u.createSlice({name:"categories",initialState:Gh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Gh)),reducers:{initializeCategories:fe.initialize,addCategory:fe.addOne,addCategories:fe.addMany,setCategory:fe.setOne,setCategories:fe.setMany,updateCategory:fe.updateOne,updateCategories:fe.updateMany,deleteCategory:fe.deleteOne,deleteCategories:fe.deleteMany}}),{initializeCategories:Kh,addCategory:Yh,addCategories:Zh,setCategory:Jh,setCategories:Xh,updateCategory:Qh,updateCategories:xh,deleteCategory:em,deleteCategories:tm}=Ii.actions,sm=t=>t.categoryReducer.instances,Fi=u.createSelector([sm],t=>Object.values(t)),Pi=t=>s=>s.categoryReducer.instances[t],im=S(u.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),o_=S(u.createSelector([Fi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),nm=Ii.reducer,Ae=M(t=>t.uuid),am={instances:{}},gi=u.createSlice({name:"documentAttachments",initialState:am,extraReducers:t=>t.addCase(b,s=>Object.assign(s,am)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:cm,addDocumentAttachment:rm,addDocumentAttachments:dm,setDocumentAttachment:lm,setDocumentAttachments:om,updateDocumentAttachment:um,updateDocumentAttachments:hm,deleteDocumentAttachment:mm,deleteDocumentAttachments:pm}=gi.actions,ym=t=>t.documentAttachmentReducer.instances,bi=u.createSelector([ym],t=>Object.values(t)),fm=t=>s=>s.documentAttachmentReducer.instances[t],Am=S(u.createSelector([bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),u_=S(u.createSelector([bi,(t,s)=>s],(t,s)=>T(t.filter(({document:e})=>s===e)))),Sm=gi.reducer,Se=M(({uuid:t})=>t),Tm={instances:{}},_i=u.createSlice({name:"documents",initialState:Tm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>{Object.assign(s,Tm)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:wm,addDocument:Om,addDocuments:Im,setDocument:Fm,setDocuments:Pm,updateDocument:gm,updateDocuments:bm,deleteDocument:_m,deleteDocuments:Mm}=_i.actions,Rm=_i.reducer,Mi=t=>t.documentsReducer.instances,Dt=u.createSelector([Mi],t=>Object.values(t)),km=t=>s=>s.documentsReducer.instances[t],vm=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),h_=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),m_=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Em=S(u.createSelector([Mi,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=Ac(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),Te=M(t=>t.uuid),Vm={instances:{}},Ri=u.createSlice({name:"emailDomains",initialState:Vm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Vm)),reducers:{initializeEmailDomains:Te.initialize,addEmailDomain:Te.addOne,addEmailDomains:Te.addMany,setEmailDomain:Te.setOne,setEmailDomains:Te.setMany,updateEmailDomain:Te.updateOne,updateEmailDomains:Te.updateMany,deleteEmailDomain:Te.deleteOne,deleteEmailDomains:Te.deleteMany}}),{initializeEmailDomains:Bm,addEmailDomain:zm,addEmailDomains:Wm,setEmailDomain:qm,setEmailDomains:Cm,updateEmailDomain:jm,updateEmailDomains:$m,deleteEmailDomain:Dm,deleteEmailDomains:Um}=Ri.actions,Lm=t=>t.emailDomainsReducer.instances,ki=u.createSelector([Lm],t=>Object.values(t)),Nm=t=>s=>s.emailDomainsReducer.instances[t],Hm=S(u.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),p_=S(u.createSelector([ki,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Gm=Ri.reducer,Km={s3Urls:{}},Ym=1e3*60*60,y_=Ym*24*7,vi=u.createSlice({name:"file",initialState:Km,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Km)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,d=new Date(c.getTime()+y_);t.s3Urls[a]={url:e,fields:n,exp:d.getTime()}}}}),{setUploadUrl:Zm}=vi.actions,Jm=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Ym))return e},Xm=vi.reducer,we=M(t=>t.uuid),Qm={instances:{}},Ei=u.createSlice({name:"formIdentifiers",initialState:Qm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Qm)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:xm,addFormIdentifier:ep,addFormIdentifiers:tp,setFormIdentifier:sp,setFormIdentifiers:ip,updateFormIdentifier:np,updateFormIdentifiers:ap,deleteFormIdentifier:cp,deleteFormIdentifiers:rp}=Ei.actions,dp=t=>t.formIdentifierReducer.instances,Vi=u.createSelector([dp],t=>Object.values(t)),lp=t=>s=>s.formIdentifierReducer.instances[t],op=S(u.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),f_=S(u.createSelector([Vi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),up=Ei.reducer,Oe=M(t=>t.uuid),hp={instances:{}},Bi=u.createSlice({name:"formIdentifierValues",initialState:hp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,hp)),reducers:{initializeFormIdentifierValues:Oe.initialize,addFormIdentifierValue:Oe.addOne,addFormIdentifierValues:Oe.addMany,setFormIdentifierValue:Oe.setOne,setFormIdentifierValues:Oe.setMany,updateFormIdentifierValue:Oe.updateOne,updateFormIdentifierValues:Oe.updateMany,deleteFormIdentifierValue:Oe.deleteOne,deleteFormIdentifierValues:Oe.deleteMany}}),{initializeFormIdentifierValues:mp,addFormIdentifierValue:pp,addFormIdentifierValues:yp,setFormIdentifierValue:fp,setFormIdentifierValues:Ap,updateFormIdentifierValue:Sp,updateFormIdentifierValues:Tp,deleteFormIdentifierValue:wp,deleteFormIdentifierValues:Op}=Bi.actions,Ip=t=>t.formIdentifierValueReducer.instances,Ut=u.createSelector([Ip],t=>Object.values(t)),Fp=t=>s=>s.formIdentifierValueReducer.instances[t],Pp=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),A_=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),S_=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_identifier===s)))),gp=Bi.reducer,Ie=M(t=>t.uuid),bp={instances:{}},zi=u.createSlice({name:"formRevisionAttachments",initialState:bp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,bp)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:_p,addFormRevisionAttachment:Mp,addFormRevisionAttachments:Rp,setFormRevisionAttachment:kp,setFormRevisionAttachments:vp,updateFormRevisionAttachment:Ep,updateFormRevisionAttachments:Vp,deleteFormRevisionAttachment:Bp,deleteFormRevisionAttachments:zp}=zi.actions,Lt=t=>t.formRevisionAttachmentReducer.instances,Wp=u.createSelector([Lt],t=>Object.values(t)),qp=S(u.createSelector([Lt,(t,s)=>s],(t,s)=>t[s])),Cp=S(u.createSelector([Wp,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),T_=S(u.createSelector([Lt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.form_revision===s)))),jp=zi.reducer,Fe=M(t=>t.uuid),$p={instances:{}},Wi=u.createSlice({name:"formRevisions",initialState:$p,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,$p)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:Dp,addFormRevision:qi,addFormRevisions:Ci,setFormRevision:Up,setFormRevisions:Lp,updateFormRevision:Np,updateFormRevisions:Hp,deleteFormRevision:ji,deleteFormRevisions:$i}=Wi.actions,Di=t=>t.formRevisionReducer.instances,Nt=u.createSelector([Di],t=>Object.values(t)),Gp=t=>s=>s.formRevisionReducer.instances[t],Kp=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),w_=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Yp=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),Zp=Wi.reducer,Pe=M(t=>t.uuid),Jp={instances:{}},Ui=u.createSlice({name:"forms",initialState:Jp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Jp)),reducers:{initializeForms:Pe.initialize,addForm:Pe.addOne,addForms:Pe.addMany,setForm:Pe.setOne,setForms:Pe.setMany,updateForm:Pe.updateOne,updateForms:Pe.updateMany,deleteForm:Pe.deleteOne,deleteForms:Pe.deleteMany}}),{initializeForms:Xp,addForm:Qp,addForms:xp,setForm:ey,setForms:ty,updateForm:sy,updateForms:iy,deleteForm:ny,deleteForms:ay}=Ui.actions,cy=Ui.reducer,ry=t=>t.formReducer.instances,Li=u.createSelector([ry],t=>Object.values(t)),dy=t=>s=>s.formReducer.instances[t],ly=S(u.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),O_=S(u.createSelector([Li,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),ge=M(t=>t.uuid),oy={instances:{}},Ni=u.createSlice({name:"formSubmissionAttachments",initialState:oy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,oy)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:uy,addFormSubmissionAttachment:hy,addFormSubmissionAttachments:Hi,setFormSubmissionAttachment:my,setFormSubmissionAttachments:py,updateFormSubmissionAttachment:yy,updateFormSubmissionAttachments:fy,deleteFormSubmissionAttachment:Ay,deleteFormSubmissionAttachments:Gi}=Ni.actions,Ki=t=>t.formSubmissionAttachmentReducer.instances,Yi=u.createSelector([Ki],t=>Object.values(t)),Sy=S(u.createSelector([Ki,(t,s)=>s],(t,s)=>t[s])),Zi=S(u.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(n=>e.has(n.uuid)))})),Ty=Zi,wy=S(u.createSelector([Yi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),Oy=Ni.reducer,be=M(t=>t.uuid),Iy={instances:{}},Ji=u.createSlice({name:"formSubmissions",initialState:Iy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Iy)),reducers:{initializeFormSubmissions:be.initialize,setFormSubmission:be.setOne,setFormSubmissions:be.setMany,addFormSubmission:be.addOne,addFormSubmissions:be.addMany,updateFormSubmission:be.updateOne,updateFormSubmissions:be.updateMany,deleteFormSubmission:be.deleteOne,deleteFormSubmissions:be.deleteMany}}),{initializeFormSubmissions:Fy,setFormSubmission:Py,setFormSubmissions:gy,addFormSubmission:by,addFormSubmissions:Xi,updateFormSubmission:_y,updateFormSubmissions:My,deleteFormSubmission:Ry,deleteFormSubmissions:Qi}=Ji.actions,xi=t=>t.formSubmissionReducer.instances,ky=u.createSelector([xi],t=>Object.values(t)),vy=t=>s=>s.formSubmissionReducer.instances[t],Ey=S(u.createSelector([ky,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Vy=S(u.createSelector([xi,Di,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),By=Ji.reducer,_e=M(t=>t.uuid),zy={instances:{}},en=u.createSlice({name:"geoImages",initialState:zy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,zy)),reducers:{initializeGeoImages:_e.initialize,setGeoImage:_e.setOne,setGeoImages:_e.setMany,addGeoImage:_e.addOne,addGeoImages:_e.addMany,updateGeoImage:_e.updateOne,updateGeoImages:_e.updateMany,deleteGeoImage:_e.deleteOne,deleteGeoImages:_e.deleteMany}}),{initializeGeoImages:Wy,setGeoImage:qy,setGeoImages:Cy,addGeoImage:jy,addGeoImages:$y,updateGeoImage:Dy,updateGeoImages:Uy,deleteGeoImage:Ly,deleteGeoImages:Ny}=en.actions,Hy=t=>t.geoImageReducer.instances,tn=u.createSelector([Hy],t=>Object.values(t)),Gy=t=>s=>s.geoImageReducer.instances[t],Ky=S(u.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),I_=S(u.createSelector([tn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),Yy=en.reducer,Me=M(t=>t.uuid),Zy={instances:{}},sn=u.createSlice({name:"issueAssociations",initialState:Zy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Zy)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:Jy,setIssueAssociations:Xy,setIssueAssociation:Qy,updateIssueAssociation:xy,updateIssueAssociations:ef,addIssueAssociation:tf,addIssueAssociations:Ht,deleteIssueAssociation:sf,deleteIssueAssociations:Gt}=sn.actions,Pt=t=>t.issueAssociationReducer.instances,nf=u.createSelector([Pt],t=>Object.values(t)),af=t=>s=>s.issueAssociationReducer.instances[t],cf=S(u.createSelector([nf,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),rf=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.associated_issue===s)))),df=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),lf=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.asset===s)))),of=sn.reducer,Re=M(t=>t.uuid),uf={instances:{}},nn=u.createSlice({name:"issueAttachments",initialState:uf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,uf)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:hf,addIssueAttachment:mf,addIssueAttachments:an,setIssueAttachment:pf,setIssueAttachments:yf,updateIssueAttachment:ff,updateIssueAttachments:Af,deleteIssueAttachment:Sf,deleteIssueAttachments:cn}=nn.actions,Tf=t=>t.issueAttachmentReducer.instances,rn=u.createSelector([Tf],t=>Object.values(t)),wf=S(u.createSelector([rn,(t,s)=>s],(t,s)=>T(t.filter(({issue:e})=>s===e)))),Of=t=>s=>s.issueAttachmentReducer.instances[t],If=S(u.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ff=nn.reducer,ke=M(t=>t.uuid),Pf={instances:{}},dn=u.createSlice({name:"issueCommentAttachments",initialState:Pf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Pf)),reducers:{initializeIssueCommentAttachments:ke.initialize,addIssueCommentAttachment:ke.addOne,addIssueCommentAttachments:ke.addMany,setIssueCommentAttachment:ke.setOne,setIssueCommentAttachments:ke.setMany,updateIssueCommentAttachment:ke.updateOne,updateIssueCommentAttachments:ke.updateMany,deleteIssueCommentAttachment:ke.deleteOne,deleteIssueCommentAttachments:ke.deleteMany}}),{initializeIssueCommentAttachments:gf,addIssueCommentAttachment:bf,addIssueCommentAttachments:_f,setIssueCommentAttachment:Mf,setIssueCommentAttachments:Rf,updateIssueCommentAttachment:kf,updateIssueCommentAttachments:vf,deleteIssueCommentAttachment:Ef,deleteIssueCommentAttachments:Vf}=dn.actions,Bf=t=>t.issueCommentAttachmentReducer.instances,ln=u.createSelector([Bf],t=>Object.values(t)),zf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Wf=S(u.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),F_=S(u.createSelector([ln,(t,s)=>s],(t,s)=>T(t.filter(({issue_comment:e})=>s===e)))),qf=dn.reducer,ve=M(t=>t.uuid),Cf={instances:{}},on=u.createSlice({name:"issueComments",initialState:Cf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Cf)),reducers:{initializeIssueComments:ve.initialize,addIssueComment:ve.addOne,addIssueComments:ve.addMany,setIssueComment:ve.setOne,setIssueComments:ve.setMany,updateIssueComment:ve.updateOne,updateIssueComments:ve.updateMany,deleteIssueComment:ve.deleteOne,deleteIssueComments:ve.deleteMany}}),{initializeIssueComments:jf,addIssueComment:$f,addIssueComments:Df,setIssueComment:Uf,setIssueComments:Lf,updateIssueComment:Nf,updateIssueComments:Hf,deleteIssueComment:Gf,deleteIssueComments:Kf}=on.actions,un=t=>t.issueCommentReducer.instances,Yf=t=>s=>s.issueCommentReducer.instances[t],Zf=S(u.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),P_=S(u.createSelector([un,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),Jf=on.reducer,Ee=M(t=>t.uuid),Xf={instances:{}},hn=u.createSlice({name:"issues",initialState:Xf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Xf)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Qf,addIssue:xf,addIssues:mn,setIssue:eA,setIssues:tA,updateIssue:sA,updateIssues:iA,deleteIssue:nA,deleteIssues:pn}=hn.actions,aA=t=>t.issueReducer.instances,Kt=u.createSelector([aA],t=>Object.values(t)),cA=t=>s=>s.issueReducer.instances[t],rA=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),g_=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),dA=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),lA=hn.reducer,Ve=M(t=>t.uuid),oA={instances:{}},yn=u.createSlice({name:"issueTypeAttachments",initialState:oA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,oA)),reducers:{initializeIssueTypeAttachments:Ve.initialize,addIssueTypeAttachment:Ve.addOne,addIssueTypeAttachments:Ve.addMany,setIssueTypeAttachment:Ve.setOne,setIssueTypeAttachments:Ve.setMany,updateIssueTypeAttachment:Ve.updateOne,updateIssueTypeAttachments:Ve.updateMany,deleteIssueTypeAttachment:Ve.deleteOne,deleteIssueTypeAttachments:Ve.deleteMany}}),{initializeIssueTypeAttachments:uA,addIssueTypeAttachment:hA,addIssueTypeAttachments:mA,setIssueTypeAttachment:pA,setIssueTypeAttachments:yA,updateIssueTypeAttachment:fA,updateIssueTypeAttachments:AA,deleteIssueTypeAttachment:SA,deleteIssueTypeAttachments:TA}=yn.actions,wA=t=>t.issueTypeAttachmentReducer.instances,fn=u.createSelector([wA],t=>Object.values(t)),OA=t=>s=>s.issueTypeAttachmentReducer.instances[t],IA=S(u.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),b_=S(u.createSelector([fn,(t,s)=>s],(t,s)=>T(t.filter(({issue_type:e})=>s===e)))),FA=yn.reducer,Be=M(t=>t.uuid),PA={instances:{}},An=u.createSlice({name:"issueTypeFieldsAttachments",initialState:PA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,PA)),reducers:{initializeIssueTypeFieldsAttachments:Be.initialize,addIssueTypeFieldsAttachment:Be.addOne,addIssueTypeFieldsAttachments:Be.addMany,setIssueTypeFieldsAttachment:Be.setOne,setIssueTypeFieldsAttachments:Be.setMany,updateIssueTypeFieldsAttachment:Be.updateOne,updateIssueTypeFieldsAttachments:Be.updateMany,deleteIssueTypeFieldsAttachment:Be.deleteOne,deleteIssueTypeFieldsAttachments:Be.deleteMany}}),{initializeIssueTypeFieldsAttachments:gA,addIssueTypeFieldsAttachment:bA,addIssueTypeFieldsAttachments:_A,setIssueTypeFieldsAttachment:MA,setIssueTypeFieldsAttachments:RA,updateIssueTypeFieldsAttachment:kA,updateIssueTypeFieldsAttachments:vA,deleteIssueTypeFieldsAttachment:EA,deleteIssueTypeFieldsAttachments:VA}=An.actions,BA=t=>t.issueTypeFieldsAttachmentReducer.instances,Sn=u.createSelector([BA],t=>Object.values(t)),__=S(u.createSelector([Sn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),zA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],WA=S(u.createSelector([Sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qA=An.reducer,ze=M(t=>t.uuid),CA={instances:{}},Tn=u.createSlice({name:"issueTypeFieldValues",initialState:CA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,CA)),reducers:{initializeIssueTypeFieldValues:ze.initialize,addIssueTypeFieldValues:ze.addOne,addIssueTypeFieldValuesMany:ze.addMany,setIssueTypeFieldValues:ze.setOne,setIssueTypeFieldValuesMany:ze.setMany,updateIssueTypeFieldValues:ze.updateOne,updateIssueTypeFieldValuesMany:ze.updateMany,deleteIssueTypeFieldValues:ze.deleteOne,deleteIssueTypeFieldValuesMany:ze.deleteMany}}),{initializeIssueTypeFieldValues:jA,addIssueTypeFieldValues:$A,addIssueTypeFieldValuesMany:DA,setIssueTypeFieldValues:UA,setIssueTypeFieldValuesMany:LA,updateIssueTypeFieldValues:NA,updateIssueTypeFieldValuesMany:HA,deleteIssueTypeFieldValues:GA,deleteIssueTypeFieldValuesMany:KA}=Tn.actions,YA=t=>t.issueTypeFieldValuesReducer.instances,Yt=u.createSelector([YA],t=>Object.values(t)),M_=S(u.createSelector([Yt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),ZA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],JA=S(u.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),XA=Tn.reducer,We=M(t=>t.uuid),QA={instances:{}},wn=u.createSlice({name:"issueTypeFields",initialState:QA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,QA)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:xA,addIssueTypeFields:eS,addIssueTypeFieldsMany:tS,setIssueTypeFields:sS,setIssueTypeFieldsMany:iS,updateIssueTypeFields:nS,updateIssueTypeFieldsMany:aS,deleteIssueTypeFields:cS,deleteIssueTypeFieldsMany:rS}=wn.actions,dS=t=>t.issueTypeFieldsReducer.instances,gt=u.createSelector([dS],t=>Object.values(t)),R_=S(u.createSelector([gt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),k_=S(u.createSelector([gt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),v_=S(u.createSelector([gt,Yt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),lS=t=>s=>s.issueTypeFieldsReducer.instances[t],oS=S(u.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),uS=wn.reducer,qe=M(t=>t.uuid),hS={instances:{}},On=u.createSlice({name:"issueTypeFieldValuesAttachments",initialState:hS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,hS)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:mS,addIssueTypeFieldValuesAttachment:pS,addIssueTypeFieldValuesAttachments:In,setIssueTypeFieldValuesAttachment:yS,setIssueTypeFieldValuesAttachments:fS,updateIssueTypeFieldValuesAttachment:AS,updateIssueTypeFieldValuesAttachments:SS,deleteIssueTypeFieldValuesAttachment:TS,deleteIssueTypeFieldValuesAttachments:Fn}=On.actions,wS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Pn=u.createSelector([wS],t=>Object.values(t)),OS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],IS=S(u.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),FS=S(u.createSelector([Pn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),PS=On.reducer,Ce=M(t=>t.uuid),gS={instances:{}},gn=u.createSlice({name:"issueTypeIdentifiers",initialState:gS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gS)),reducers:{initializeIssueTypeIdentifiers:Ce.initialize,addIssueTypeIdentifier:Ce.addOne,addIssueTypeIdentifiers:Ce.addMany,setIssueTypeIdentifier:Ce.setOne,setIssueTypeIdentifiers:Ce.setMany,updateIssueTypeIdentifier:Ce.updateOne,updateIssueTypeIdentifiers:Ce.updateMany,deleteIssueTypeIdentifier:Ce.deleteOne,deleteIssueTypeIdentifiers:Ce.deleteMany}}),{initializeIssueTypeIdentifiers:bS,addIssueTypeIdentifier:_S,addIssueTypeIdentifiers:MS,setIssueTypeIdentifier:RS,setIssueTypeIdentifiers:kS,updateIssueTypeIdentifier:vS,updateIssueTypeIdentifiers:ES,deleteIssueTypeIdentifier:VS,deleteIssueTypeIdentifiers:BS}=gn.actions,zS=t=>t.issueTypeIdentifierReducer.instances,bn=u.createSelector([zS],t=>Object.values(t)),WS=t=>s=>s.issueTypeIdentifierReducer.instances[t],qS=S(u.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),E_=S(u.createSelector([bn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),CS=gn.reducer,je=M(t=>t.uuid),jS={instances:{}},_n=u.createSlice({name:"issueTypeIdentifierValues",initialState:jS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,jS)),reducers:{initializeIssueTypeIdentifierValues:je.initialize,addIssueTypeIdentifierValue:je.addOne,addIssueTypeIdentifierValues:je.addMany,setIssueTypeIdentifierValue:je.setOne,setIssueTypeIdentifierValues:je.setMany,updateIssueTypeIdentifierValue:je.updateOne,updateIssueTypeIdentifierValues:je.updateMany,deleteIssueTypeIdentifierValue:je.deleteOne,deleteIssueTypeIdentifierValues:je.deleteMany}}),{initializeIssueTypeIdentifierValues:$S,addIssueTypeIdentifierValue:DS,addIssueTypeIdentifierValues:US,setIssueTypeIdentifierValue:LS,setIssueTypeIdentifierValues:NS,updateIssueTypeIdentifierValue:HS,updateIssueTypeIdentifierValues:GS,deleteIssueTypeIdentifierValue:KS,deleteIssueTypeIdentifierValues:YS}=_n.actions,ZS=t=>t.issueTypeIdentifierValueReducer.instances,Zt=u.createSelector([ZS],t=>Object.values(t)),JS=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],XS=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),V_=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),B_=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type_identifier===s)))),QS=_n.reducer,$e=M(t=>t.uuid),xS={instances:{}},Mn=u.createSlice({name:"issueTypes",initialState:xS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,xS)),reducers:{initializeIssueTypes:$e.initialize,addIssueType:$e.addOne,addIssueTypes:$e.addMany,setIssueType:$e.setOne,setIssueTypes:$e.setMany,updateIssueType:$e.updateOne,updateIssueTypes:$e.updateMany,deleteIssueType:$e.deleteOne,deleteIssueTypes:$e.deleteMany}}),{initializeIssueTypes:eT,addIssueType:tT,addIssueTypes:sT,setIssueType:iT,setIssueTypes:nT,updateIssueType:aT,updateIssueTypes:cT,deleteIssueType:rT,deleteIssueTypes:dT}=Mn.actions,lT=t=>t.issueTypeReducer.instances,Rn=u.createSelector(lT,t=>Object.values(t)),oT=t=>s=>s.issueTypeReducer.instances[t],uT=S(u.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),z_=S(u.createSelector([Rn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),hT=Mn.reducer,De=M(t=>t.uuid),mT={instances:{}},kn=u.createSlice({name:"issueTypeStatuses",initialState:mT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,mT)),reducers:{initializeIssueTypeStatuses:De.initialize,addIssueTypeStatus:De.addOne,addIssueTypeStatuses:De.addMany,setIssueTypeStatus:De.setOne,setIssueTypeStatuses:De.setMany,updateIssueTypeStatus:De.updateOne,updateIssueTypeStatuses:De.updateMany,deleteIssueTypeStatus:De.deleteOne,deleteIssueTypeStatuses:De.deleteMany}}),{initializeIssueTypeStatuses:pT,addIssueTypeStatus:yT,addIssueTypeStatuses:fT,setIssueTypeStatus:AT,setIssueTypeStatuses:ST,updateIssueTypeStatus:TT,updateIssueTypeStatuses:wT,deleteIssueTypeStatus:OT,deleteIssueTypeStatuses:IT}=kn.actions,FT=t=>t.issueTypeStatusReducer.instances,vn=u.createSelector([FT],t=>T(Object.values(t).toSorted(yc))),En=t=>s=>s.issueTypeStatusReducer.instances[t],PT=S(u.createSelector([vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),W_=S(u.createSelector([vn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),gT=kn.reducer,Ue=M(t=>t.uuid),bT={instances:{}},Vn=u.createSlice({name:"issueUpdates",initialState:bT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,bT)),reducers:{initializeIssueUpdates:Ue.initialize,addIssueUpdate:Ue.addOne,addIssueUpdates:Ue.addMany,setIssueUpdate:Ue.setOne,setIssueUpdates:Ue.setMany,updateIssueUpdate:Ue.updateOne,updateIssueUpdates:Ue.updateMany,deleteIssueUpdate:Ue.deleteOne,deleteIssueUpdates:Ue.deleteMany}}),{initializeIssueUpdates:_T,addIssueUpdate:Bn,addIssueUpdates:zn,setIssueUpdate:MT,setIssueUpdates:RT,updateIssueUpdate:kT,updateIssueUpdates:vT,deleteIssueUpdate:Wn,deleteIssueUpdates:qn}=Vn.actions,Cn=t=>t.issueUpdateReducer.instances,jn=u.createSelector([Cn],t=>Object.values(t)),ET=S(u.createSelector([Cn,(t,s)=>s],(t,s)=>t[s])),VT=S(u.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),BT=S(u.createSelector([jn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),zT=Vn.reducer,Le=M(t=>t.id),WT={instances:{},currentUser:null},$n=u.createSlice({name:"users",initialState:WT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,WT)),reducers:{initializeUsers:Le.initialize,setUsers:Le.setMany,setUser:Le.setOne,addUsers:Le.addMany,addUser:Le.addOne,updateUsers:Le.updateMany,updateUser:Le.updateOne,deleteUser:Le.deleteOne,deleteUsers:Le.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setProfilePicture:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile.file=s.payload.file??null,t.currentUser.profile.file_sha1=s.payload.file_sha1??null;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile.file=s.payload.file??null,e.profile.file_sha1=s.payload.file_sha1??null}}}),{initializeUsers:qT,setUsers:CT,setUser:jT,addUsers:$T,addUser:Dn,updateUsers:DT,updateUser:UT,deleteUser:Un,deleteUsers:LT,setCurrentUser:q_,setProfilePicture:C_}=$n.actions,NT=$n.reducer,HT=t=>t.userReducer.currentUser,Ln=t=>t.userReducer.instances,Jt=u.createSelector([Ln],t=>Object.values(t)),Xt=t=>s=>s.userReducer.instances[t],GT=S(u.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({id:n})=>e.has(n)))})),Ne=M(t=>t.uuid),KT={instances:{}},Nn=u.createSlice({name:"organizationAccess",initialState:KT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,KT)),reducers:{initializeOrganizationAccesses:Ne.initialize,addOrganizationAccess:Ne.addOne,addOrganizationAccesses:Ne.addMany,setOrganizationAccess:Ne.setOne,setOrganizationAccesses:Ne.setMany,updateOrganizationAccess:Ne.updateOne,updateOrganizationAccesses:Ne.updateMany,deleteOrganizationAccess:Ne.deleteOne,deleteOrganizationAccesses:Ne.deleteMany}}),{initializeOrganizationAccesses:YT,addOrganizationAccess:ZT,addOrganizationAccesses:JT,setOrganizationAccess:XT,setOrganizationAccesses:QT,updateOrganizationAccess:xT,updateOrganizationAccesses:ew,deleteOrganizationAccess:tw,deleteOrganizationAccesses:sw}=Nn.actions,iw=Nn.reducer,Qt=t=>t.organizationAccessReducer.instances,nw=t=>s=>s.organizationAccessReducer.instances[t],aw=S(u.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),j_=u.createSelector([HT,Qt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),cw=u.createSelector([Qt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return kt(s)}),$_=S(u.createSelector([Ln,cw,(t,s)=>s],(t,s,e)=>T(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),He=M(t=>t.uuid),rw={instances:{}},Hn=u.createSlice({name:"organizations",initialState:rw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,rw)),reducers:{initializeOrganizations:He.initialize,setOrganizations:He.setMany,setOrganization:He.setOne,addOrganizations:He.addMany,addOrganization:He.addOne,updateOrganizations:He.updateMany,updateOrganization:He.updateOne,deleteOrganization:He.deleteOne,deleteOrganizations:He.deleteMany}}),{initializeOrganizations:dw,setOrganizations:lw,setOrganization:ow,addOrganizations:uw,addOrganization:hw,updateOrganizations:mw,updateOrganization:pw,deleteOrganization:yw,deleteOrganizations:fw}=Hn.actions,Aw=t=>t.organizationReducer.instances,Sw=u.createSelector([Aw],t=>Object.values(t)),Tw=t=>s=>s.organizationReducer.instances[t],ww=S(u.createSelector([Sw,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ow=Hn.reducer,Iw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ht.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Fw={deletedRequests:[],latestRetryTime:0},Gn=u.createSlice({name:"outbox",initialState:Fw,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Fw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Iw(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),D_=t=>t.outboxReducer.deletedRequests,U_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Pw,markForDeletion:L_,markAsDeleted:gw,_setLatestRetryTime:bw}=Gn.actions,_w=Gn.reducer,Ge=M(t=>t.uuid),Mw={instances:{}},Kn=u.createSlice({name:"projectAccess",initialState:Mw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Mw)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:Rw,addProjectAccess:kw,addProjectAccesses:vw,setProjectAccess:Ew,setProjectAccesses:Vw,updateProjectAccess:Bw,updateProjectAccesses:zw,deleteProjectAccess:Ww,deleteProjectAccesses:qw}=Kn.actions,Cw=Kn.reducer,Yn=t=>t.projectAccessReducer.instances,bt=u.createSelector(Yn,t=>Object.values(t)),jw=t=>s=>s.projectAccessReducer.instances[t],$w=S(u.createSelector([bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),N_=S(u.createSelector([Yn,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.project===s)))),H_=S(u.createSelector([bt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),G_=S(u.createSelector([Jt,bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return T(t.filter(a=>n.has(a.id)))})),Ke=M(t=>t.uuid),Dw={instances:{}},Zn=u.createSlice({name:"projectAttachments",initialState:Dw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Dw)),reducers:{initializeProjectAttachments:Ke.initialize,addProjectAttachment:Ke.addOne,addProjectAttachments:Ke.addMany,setProjectAttachment:Ke.setOne,setProjectAttachments:Ke.setMany,updateProjectAttachment:Ke.updateOne,updateProjectAttachments:Ke.updateMany,deleteProjectAttachment:Ke.deleteOne,deleteProjectAttachments:Ke.deleteMany}}),{initializeProjectAttachments:Uw,addProjectAttachment:Lw,addProjectAttachments:Nw,setProjectAttachment:Hw,setProjectAttachments:Gw,updateProjectAttachment:Kw,updateProjectAttachments:Yw,deleteProjectAttachment:Zw,deleteProjectAttachments:Jw}=Zn.actions,Xw=t=>t.projectAttachmentReducer.instances,Jn=u.createSelector([Xw],t=>Object.values(t)),Qw=t=>s=>s.projectAttachmentReducer.instances[t],xw=S(u.createSelector([Jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),K_=S(u.createSelector([Jn,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>s===e)))),eO=Zn.reducer,Ye=M(t=>t.uuid),tO={instances:{},activeProjectFileId:null,isImportingProjectFile:!1},Xn=u.createSlice({name:"projectFiles",initialState:tO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,tO)),reducers:{initializeProjectFiles:Ye.initialize,setProjectFile:Ye.setOne,setProjectFiles:Ye.setMany,addProjectFile:Ye.addOne,addProjectFiles:Ye.addMany,updateProjectFile:Ye.updateOne,updateProjectFiles:Ye.updateMany,deleteProjectFile:Ye.deleteOne,deleteProjectFiles:Ye.deleteMany,setIsImportingProjectFile:(t,s)=>{t.isImportingProjectFile=s.payload},saveActiveProjectFileBounds:(t,s)=>{const e=t.activeProjectFileId;if(!e)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[e])throw new Error(`Tried to save bounds for active project file, but project file with ID ${e}
|
|
2
|
+
doesn't exist.`);t.instances[e].bounds=s.payload},setActiveProjectFileId:(t,s)=>{t.activeProjectFileId=s.payload}}}),{initializeProjectFiles:sO,setProjectFile:iO,setProjectFiles:nO,addProjectFile:aO,addProjectFiles:cO,updateProjectFile:rO,updateProjectFiles:dO,deleteProjectFile:lO,deleteProjectFiles:oO,setIsImportingProjectFile:uO,setActiveProjectFileId:hO,saveActiveProjectFileBounds:mO}=Xn.actions,pO=t=>t.projectFileReducer.instances,yO=u.createSelector([pO],t=>T(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),fO=t=>s=>s.projectFileReducer.instances[t],AO=S(u.createSelector([yO,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Y_=t=>t.projectFileReducer.activeProjectFileId,Z_=t=>t.projectFileReducer.isImportingProjectFile,SO=Xn.reducer,Ze=M(t=>t.uuid),TO={instances:{}},Qn=u.createSlice({name:"projects",initialState:TO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,TO)),reducers:{initializeProjects:Ze.initialize,setProjects:Ze.setMany,setProject:Ze.setOne,addProjects:Ze.addMany,addProject:Ze.addOne,updateProjects:Ze.updateMany,updateProject:Ze.updateOne,deleteProject:Ze.deleteOne,deleteProjects:Ze.deleteMany}}),{initializeProjects:wO,setProjects:OO,setProject:IO,addProjects:FO,addProject:PO,updateProjects:gO,updateProject:bO,deleteProject:_O,deleteProjects:MO}=Qn.actions,RO=Qn.reducer,kO=t=>t.projectReducer.instances,xt=u.createSelector([kO],t=>Object.values(t)),vO=t=>s=>s.projectReducer.instances[t],EO=S(u.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),J_=S(u.createSelector([xt,bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return T(t.filter(a=>n.has(a.uuid)))})),X_=S(u.createSelector([xt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Q_={isRehydrated:!1},xn=u.createSlice({name:"rehydrated",initialState:Q_,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:x_}=xn.actions,eM=t=>t.rehydratedReducer.isRehydrated,VO=xn.reducer,Je=M(t=>t.uuid),BO={instances:{}},ea=u.createSlice({name:"teamMemberships",initialState:BO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,BO)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:zO,addTeamMembership:WO,addTeamMemberships:qO,setTeamMembership:CO,setTeamMemberships:jO,updateTeamMembership:$O,updateTeamMemberships:DO,deleteTeamMembership:UO,deleteTeamMemberships:LO}=ea.actions,NO=ea.reducer,HO=t=>t.teamMembershipReducer.instances,es=u.createSelector([HO],t=>Object.values(t)),GO=t=>s=>s.teamMembershipReducer.instances[t],KO=S(u.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),tM=S(u.createSelector([es,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),sM=S(u.createSelector([Jt,es,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return T(t.filter(a=>n.has(a.id)))})),Xe=M(t=>t.uuid),YO={instances:{}},ta=u.createSlice({name:"teams",initialState:YO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,YO)),reducers:{initializeTeams:Xe.initialize,addTeam:Xe.addOne,addTeams:Xe.addMany,setTeam:Xe.setOne,setTeams:Xe.setMany,updateTeam:Xe.updateOne,updateTeams:Xe.updateMany,deleteTeam:Xe.deleteOne,deleteTeams:Xe.deleteMany}}),{initializeTeams:ZO,addTeam:JO,addTeams:XO,setTeam:QO,setTeams:xO,updateTeam:eI,updateTeams:tI,deleteTeam:sI,deleteTeams:iI}=ta.actions,nI=t=>t.teamReducer.instances,sa=u.createSelector([nI],t=>Object.values(t)),aI=t=>s=>s.teamReducer.instances[t],cI=S(u.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),iM=S(u.createSelector([sa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),rI=ta.reducer,Qe=M(t=>t.uuid),dI={instances:{}},ia=u.createSlice({name:"workflows",initialState:dI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,dI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:lI,addWorkflow:oI,addWorkflows:na,setWorkflow:uI,setWorkflows:hI,updateWorkflow:mI,updateWorkflows:pI,deleteWorkflow:yI,deleteWorkflows:aa}=ia.actions,fI=t=>t.workflowReducer.instances,ts=u.createSelector([fI],t=>Object.values(t)),AI=t=>s=>s.workflowReducer.instances[t],SI=S(u.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),nM=S(u.createSelector([ts,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),TI=S(u.createSelector([ts,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_type===s)))),wI=ia.reducer,xe=M(t=>t.uuid),OI={instances:{}},ca=u.createSlice({name:"workflowStepAssignees",initialState:OI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,OI)),reducers:{initializeWorkflowStepAssignees:xe.initialize,addWorkflowStepAssignee:xe.addOne,addWorkflowStepAssignees:xe.addMany,setWorkflowStepAssignee:xe.setOne,setWorkflowStepAssignees:xe.setMany,updateWorkflowStepAssignee:xe.updateOne,updateWorkflowStepAssignees:xe.updateMany,deleteWorkflowStepAssignee:xe.deleteOne,deleteWorkflowStepAssignees:xe.deleteMany}}),{initializeWorkflowStepAssignees:II,addWorkflowStepAssignee:FI,addWorkflowStepAssignees:ra,setWorkflowStepAssignee:PI,setWorkflowStepAssignees:gI,updateWorkflowStepAssignee:bI,updateWorkflowStepAssignees:_I,deleteWorkflowStepAssignee:MI,deleteWorkflowStepAssignees:da}=ca.actions,RI=t=>t.workflowStepAssigneeReducer.instances,_t=u.createSelector([RI],t=>Object.values(t)),kI=t=>s=>s.workflowStepAssigneeReducer.instances[t],vI=S(u.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),EI=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),aM=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),cM=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.user===s)))),VI=ca.reducer,et=M(t=>t.uuid),BI={instances:{}},la=u.createSlice({name:"workflowStepCommentAttachments",initialState:BI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,BI)),reducers:{initializeWorkflowStepCommentAttachments:et.initialize,addWorkflowStepCommentAttachment:et.addOne,addWorkflowStepCommentAttachments:et.addMany,setWorkflowStepCommentAttachment:et.setOne,setWorkflowStepCommentAttachments:et.setMany,updateWorkflowStepCommentAttachment:et.updateOne,updateWorkflowStepCommentAttachments:et.updateMany,deleteWorkflowStepCommentAttachment:et.deleteOne,deleteWorkflowStepCommentAttachments:et.deleteMany}}),{initializeWorkflowStepCommentAttachments:zI,addWorkflowStepCommentAttachment:WI,addWorkflowStepCommentAttachments:ss,setWorkflowStepCommentAttachment:qI,setWorkflowStepCommentAttachments:CI,updateWorkflowStepCommentAttachment:jI,updateWorkflowStepCommentAttachments:$I,deleteWorkflowStepCommentAttachment:DI,deleteWorkflowStepCommentAttachments:is}=la.actions,UI=t=>t.workflowStepCommentAttachmentReducer.instances,oa=u.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.workflowStepCommentAttachmentReducer.instances[t],NI=S(u.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ua=S(u.createSelector([oa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step_comment===s)))),HI=la.reducer,tt=M(t=>t.uuid),GI={instances:{}},ha=u.createSlice({name:"workflowStepComments",initialState:GI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,GI)),reducers:{initializeWorkflowStepComments:tt.initialize,addWorkflowStepComment:tt.addOne,addWorkflowStepComments:tt.addMany,setWorkflowStepComment:tt.setOne,setWorkflowStepComments:tt.setMany,updateWorkflowStepComment:tt.updateOne,updateWorkflowStepComments:tt.updateMany,deleteWorkflowStepComment:tt.deleteOne,deleteWorkflowStepComments:tt.deleteMany}}),{initializeWorkflowStepComments:KI,addWorkflowStepComment:YI,addWorkflowStepComments:ma,setWorkflowStepComment:ZI,setWorkflowStepComments:JI,updateWorkflowStepComment:XI,updateWorkflowStepComments:QI,deleteWorkflowStepComment:xI,deleteWorkflowStepComments:pa}=ha.actions,eF=t=>t.workflowStepCommentReducer.instances,ns=u.createSelector([eF],t=>Object.values(t)),tF=t=>s=>s.workflowStepCommentReducer.instances[t],sF=S(u.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),iF=S(u.createSelector([ns,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),rM=S(u.createSelector([ns,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),nF=ha.reducer,st=M(t=>t.uuid),aF={instances:{}},ya=u.createSlice({name:"workflowStepCompletions",initialState:aF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,aF)),reducers:{initializeWorkflowStepCompletions:st.initialize,addWorkflowStepCompletion:st.addOne,addWorkflowStepCompletions:st.addMany,setWorkflowStepCompletion:st.setOne,setWorkflowStepCompletions:st.setMany,updateWorkflowStepCompletion:st.updateOne,updateWorkflowStepCompletions:st.updateMany,deleteWorkflowStepCompletion:st.deleteOne,deleteWorkflowStepCompletions:st.deleteMany}}),{initializeWorkflowStepCompletions:cF,addWorkflowStepCompletion:rF,addWorkflowStepCompletions:fa,setWorkflowStepCompletion:dF,setWorkflowStepCompletions:lF,updateWorkflowStepCompletion:oF,updateWorkflowStepCompletions:uF,deleteWorkflowStepCompletion:hF,deleteWorkflowStepCompletions:Aa}=ya.actions,mF=t=>t.workflowStepCompletionReducer.instances,as=u.createSelector([mF],t=>Object.values(t)),pF=t=>s=>s.workflowStepCompletionReducer.instances[t],yF=S(u.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),fF=S(u.createSelector([as,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),dM=S(u.createSelector([as,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),AF=ya.reducer,it=M(t=>t.uuid),SF={instances:{}},Sa=u.createSlice({name:"workflowStepFieldValuesAttachments",initialState:SF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,SF)),reducers:{initializeWorkflowStepFieldValuesAttachments:it.initialize,addWorkflowStepFieldValuesAttachment:it.addOne,addWorkflowStepFieldValuesAttachments:it.addMany,setWorkflowStepFieldValuesAttachment:it.setOne,setWorkflowStepFieldValuesAttachments:it.setMany,updateWorkflowStepFieldValuesAttachment:it.updateOne,updateWorkflowStepFieldValuesAttachments:it.updateMany,deleteWorkflowStepFieldValuesAttachment:it.deleteOne,deleteWorkflowStepFieldValuesAttachments:it.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:TF,addWorkflowStepFieldValuesAttachment:wF,addWorkflowStepFieldValuesAttachments:Ta,setWorkflowStepFieldValuesAttachment:OF,setWorkflowStepFieldValuesAttachments:IF,updateWorkflowStepFieldValuesAttachment:FF,updateWorkflowStepFieldValuesAttachments:PF,deleteWorkflowStepFieldValuesAttachment:gF,deleteWorkflowStepFieldValuesAttachments:wa}=Sa.actions,bF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Oa=u.createSelector([bF],t=>Object.values(t)),_F=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],MF=S(u.createSelector([Oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),RF=S(u.createSelector([Oa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),kF=Sa.reducer,nt=M(t=>t.uuid),vF={instances:{}},Ia=u.createSlice({name:"workflowStepFieldValues",initialState:vF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,vF)),reducers:{initializeWorkflowStepFieldValues:nt.initialize,addWorkflowStepFieldValues:nt.addOne,addWorkflowStepFieldValuesMany:nt.addMany,setWorkflowStepFieldValues:nt.setOne,setWorkflowStepFieldValuesMany:nt.setMany,updateWorkflowStepFieldValues:nt.updateOne,updateWorkflowStepFieldValuesMany:nt.updateMany,deleteWorkflowStepFieldValues:nt.deleteOne,deleteWorkflowStepFieldValuesMany:nt.deleteMany}}),{initializeWorkflowStepFieldValues:EF,addWorkflowStepFieldValues:VF,addWorkflowStepFieldValuesMany:Fa,setWorkflowStepFieldValues:BF,setWorkflowStepFieldValuesMany:zF,updateWorkflowStepFieldValues:WF,updateWorkflowStepFieldValuesMany:qF,deleteWorkflowStepFieldValues:CF,deleteWorkflowStepFieldValuesMany:Pa}=Ia.actions,jF=t=>t.workflowStepFieldValuesReducer.instances,Mt=u.createSelector([jF],t=>Object.values(t)),$F=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),lM=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),oM=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),DF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],UF=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),LF=Ia.reducer,at=M(t=>t.uuid),NF={instances:{}},ga=u.createSlice({name:"workflowStepFieldsAttachments",initialState:NF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,NF)),reducers:{initializeWorkflowStepFieldsAttachments:at.initialize,addWorkflowStepFieldsAttachment:at.addOne,addWorkflowStepFieldsAttachments:at.addMany,setWorkflowStepFieldsAttachment:at.setOne,setWorkflowStepFieldsAttachments:at.setMany,updateWorkflowStepFieldsAttachment:at.updateOne,updateWorkflowStepFieldsAttachments:at.updateMany,deleteWorkflowStepFieldsAttachment:at.deleteOne,deleteWorkflowStepFieldsAttachments:at.deleteMany}}),{initializeWorkflowStepFieldsAttachments:HF,addWorkflowStepFieldsAttachment:GF,addWorkflowStepFieldsAttachments:ba,setWorkflowStepFieldsAttachment:KF,setWorkflowStepFieldsAttachments:YF,updateWorkflowStepFieldsAttachment:ZF,updateWorkflowStepFieldsAttachments:JF,deleteWorkflowStepFieldsAttachment:XF,deleteWorkflowStepFieldsAttachments:_a}=ga.actions,QF=t=>t.workflowStepFieldsAttachmentReducer.instances,Ma=u.createSelector([QF],t=>Object.values(t)),xF=S(u.createSelector([Ma,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),eP=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],tP=S(u.createSelector([Ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),sP=ga.reducer,ct=M(t=>t.uuid),iP={instances:{}},Ra=u.createSlice({name:"workflowStepFields",initialState:iP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,iP)),reducers:{initializeWorkflowStepFields:ct.initialize,addWorkflowStepFields:ct.addOne,addWorkflowStepFieldsMany:ct.addMany,setWorkflowStepFields:ct.setOne,setWorkflowStepFieldsMany:ct.setMany,updateWorkflowStepFields:ct.updateOne,updateWorkflowStepFieldsMany:ct.updateMany,deleteWorkflowStepFields:ct.deleteOne,deleteWorkflowStepFieldsMany:ct.deleteMany}}),{initializeWorkflowStepFields:nP,addWorkflowStepFields:aP,addWorkflowStepFieldsMany:cP,setWorkflowStepFields:rP,setWorkflowStepFieldsMany:dP,updateWorkflowStepFields:lP,updateWorkflowStepFieldsMany:oP,deleteWorkflowStepFields:uP,deleteWorkflowStepFieldsMany:hP}=Ra.actions,ka=t=>t.workflowStepFieldsReducer.instances,cs=u.createSelector([ka],t=>Object.values(t)),uM=S(u.createSelector([cs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),hM=S(u.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mM=u.createSelector([ka],t=>{const s={};for(const e of Object.values(t)){const n=s[e.workflow_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.workflow_step]=e)}return s}),mP=t=>s=>s.workflowStepFieldsReducer.instances[t],pP=S(u.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yP=Ra.reducer,rt=M(t=>t.uuid),fP={instances:{}},va=u.createSlice({name:"workflowStepReviewRequests",initialState:fP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,fP)),reducers:{initializeWorkflowStepReviewRequests:rt.initialize,addWorkflowStepReviewRequest:rt.addOne,addWorkflowStepReviewRequests:rt.addMany,setWorkflowStepReviewRequest:rt.setOne,setWorkflowStepReviewRequests:rt.setMany,updateWorkflowStepReviewRequest:rt.updateOne,updateWorkflowStepReviewRequests:rt.updateMany,deleteWorkflowStepReviewRequest:rt.deleteOne,deleteWorkflowStepReviewRequests:rt.deleteMany}}),{initializeWorkflowStepReviewRequests:AP,addWorkflowStepReviewRequest:SP,addWorkflowStepReviewRequests:Ea,setWorkflowStepReviewRequest:TP,setWorkflowStepReviewRequests:wP,updateWorkflowStepReviewRequest:OP,updateWorkflowStepReviewRequests:IP,deleteWorkflowStepReviewRequest:FP,deleteWorkflowStepReviewRequests:Va}=va.actions,PP=t=>t.workflowStepReviewRequestReducer.instances,rs=u.createSelector([PP],t=>Object.values(t)),gP=t=>s=>s.workflowStepReviewRequestReducer.instances[t],bP=S(u.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),_P=S(u.createSelector([rs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),pM=S(u.createSelector([rs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),MP=va.reducer,dt=M(t=>t.uuid),RP={instances:{}},Ba=u.createSlice({name:"workflowStepReviews",initialState:RP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,RP)),reducers:{initializeWorkflowStepReviews:dt.initialize,addWorkflowStepReview:dt.addOne,addWorkflowStepReviews:dt.addMany,setWorkflowStepReview:dt.setOne,setWorkflowStepReviews:dt.setMany,updateWorkflowStepReview:dt.updateOne,updateWorkflowStepReviews:dt.updateMany,deleteWorkflowStepReview:dt.deleteOne,deleteWorkflowStepReviews:dt.deleteMany}}),{initializeWorkflowStepReviews:kP,addWorkflowStepReview:vP,addWorkflowStepReviews:za,setWorkflowStepReview:EP,setWorkflowStepReviews:VP,updateWorkflowStepReview:BP,updateWorkflowStepReviews:zP,deleteWorkflowStepReview:WP,deleteWorkflowStepReviews:Wa}=Ba.actions,qP=t=>t.workflowStepReviewReducer.instances,ds=u.createSelector([qP],t=>Object.values(t)),CP=t=>s=>s.workflowStepReviewReducer.instances[t],jP=S(u.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$P=S(u.createSelector([ds,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),yM=S(u.createSelector([ds,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),DP=Ba.reducer,lt=M(t=>t.uuid),UP={instances:{}},qa=u.createSlice({name:"workflowSteps",initialState:UP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,UP)),reducers:{initializeWorkflowSteps:lt.initialize,addWorkflowStep:lt.addOne,addWorkflowSteps:lt.addMany,setWorkflowStep:lt.setOne,setWorkflowSteps:lt.setMany,updateWorkflowStep:lt.updateOne,updateWorkflowSteps:lt.updateMany,deleteWorkflowStep:lt.deleteOne,deleteWorkflowSteps:lt.deleteMany}}),{initializeWorkflowSteps:LP,addWorkflowStep:NP,addWorkflowSteps:Ca,setWorkflowStep:HP,setWorkflowSteps:GP,updateWorkflowStep:KP,updateWorkflowSteps:YP,deleteWorkflowStep:ZP,deleteWorkflowSteps:ja}=qa.actions,JP=qa.reducer,XP=t=>t.workflowStepReducer.instances,$a=u.createSelector([XP],t=>Object.values(t)),QP=t=>s=>s.workflowStepReducer.instances[t],xP=S(u.createSelector([$a,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_type===s)))),eg=S(u.createSelector([$a,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ot=M(t=>t.uuid),tg={instances:{}},Da=u.createSlice({name:"workflowTypes",initialState:tg,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,tg)),reducers:{initializeWorkflowTypes:ot.initialize,addWorkflowType:ot.addOne,addWorkflowTypes:ot.addMany,setWorkflowType:ot.setOne,setWorkflowTypes:ot.setMany,updateWorkflowType:ot.updateOne,updateWorkflowTypes:ot.updateMany,deleteWorkflowType:ot.deleteOne,deleteWorkflowTypes:ot.deleteMany}}),{initializeWorkflowTypes:sg,addWorkflowType:ig,addWorkflowTypes:ng,setWorkflowType:ag,setWorkflowTypes:cg,updateWorkflowType:rg,updateWorkflowTypes:dg,deleteWorkflowType:lg,deleteWorkflowTypes:og}=Da.actions,ug=t=>t.workflowTypeReducer.instances,Ua=u.createSelector([ug],t=>Object.values(t)),hg=t=>s=>s.workflowTypeReducer.instances[t],mg=S(u.createSelector([Ua,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),fM=S(u.createSelector([Ua,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),pg=Da.reducer,AM={version:0},yg=u.createSlice({name:"versioning",initialState:AM,reducers:{}}),fg=yg.reducer,La={outboxReducer:_w,fileReducer:Xm,authReducer:Hh},SM=u.combineReducers(La),Ag={...La,[Ot]:fg,categoryReducer:nm,assetReducer:Xl,assetAttachmentReducer:Wc,assetStageCompletionReducer:lo,assetStageReducer:Po,assetTypeReducer:Mh,assetTypeAttachmentReducer:jo,issueReducer:lA,issueAttachmentReducer:Ff,issueTypeReducer:hT,issueTypeAttachmentReducer:FA,organizationReducer:Ow,projectReducer:RO,projectAttachmentReducer:eO,projectAccessReducer:Cw,organizationAccessReducer:iw,projectFileReducer:SO,rehydratedReducer:VO,formReducer:cy,formRevisionReducer:Zp,formRevisionAttachmentReducer:jp,formSubmissionAttachmentReducer:Oy,formSubmissionReducer:By,formIdentifierReducer:up,formIdentifierValueReducer:gp,userReducer:NT,emailDomainsReducer:Gm,documentsReducer:Rm,documentAttachmentReducer:Sm,teamReducer:rI,agentsReducer:Fc,issueCommentReducer:Jf,issueCommentAttachmentReducer:qf,issueUpdateReducer:zT,geoImageReducer:Yy,issueAssociationReducer:of,issueTypeFieldsReducer:uS,issueTypeFieldValuesReducer:XA,issueTypeFieldsAttachmentReducer:qA,issueTypeFieldValuesAttachmentReducer:PS,issueTypeIdentifierReducer:CS,issueTypeIdentifierValueReducer:QS,issueTypeStatusReducer:gT,assetTypeFieldsReducer:mu,assetTypeFieldValuesReducer:$u,assetTypeFieldsAttachmentReducer:xo,assetTypeFieldValuesAttachmentReducer:bu,assetTypeIdentifierReducer:eh,assetTypeIdentifierValueReducer:ph,assetTypeStatusReducer:Uh,assetProcedureTypeReducer:Od,assetProcedureReducer:cd,assetProcedureTypeFieldsReducer:Or,assetProcedureTypeFieldValuesReducer:Yr,assetProcedureTypeFieldsAttachmentReducer:rr,assetProcedureTypeFieldValuesAttachmentReducer:Vr,assetProcedureTypeAttachmentReducer:Kc,assetProcedureStepFieldsAttachmentReducer:Cd,assetProcedureStepFieldsReducer:Xd,assetProcedureStepFieldValuesAttachmentReducer:ol,assetProcedureStepFieldValuesReducer:Pl,assetProcedureStepReducer:zl,teamMembershipReducer:NO,workflowTypeReducer:pg,workflowStepReducer:JP,workflowReducer:wI,workflowStepFieldsReducer:yP,workflowStepFieldsAttachmentReducer:sP,workflowStepFieldValuesReducer:LF,workflowStepFieldValuesAttachmentReducer:kF,workflowStepAssigneeReducer:VI,workflowStepReviewRequestReducer:MP,workflowStepReviewReducer:DP,workflowStepCompletionReducer:AF,workflowStepCommentReducer:nF,workflowStepCommentAttachmentReducer:HI},TM=u.combineReducers(Ag),Sg=1e4,Tg=200,Na=[400,409,403,404,405,500],U=1e4,wg={};class Og{constructor(s){p(this,"client");p(this,"pageSize",Sg);wg[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const Ig=()=>gg.length-1,Fg=t=>(t[Ot]={version:Ig()},t),Pg=()=>Fg({}),wM=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),OM=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Ot])==null?void 0:e.version)===Ig()?s:t(s)},gg=[Fg,Pg,Pg,wM],IM=Object.fromEntries(gg.map((t,s)=>[s,OM(t)])),FM=t=>{if(t)throw t;const s=wt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},bg=(t,s,e)=>{const n=pt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},_g=(t,s,e)=>{const n=pt();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function PM(t,s){if(!s.payload)throw new Error("Received empty payload");return $g(s)}const gM={...Qa,effect:PM,discard:Rg,returnPromises:!0,persistCallback:FM,retry:RM,persistOptions:{storage:Kg},queue:{...Qa.queue,enqueue:bg,dequeue:_g,peek:(...t)=>MM(...t)}},bM=Yg(IM,Ot),_M=u.compose(Gg.offline(gM),bM);async function Mg(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=wg[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ya(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function Rg(t,s,e=0){var r;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
+
Url:`,s.payload.url,`
|
|
4
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=wt(),c=n.getState().outboxReducer.deletedRequests,d=s.payload.uuid;function o(){n.dispatch(gw(d));const h=pt();if(!h)throw new Error("Outbox coordinator not set");h.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof $&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),o()),c.includes(d)&&(console.debug("Discarding request due to deletion:",s.payload.url),o()),t instanceof $){const h=t.status||((r=t.response)==null?void 0:r.status);if(h||console.warn("Error has no status code:",t),h!==void 0&&Na.includes(h)){console.warn("Discarding request due to error:",t,`
|
|
5
|
+
Action:`,s);const y=pt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,o()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=pt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function MM(t,s,e){var n;return(n=pt())==null?void 0:n.peek()}function RM(t,s){return wt().dispatch(bw(new Date().getTime())),cc}const At="An unknown error occurred",kM=500,kg=["non_field_errors","detail"];function vM(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([a,c])=>typeof c=="string"?kg.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?kg.includes(a)?c.join(`
|
|
6
|
+
`):c.map(d=>`${a}: ${d}`).join(`
|
|
7
|
+
`):`${a}: ${JSON.stringify(c)}`).join(`
|
|
8
|
+
`)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>kM?At:e}class $ extends Error{constructor(e){super(At);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??vM(n,a)??At,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function vg(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class EM extends Og{constructor(s){super(s)}}class mt extends Og{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class VM extends mt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(wc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(Ic(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:m.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(Oc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:m.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:m.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(Tc(n)),n}}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case m.GET:return`Get ${n}`;case m.POST:return`Create ${n}`;case m.PATCH:return`Update ${n}`;case m.PUT:return`Update ${n}`;case m.DELETE:return`Delete ${n}`}}class k extends mt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class L extends k{constructor(){super(...arguments);p(this,"pageSize",Tg)}async _bulkAdd(e){var A;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,l=new Date().toISOString(),r=[],h=[],y={};for(const O of e){const{modelUuid:P,file:I}=O,F=await this.client.files.getFilePayload(I);F.sha1 in y||(y[F.sha1]=F);const g=this.buildModel({file:I,file_sha1:F.sha1,submitted_at:l,created_by:o,modelUuid:P});r.push(g),h.push(this.buildPayload(g,F))}this.dispatch(a(r));const f=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(O=>this.getId(O)),blockers:r.map(O=>O.file_sha1)});return f.then(({attachments:O,presigned_urls:P})=>{this.dispatch(c(O)),this.client.files.processPresignedUrls(P)}).catch(()=>{this.dispatch(d(r.map(O=>this.getId(O))))}),[r,f.then(({attachments:O})=>O)]}async _delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(c(this.getId(o)));const l=this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return l.then(()=>{this.client.files.removeCache(o.file_sha1)}).catch(()=>{this.dispatch(a(o))}),l}}class BM extends L{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:bc,addMany:Os,setOne:_c,setMany:Mc,updateOne:Rc,updateMany:kc,deleteOne:vc,deleteMany:Is,initialize:gc});p(this,"selectors",{selectById:Vc,selectByIds:Bc})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset:e.asset}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(d)),d}}class zM extends L{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:jc,addMany:$c,setOne:Dc,setMany:Uc,updateOne:Lc,updateMany:Nc,deleteOne:Hc,deleteMany:Gc,initialize:Cc});p(this,"selectors",{selectById:Zc,selectByIds:Jc})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_procedure_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_procedure_type:e.asset_procedure_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetProcedureTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class WM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:xc,addMany:er,setOne:tr,setMany:sr,updateOne:ir,updateMany:nr,deleteOne:ar,deleteMany:cr,initialize:Qc});p(this,"selectors",{selectById:lr,selectByIds:or})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class qM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:mr,addMany:pr,setOne:yr,setMany:fr,updateOne:Ar,updateMany:Sr,deleteOne:Tr,deleteMany:wr,initialize:hr});p(this,"selectors",{selectById:Fr,selectByIds:Pr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}function ut(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}class CM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:_r,addMany:ks,setOne:Mr,setMany:Rr,updateOne:kr,updateMany:vr,deleteOne:Er,deleteMany:vs,initialize:br});p(this,"selectors",{selectById:zr,selectByIds:Wr})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class jM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:$r,addMany:Dr,setOne:Ur,setMany:Lr,updateOne:Nr,updateMany:Hr,deleteOne:Gr,deleteMany:Kr,initialize:jr});p(this,"selectors",{selectById:Jr,selectByIds:Xr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{values:a,payloads:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=ut(c,Math.min(n??c.length,U)),A=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,published_at:g.published_at,values:v.values})}A.push({submitted_at:r,values:a,field_values:F})}this.dispatch(d(y));const O=[];for(const I of A){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),B=F.map(({asset_procedure:q})=>q),V=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(B),blocks:V});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(z(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=qr(e)(o);this.dispatch(a(e)),this.dispatch(vs(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(ks(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class $M extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:ed,addMany:zs,setOne:nd,setMany:ad,updateOne:td,updateMany:sd,deleteOne:id,deleteMany:Ws,initialize:xr});p(this,"selectors",{selectById:ld,selectByIds:od})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_procedure_type,e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class DM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:md,addMany:pd,setOne:Td,setMany:wd,updateOne:yd,updateMany:fd,deleteOne:Ad,deleteMany:Sd,initialize:hd});p(this,"selectors",{selectById:Fd,selectByIds:Pd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const r=dd(e)(o);this.dispatch(a(e)),this.dispatch(Ws(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(zs(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class UM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:_d,addMany:Md,setOne:Rd,setMany:kd,updateOne:vd,updateMany:Ed,deleteOne:Vd,deleteMany:Bd,initialize:bd});p(this,"selectors",{selectById:Wd,selectByIds:qd})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class LM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:Dd,addMany:Ud,setOne:Ld,setMany:Nd,updateOne:Hd,updateMany:Gd,deleteOne:Kd,deleteMany:Yd,initialize:$d});p(this,"selectors",{selectById:Zd,selectByIds:Jd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!d)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(o){throw this.dispatch(c(d)),o}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class NM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:el,addMany:Ns,setOne:tl,setMany:sl,updateOne:il,updateMany:nl,deleteOne:al,deleteMany:Hs,initialize:xd});p(this,"selectors",{selectById:rl,selectByIds:dl})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class HM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:ml,addMany:pl,setOne:yl,setMany:fl,updateOne:Al,updateMany:Sl,deleteOne:Tl,deleteMany:wl,initialize:hl});p(this,"selectors",{selectById:Il,selectByIds:Fl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=ut(a,Math.min(n??a.length,U)),A=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,asset_procedure_step:g.asset_procedure_step,published_at:g.published_at,values:v.values})}A.push({submitted_at:r,values:c,field_values:F})}this.dispatch(d(y));const O=[];for(const I of A){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),B=F.map(({asset_procedure:q})=>q),V=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(B),blocks:V});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(z(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=ll(e)(o);this.dispatch(a(e)),this.dispatch(Hs(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ns(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class GM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Rl,addMany:kl,setOne:_l,setMany:Ml,updateOne:vl,updateMany:El,deleteOne:Vl,deleteMany:Bl,initialize:bl});p(this,"selectors",{selectById:Wl,selectByIds:ql})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:d,deleteOne:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Cl(e)(r);this.dispatch(o(e)),this.dispatch(a(z(y)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(d(h)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class KM extends k{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:Dl,addMany:Xs,setOne:Hl,setMany:Gl,updateOne:Ul,updateMany:Ll,deleteOne:Nl,deleteMany:Qs,initialize:$l});p(this,"selectors",{selectById:Zl,selectByIds:Jl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const r=zc(e)(o),h=lf(e)(o);this.dispatch(c(e)),this.dispatch(Is(z(r))),this.dispatch(Gt(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Os(r)),this.dispatch(Ht(h)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),d=ht.v4(),o=ut(e,Math.min(n??e.length,U)).map(h=>{const y=h.map(f=>_(f));return{batchId:ht.v4(),payload:{transaction_id:d,submitted_at:c,assets:y}}}),l=[];let r=null;for(const h of o){const{batchId:y,payload:f}=h,A=f.assets.map(({uuid:g})=>g),O=f.assets.map(({asset_type:g})=>g),P=f.assets.map(({project:g})=>g),I=f.assets.map(({status:g})=>g),F=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:f,blockers:(r?[r]:[]).concat(O).concat(P).concat(I),blocks:[y].concat(A)});r=h.batchId,l.push(F)}return Promise.all(l).then(h=>{const y=h.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=z(e).toSorted(vt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(As);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} assets that dont exist in the store`);const r=[];for(let A=0;A<o.length;A++)r.push({...l[A],...e[A]});this.dispatch(c(r));const h=ut(e,Math.min(n??e.length,U)),y=[];let f=null;for(const A of h){const O=ht.v4(),P=z(A),I=A.map(({status:g})=>g).filter(Boolean),F=this.enqueueRequest({description:w(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:A},blockers:(f?[f]:[]).concat(P).concat(I),blocks:[O].concat(P)});y.push(F),f=O}return Promise.all(y).then(A=>{this.dispatch(c(A.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(a(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class YM extends k{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:eo,addMany:to,setOne:so,setMany:io,updateOne:no,updateMany:ao,deleteOne:co,deleteMany:ro,initialize:xl});p(this,"selectors",{selectById:ho,selectByIds:mo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_stage],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}bulkAdd(e){var A;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=e.map(O=>_(O)),h=r.map(O=>({...O,created_by:l,submitted_at:o})),y=h.map(({uuid:O})=>O);this.dispatch(a(h));const f=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:o,completions:r},blockers:[...e.map(O=>O.asset_procedure),...e.map(O=>O.asset_stage),...e.map(O=>O.asset)],blocks:y});return f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(d(y))}),[h,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ZM extends k{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:So,addMany:To,setOne:fo,setMany:Ao,updateOne:wo,updateMany:Oo,deleteOne:Io,deleteMany:Fo,initialize:yo});p(this,"selectors",{selectById:go,selectByIds:bo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class JM extends L{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Ro,addMany:ni,setOne:ko,setMany:vo,updateOne:Eo,updateMany:Vo,deleteOne:Bo,deleteMany:ai,initialize:Mo});p(this,"selectors",{selectById:Wo,selectByIds:qo})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_type:e.asset_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class XM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:Uo,addMany:Lo,setOne:No,setMany:Ho,updateOne:Go,updateMany:Ko,deleteOne:Yo,deleteMany:Zo,initialize:Do});p(this,"selectors",{selectById:Xo,selectByIds:Qo})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class QM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:su,addMany:iu,setOne:nu,setMany:au,updateOne:cu,updateMany:ru,deleteOne:du,deleteMany:lu,initialize:tu});p(this,"selectors",{selectById:uu,selectByIds:hu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:fu,addMany:ui,setOne:Au,setMany:Su,updateOne:Tu,updateMany:wu,deleteOne:Ou,deleteMany:hi,initialize:yu});p(this,"selectors",{selectById:Fu,selectByIds:Pu})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class eR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Ru,addMany:ku,setOne:vu,setMany:Eu,updateOne:Vu,updateMany:Bu,deleteOne:zu,deleteMany:Wu,initialize:Mu});p(this,"selectors",{selectById:Cu,selectByIds:ju})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var O;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=[],y=ut(a,Math.min(n??a.length,U)),f=[];for(const P of y){const I=[];for(const F of P){const g=_({...F,values:F.values,created_by:((O=this.client.store.getState().userReducer.currentUser)==null?void 0:O.id)??null,submitted_at:r});h.push(g),I.push({uuid:g.uuid,asset:F.asset,fields_revision:F.fields_revision,published_at:F.published_at,values:g.values})}f.push({submitted_at:r,values:c,field_values:I})}this.dispatch(d(h));const A=[];for(const P of f){const{field_values:I}=P,F=I.map(({asset:V})=>V),g=I.map(({fields_revision:V})=>V),v=I.map(({uuid:V})=>V),B=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:P,blockers:F.concat(g),blocks:v});A.push(B)}return Promise.all(A).then(P=>{this.dispatch(o(P.flat()))}).catch(()=>{this.dispatch(l(z(h)))}),[h,A]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=gu(e)(o);this.dispatch(a(e)),this.dispatch(hi(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(ui(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class tR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:Lu,addMany:Nu,setOne:Hu,setMany:Gu,updateOne:Ku,updateMany:Yu,deleteOne:Zu,deleteMany:Ju,initialize:Uu});p(this,"selectors",{selectById:Qu,selectByIds:xu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class sR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:ih,addMany:nh,setOne:ah,setMany:ch,updateOne:rh,updateMany:dh,deleteOne:lh,deleteMany:oh,initialize:sh});p(this,"selectors",{selectById:hh,selectByIds:mh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(d)),d}}class iR extends k{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:Th,addMany:wh,setOne:Ah,setMany:Sh,updateOne:Oh,updateMany:Ih,deleteOne:Fh,deleteMany:Ph,initialize:fh});p(this,"selectors",{selectById:bh,selectByIds:_h})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const r=Yl(e)(o),h=Co(e)(o);this.dispatch(a(e)),this.dispatch(Qs(z(r))),this.dispatch(ai(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Xs(r)),this.dispatch(ni(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class nR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:vh,addMany:Eh,setOne:Vh,setMany:Bh,updateOne:zh,updateMany:Wh,deleteOne:qh,deleteMany:Ch,initialize:kh});p(this,"selectors",{selectById:$h,selectByIds:Dh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class aR extends k{constructor(){super(...arguments);p(this,"name","Category");p(this,"url","/categories");p(this,"actions",{addOne:Yh,addMany:Zh,setOne:Jh,setMany:Xh,updateOne:Qh,updateMany:xh,deleteOne:em,deleteMany:tm,initialize:Kh});p(this,"selectors",{selectById:Pi,selectByIds:im})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.project],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${o.uuid}/`,blockers:[o.uuid],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class cR extends L{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:rm,addMany:dm,setOne:lm,setMany:om,updateOne:um,updateMany:hm,deleteOne:mm,deleteMany:pm,initialize:cm});p(this,"selectors",{selectById:fm,selectByIds:Am})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,document:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,document:e.document}}async bulkAdd(e){var O;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((O=n.getState().userReducer.currentUser)==null?void 0:O.id)??null,l=new Date().toISOString(),r=[],h=[],y={},f={};for(const P of e){const{documentUuid:I,file:F}=P,g=await this.client.files.getFilePayload(F);g.sha1 in y||(y[g.sha1]=g,f[g.sha1]=[]);const v=this.buildModel({file:F,file_sha1:g.sha1,submitted_at:l,created_by:o,modelUuid:I});r.push(v),h.push(this.buildPayload(v,g)),f[g.sha1].push(v.uuid)}this.dispatch(a(r));const A=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(P=>P.uuid),blockers:r.map(P=>P.file_sha1)});return A.then(({attachments:P,presigned_urls:I})=>{this.dispatch(c(P));const F=this.client.files.processPresignedUrls(I);for(const[g,v]of Object.entries(F))v.then(()=>{const B=f[g];for(const V of B)this.makeReadable(V)})}).catch(()=>{this.dispatch(d(r.map(P=>P.uuid)))}),[r,A.then(({attachments:P})=>P)]}async delete(e){return this._delete(e)}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:m.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),d=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class rR extends k{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Om,addMany:Im,setOne:Fm,setMany:Pm,updateOne:gm,updateMany:bm,deleteOne:_m,deleteMany:Mm,initialize:wm});p(this,"selectors",{selectById:km,selectByIds:vm})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:r.parent_document?[r.parent_document]:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(d(f))}).catch(()=>{this.dispatch(c(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:d,deleteMany:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=Em(e)(r);this.dispatch(a(e)),this.dispatch(o(z(y)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(h)),this.dispatch(d(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),d=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class St extends mt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class dR extends St{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:zm,addMany:Wm,setOne:qm,setMany:Cm,updateOne:jm,updateMany:$m,deleteOne:Dm,deleteMany:Um,initialize:Bm});p(this,"selectors",{selectById:Nm,selectByIds:Hm})}async add(e,n){return this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class lR extends mt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:m.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:m.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const ls={},Ha=new Set;let os=0,Ga=0,Ka=0;const oR=20;class uR extends mt{constructor(){super(...arguments);p(this,"host");p(this,"_dbPromise",Zg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async renewUploadUrl(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await fs(n,e),c=await this.enqueueRequest({description:"Get S3 URL",method:m.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await ft(n),file_type:n.type,extension:n.name.split(".").pop(),size:n.size.toString()},blockers:[],blocks:[`s3-${a}`]});return"url"in c&&this.dispatch(Zm({sha1:e,...c})),c}async addCache(e,n){if(Ha.has(n))return;if(!e.type){const d=e.name.split("."),o=d[d.length-1];e=new File([e],e.name,{type:o})}if(!e.name||!e.size||!e.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const a=await this._dbPromise;!!await a.get("files",n)?(console.error("File already cached (this is unexpected at this point):",e.name,n),os++):(await a.put("files",e,n),Ga++),Ha.add(n),Ka++,Ka%oR===0&&console.debug(`File cache summary: ${os} hits and ${Ga} misses, ${os/(os+Ga)*100}% hit rate over ${Ka} calls to addCache.`)}async removeCache(e){await(await this._dbPromise).delete("files",e),Ha.delete(e)}async fetchCache(e){return(await this._dbPromise).get("files",e)}async getOrRenewUploadUrl(e){const n=this.client.store.getState();return Jm(e)(n)??await this.renewUploadUrl(e)}async uploadFileToS3(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await fs(n,e),c={file_name:n.name,file_sha1:e,file:a},d=await this.getOrRenewUploadUrl(e);if("warning"in d){if(d.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(d.warning)}const o=d.url,l=this.enqueueRequest({url:o,description:"Upload file",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${a}`],blocks:[e],s3url:d});return[c,l]}async fetchFileFromUrl(e,n,a){const c=e.split("?")[0]??e,d=await this.fetchCache(n);if(d){if(!d.name)throw new Error("Cached file unexpectedly has no name.");return d}if(e.startsWith("blob:")){const h=await lc(e),y=new File([h],a??n,{type:h.type});return await this.addCache(y,n),y}let o=ls[c],l=!0;o?l=!1:(o=new Promise(h=>{this.enqueueRequest({description:"Download file",method:m.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[n],blocks:[n]}).then(y=>{const f=new File([y],a??n,{type:y.type});h(f)})}),ls[c]=o);let r;try{r=await o}catch(h){throw l&&h instanceof $&&delete ls[c],h}if(l){const h=await ft(r);if(h!==n){const A=`The hash of the file returned from the server (${h}) does not match the
|
|
9
|
+
expected hash (${n}). This can happen if you're using a local development server and the
|
|
10
10
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
11
11
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
12
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
13
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
14
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=u.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=c??o+"."+p;if(u=Fc(u,A),!u.name)throw new Error("Failed to set file's name");await this.addCache(u,o),Bt[n]=new Promise(f=>{f(u)})}return u}}class Wb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{revisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:o};r.push(P)}this.dispatch(ru(n));const l=this.enqueueRequest({description:"Attach files to form revision",method:h.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(du(u.attachments))}).catch(()=>{this.dispatch(uu(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:h.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(nu(a)),a}}class Yb extends q{add(e){var l;const{store:i}=this.client,c=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,n=T({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(Mi(n));const r=this.enqueueRequest({description:"Create form revision",method:h.POST,url:"/form-revisions/",payload:w(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Au(m))}).catch(()=>{this.dispatch(Ei(n.uuid))}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:h.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(mu(a)),a}}class Kb extends q{add(e,i){var u;const{store:a}=this.client,c=new Date().toISOString(),n=(u=a.getState().userReducer.currentUser)==null?void 0:u.id,r=T({...e,submitted_at:c,created_by:n}),l=T({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(zi(r)),this.dispatch(Mi(l));const m=this.enqueueRequest({description:"Create form",method:h.POST,url:"/forms/",payload:{...w(r),initial_revision:{uuid:l.uuid,submitted_at:l.submitted_at,title:l.title,description:l.description,fields:l.fields}},blockers:[],blocks:[r.uuid,l.uuid]});return m.catch(o=>{throw this.dispatch(Ui(r.uuid)),this.dispatch(Ei(l.uuid)),o}),[r,l,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Iu(e)(a);if(!c)throw new Error("Expected form to exist");const n=zu(e)(a);n.length>0&&this.dispatch(jt(n.map(({uuid:l})=>l)));const r=yu(e)(a);r.length>0&&this.dispatch(fu(r.map(({uuid:l})=>l))),this.dispatch(Ui(e));try{return await this.enqueueRequest({description:"Delete form",method:h.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(zi(c)),r.length>0&&this.dispatch(pu(r)),n.length>0&&this.dispatch(Et(n)),l}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:h.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(bu(a)),a}}class Zb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{submissionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_submission:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:o};r.push(P)}this.dispatch(vt(n));const l=this.enqueueRequest({description:"Attach files to form submission",method:h.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_submission),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Ru(u.attachments))}).catch(u=>{throw this.dispatch(wt(n.map(o=>o.uuid))),u}),[n,l.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=wu(e)(a);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:h.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(vt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:h.GET,url:"/form-submission-attachments/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(_u(c)),c}}class Jb extends q{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:h.POST,url:"/form-submissions/",payload:w(c),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return this.dispatch(Bi(c)),n.then(l=>(this.dispatch(Mt(l)),l)).catch(()=>{this.dispatch(Gi(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ni(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Vu(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:h.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(l=>{this.dispatch(Mt(l))}).catch(()=>{this.dispatch(Mt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ni(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Mu(e)(a);this.dispatch(Gi(e)),this.dispatch(wt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:h.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Bi(c)),this.dispatch(vt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:h.GET,url:"/form-submissions/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(qu(c)),c}}class Xb extends q{async add(e){var p;const{store:i}=this.client,{file:a,...c}=e,n=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,l=c.project,m=await this.getFilePayload(a),u=T({...c,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch($u(u));const o=this.enqueueRequest({description:"Add geo image",method:h.POST,url:"/geo-images/",payload:{uuid:u.uuid,submitted_at:n,title:u.title,description:u.description,geo_marker:u.geo_marker,canvas_marker:u.canvas_marker,sha1:u.file_sha1,project:u.project,file_name:u.file_name,direction:u.direction,original_date:u.original_date,file:m},blocks:[l],blockers:[l]});return o.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(at(A.geo_image))}).catch(()=>{this.dispatch(Wi(u.uuid))}),[u,o.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,c=new Date().toISOString(),n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],l=[],m=[],u={};for(const A of e){const{file:f,...b}=A,P=await this.getFilePayload(f);P.sha1 in u||(u[P.sha1]=P);const _=T({...b,file_name:f.name,file_sha1:P.sha1,file:URL.createObjectURL(f),submitted_at:c,created_by:n,project:i});r.push(_),l.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Lu(r));const o=this.enqueueRequest({description:"Bulk add geo images",method:h.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(u)},blocks:[i],blockers:l});return o.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Gu(A.geo_images))}).catch(()=>{this.dispatch(Hu(l))}),[r,o.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Yi(e.uuid)(a);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch(Nu(n));const r=this.enqueueRequest({description:"Update geo image",method:h.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(l=>{this.dispatch(at(l))}).catch(()=>{this.dispatch(at(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Yi(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Wi(e));const n=this.enqueueRequest({description:"Delete geo image",method:h.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(at(c))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:h.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Bu(a)),a}}class Qb extends v{add(e){var l;const{store:i}=this.client,a=new Date().toISOString(),c=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,n=T({...e,submitted_at:a,created_by:c});this.dispatch(Zi(n));const r=this.enqueueRequest({description:"Add issue association",method:h.POST,url:"/issue-associations/",payload:w(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Xu(m))}).catch(()=>{this.dispatch(Xi(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=Qu(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Xi(e));const c=this.enqueueRequest({description:"Delete issue association",method:h.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Zi(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:h.GET,url:"/issue-associations/",queryParams:{limit:E,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ju(c)),c}}class xb extends ke{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",ea);S(this,"addAttachments",ta);S(this,"updateAttachments",co);S(this,"removeAttachments",sa);S(this,"removeAttachment",no);S(this,"setAttachment",ao);S(this,"selectAttachment",lo)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(ea(n)),n}}class eP extends ke{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",aa);S(this,"addAttachments",po);S(this,"updateAttachments",fo);S(this,"removeAttachments",So);S(this,"removeAttachment",yo);S(this,"setAttachment",Ao);S(this,"selectAttachment",Po)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(aa(n)),n}}class tP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(na(a));const c=this.enqueueRequest({description:"Add issue comment",method:h.POST,url:"/issue-comments/",payload:w(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(da(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=ua(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(ra(c));const n=this.enqueueRequest({description:"Edit issue comment",method:h.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ra(a))}),[c,n]}remove(e){const{store:i}=this.client,a=ua(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(da(e));const c=this.enqueueRequest({description:"Delete comment",method:h.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(na(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:h.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(Io(a)),a}}class sP extends v{add(e){var m;const{store:i}=this.client,a=i.getState(),c=new Date().toISOString(),n=(m=a.userReducer.currentUser)==null?void 0:m.id,r=T({...e,submitted_at:c,created_by:n});this.dispatch(la(r));const l=this.enqueueRequest({description:"Create issue",method:h.POST,url:"/issues/",payload:w(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return l.then(u=>{this.dispatch(qt(u))}).catch(u=>{throw this.dispatch(ha(r.uuid)),u}),[r,l]}update(e){var m;const i=this.client.store.getState(),a=Aa(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...a,...e};this.dispatch(qt(c));const n={};for(const u of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(u in e&&e[u]!==a[u])switch(u){case j.PRIORITY:case j.STATUS:{const o=e[u];n[u]=o!==void 0?Number(o):null;break}case j.DUE_DATE:case j.DESCRIPTION:case j.TITLE:n[u]=e[u]??null;break;case j.CATEGORY:{let o=null;const p=e[u];if(p&&(o=i.categoryReducer.instances[p]??null,!o))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[u]=o?{name:o.name,color:o.color,uuid:o.uuid}:null;break}case j.ASSIGNED_TO:{let o=null;const p=e[u];if(p&&(o=i.userReducer.instances[p]??null,!o))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[u]=o?{full_name:o.username,id:o.id}:null;break}}const r=T({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(Tl(r));const l=this.enqueueRequest({description:"Edit issue",method:h.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.catch(()=>{this.dispatch(qt(a)),this.dispatch(Ol(r.uuid))}),[c,l]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Aa(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=oo(e)(a),r=wl(e)(a),l=Uu(e)(a),m={};for(const o of xu(e)(a))m[o.uuid]=o;for(const o of eo(e)(a))m[o.uuid]=o;const u=Object.values(m);this.dispatch(ha(e)),n.length>0&&this.dispatch(sa(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(_l(r.map(({uuid:o})=>o))),l.length>0&&this.dispatch(jt(l.map(({uuid:o})=>o))),u.length>0&&this.dispatch(Qi(u.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:h.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(la(c)),this.dispatch(ta(n)),this.dispatch(Il(r)),this.dispatch(Et(l)),this.dispatch(Ji(u)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:h.GET,url:"/issues/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(vo(c)),c}}class iP extends ke{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",ya);S(this,"addAttachments",Vo);S(this,"updateAttachments",Uo);S(this,"removeAttachments",Co);S(this,"removeAttachment",Do);S(this,"setAttachment",zo);S(this,"selectAttachment",Go)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(ya(c)),c}}class aP extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(Ho(n));const l=this.enqueueRequest({description:"Add issue type fields attachments",method:h.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Wo(u.attachments))}).catch(()=>{this.dispatch(Yo(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:h.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(No(a)),a}}class cP extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(il(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:h.POST,url:"/issue-type-fields/",payload:w(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(al(m))}).catch(m=>{throw this.dispatch(cl(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:h.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(sl(a)),a}}class nP extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldValuesUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,field_values:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:o};r.push(P)}this.dispatch(zt(n));const l=this.enqueueRequest({description:"Add issue type field values attachments",method:h.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.field_values),blocks:n.map(u=>u.uuid)});return l.then(({presigned_urls:u,attachments:o})=>{this.processPresignedUrls(u),this.dispatch(ol(o))}).catch(u=>{throw this.dispatch(Ut(n.map(o=>o.uuid))),u}),[n,l.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=hl(e)(a);this.dispatch(Ut(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:h.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(zt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:h.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ul(c)),c}}class rP extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:h.POST,url:"/issue-type-field-values/",payload:w(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(ba(c)),n.then(l=>(this.dispatch(nt(l)),l)).catch(()=>{this.dispatch(Pa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ta(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(nt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:h.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(l=>{this.dispatch(nt(l))}).catch(()=>{this.dispatch(nt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ta(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ml(e)(a);this.dispatch(Pa(e)),this.dispatch(Ut(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:h.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ba(c)),this.dispatch(zt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:h.GET,url:"/issue-type-field-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qo(c)),c}}class dP extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(yl(c));const n=this.enqueueRequest({method:h.POST,url:"/issue-types/",payload:w(c),blockers:[],blocks:[c.uuid]});return n.then(l=>{this.dispatch(rt(l))}).catch(()=>{this.dispatch(va(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ma(e.uuid)(a);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(Sl(n));const r=this.enqueueRequest({method:h.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(l=>{this.dispatch(rt(l))}).catch(()=>{this.dispatch(rt(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=Ma(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Eo(e)(a);this.dispatch(va(e)),this.dispatch(Mo(n.map(l=>l.uuid)));const r=this.enqueueRequest({method:h.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(rt(c)),this.dispatch(wo(n))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:h.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(fl(a)),a}}class uP extends v{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:h.GET,url:"/issue-updates/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fl(c)),c}}const oP=1800;function lP(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class hP extends mb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:h.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await a}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Td(!1)),this.clearTokens(),this.dispatch(F()),this.dispatch(F())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let c;try{c=bm(i).exp??a}catch{c=a}return c-a<oP}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??Ye).toString()))}}}async handleUnauthorized(i,a){const c=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Ne.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:h.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(lP(c))})}}class mP extends v{update(e){const{store:i}=this.client,a=Ua(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Ct(c));const n=this.enqueueRequest({description:"Edit organization access",method:h.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Ct(r))}).catch(r=>{throw this.dispatch(Ct(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ua(e)(a),n=Dl(c.user)(a);this.dispatch(Gl(c.uuid)),this.dispatch(Vl(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:h.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Bl(c)),this.dispatch(ql(n)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:h.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(kl(a)),a}}class pP extends v{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:h.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(Wl(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:h.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(Yl(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:h.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:h.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(Hl(i)),i}}class AP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Ba(a));const c=this.enqueueRequest({description:"Add project access",method:h.POST,url:"/project-accesses/",payload:w(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return c.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(Ga(a.uuid)),r}),[a,c]}update(e){const{store:i}=this.client,a=La(e.uuid)(i.getState()),c={...a,...e};this.dispatch(dt(c));const n=this.enqueueRequest({description:"Edit project access",method:h.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(dt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=La(e)(i.getState());this.dispatch(Ga(e));try{await this.enqueueRequest({description:"Delete project access",method:h.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ba(a)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:h.GET,url:"/project-accesses/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]},i);return this.dispatch(ih(a)),a}}class fP extends ke{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",oh);S(this,"updateAttachments",mh);S(this,"removeAttachments",Ha);S(this,"removeAttachment",ph);S(this,"setAttachment",lh);S(this,"selectAttachment",yh)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:h.GET,url:`${this.url}/`,queryParams:{project__organization_owner:i},blockers:[],blocks:[]},a);return this.dispatch(uh(c)),c}}class yP extends v{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:h.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(c=>{this.dispatch(Ya(c))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const c=i.projectFileReducer.instances[a];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:h.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,u)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([o])=>{m({method:h.POST,url:`/project-files${c.project}/`,payload:{...c,...o},blockers:[a],blocks:[a]})}).catch(u)});const l=Promise.resolve(n).then(m=>this.enqueueRequest(m));return l.then(m=>{this.dispatch(Ya(m))}),this.dispatch(Rh),this.dispatch(_h(null)),this.dispatch(Oh(!1)),[c,l]}delete(e){return this.dispatch(Th(e)),this.enqueueRequest({method:h.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:h.GET,url:"/project-files/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ph(c)),c}}class SP extends v{async add(e){const i=await this.enqueueRequest({description:"Create project",method:h.POST,url:"/projects/",payload:w(e),blockers:[],blocks:[]});return this.dispatch(Za(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(qh(e)),await this.enqueueRequest({description:"Update project",method:h.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),c=Uh(e)(a);if(!c)throw new Error("Expected project to exist");const n=wh(a).filter(m=>m.project===e);this.dispatch(Ih(n.map(({uuid:m})=>m)));const r=Sh(c.uuid)(a);this.dispatch(Ha(r.map(({uuid:m})=>m)));const l=rh(e)(a);this.dispatch(ch(l.map(({uuid:m})=>m))),this.dispatch(Ja(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:h.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Ja(c.uuid))}catch(m){throw this.dispatch(Za(c)),this.dispatch(ah(Object.values(l))),this.dispatch(Fh(n)),this.dispatch(hh(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:h.GET,url:"/projects/",queryParams:{organization_owner:e},blockers:[],blocks:[]},i);return this.dispatch(jh(a)),a}}class gP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Bh(a));const c=this.enqueueRequest({description:"Create team membership",method:h.POST,url:"/team-memberships/",payload:w(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ec(r))}).catch(()=>{this.dispatch(tc(a.uuid))}),[a,c]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Lh(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(tc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:h.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ec(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:h.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(kh(a)),a}}class bP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Wh(a));const c=this.enqueueRequest({description:"Create team",method:h.POST,url:"/teams/",payload:w(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ac(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=nc(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Yh(c));const n=this.enqueueRequest({description:"Update team",method:h.PATCH,url:`/teams/${e.uuid}/`,payload:w(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=nc(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(ac(e));try{return await this.enqueueRequest({description:"Delete team",method:h.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ut(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:h.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hh(a)),a}}class PP extends v{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:h.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(jl(a)),a}}class FP{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,c){return this._enqueueRequest(e,i,a,c).then(n=>{if(n instanceof D)throw n;return n})}_enqueueRequest(e,i,a,c){const n=new bc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const l={...r,uuid:e.uuid??Ne.v4()},m={payload:l,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:l,BASE_URL:i,serviceName:a}}}};uc(m,this,c).then(u=>{n.resolve(u.body)}).catch(u=>{oc(u,m),u instanceof Error?n.reject(u):n.reject(new Error((u??Ye).toString()))})}else{const l=this.store.dispatch(Ql(r)),m=o=>{if(o)n.resolve(o.body);else{const p=new D({message:"Could not get a response from the server.",response:o,discard:!0});n.reject(p)}},u=o=>{o instanceof D?o.options.discard=!0:(console.error("Received an unexpected error while processing a request:",o,`
|
|
15
|
-
Converting error to APIError and discarding.`),o=new D({message:"An error occurred while processing the request.",innerError:o,discard:!0})),n.reject(o)};l.then(m,u)}return n}}class Ke{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Pm.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new Ke;for(let a=0;a<e.length;a++){const c=e[a];if(!c){console.error("Outbox item was undefined");continue}i.sneakRequest(c);for(let n=0;n<a;n++){const r=e[n];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==c.payload.uuid&&r.payload.blocks.some(l=>c.payload.blockers.includes(l))&&Ke._addDependency(c.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){Ke._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i);e.payload.blockers.some(c=>a.payload.blocks.includes(c))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(c=>e.payload.blocks.includes(c))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const c of e){const n=this.requestAttemptCounter[c]||0;n<i&&(i=n,a=c)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),c=e.findIndex(n=>n.payload.uuid===a.payload.uuid);c!==-1&&(e.splice(c,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const c=this.requestAttemptCounter[i.payload.uuid]||0,n=this.requestAttemptCounter[a.payload.uuid]||0;return c-n}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}const TP=(t,e)=>{const i=new e(t);return Yg(i),Wg(t),i};var hm=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(hm||{});s.APIError=D,s.AgentService=pb,s.AssetAttachmentService=yb,s.AssetProcedureAttachmentService=Sb,s.AssetProcedureFieldValuesAttachmentService=Pb,s.AssetProcedureFieldValuesService=Fb,s.AssetProcedureFieldsAttachmentService=gb,s.AssetProcedureFieldsService=bb,s.AssetProcedureInstanceService=Tb,s.AssetProcedureService=Ib,s.AssetProcedureStepFieldValuesAttachmentService=Rb,s.AssetProcedureStepFieldValuesService=vb,s.AssetProcedureStepFieldsAttachmentService=Ob,s.AssetProcedureStepFieldsService=_b,s.AssetProcedureStepService=wb,s.AssetService=Mb,s.AssetStageCompletionService=Eb,s.AssetStageService=jb,s.AssetTypeAttachmentService=qb,s.AssetTypeFieldValuesAttachmentService=Ub,s.AssetTypeFieldValuesService=Db,s.AssetTypeFieldsAttachmentService=Vb,s.AssetTypeFieldsService=zb,s.AssetTypeService=Cb,s.AttachmentModel=Sc,s.BaseApiService=v,s.BaseSDK=FP,s.COMMON_AUTO_FIELDS=Oc,s.CategoryService=kb,s.DEFAULT_ISSUE_PRIORITY=Tm,s.DEFAULT_ISSUE_STATUS=Fm,s.DEFAULT_PAGINATION_PAGE_SIZE=E,s.DeferredPromise=bc,s.DocumentAttachmentService=Bb,s.DocumentService=Gb,s.EMPTY_ARRAY=Ac,s.EMPTY_OBJECT=fc,s.EmailDomainsService=$b,s.EmailVerificationService=Lb,s.FileService=Hb,s.FormRevisionAttachmentService=Wb,s.FormRevisionService=Yb,s.FormService=Kb,s.FormSubmissionAttachmentService=Zb,s.FormSubmissionService=Jb,s.GeoImageService=Xb,s.HttpMethod=h,s.IssueAssociationService=Qb,s.IssueAttachmentService=xb,s.IssueCommentAttachmentService=eP,s.IssueCommentService=tP,s.IssuePriority=$t,s.IssueService=sP,s.IssueStatus=Lt,s.IssueTypeAttachmentService=iP,s.IssueTypeFieldValuesAttachmentService=nP,s.IssueTypeFieldValuesService=rP,s.IssueTypeFieldsAttachmentService=aP,s.IssueTypeFieldsService=cP,s.IssueTypeService=dP,s.IssueUpdateChange=j,s.IssueUpdateService=uP,s.JWTService=hP,s.OUTBOX_RETRY_DELAY=gc,s.OrganizationAccessLevel=yc,s.OrganizationAccessService=mP,s.OrganizationService=pP,s.OutboxCoordinator=Ke,s.PAGINATION_MAX_PAGE_SIZE=Ab,s.PAGINATION_PAGE_SIZE_QUERY_PARAM=fb,s.ProjectAccessService=AP,s.ProjectAttachmentService=fP,s.ProjectFileService=yP,s.ProjectService=SP,s.RESET_ORGANIZATION_STATE=O,s.RESET_PROJECT_STATE=M,s.RESET_STATE=F,s.SelectorBuilder=Hg,s.TeamMembershipService=gP,s.TeamService=bP,s.UNKNOWN_ERROR_MESSAGE=Ye,s.UserService=PP,s.VERSION_REDUCER_KEY=Ze,s.VerificationCodeType=hm,s._setLatestRetryTime=eh,s.addAsset=ks,s.addAssetAttachment=ep,s.addAssetAttachments=Qt,s.addAssetProcedure=Ss,s.addAssetProcedureAttachment=ip,s.addAssetProcedureAttachments=Hc,s.addAssetProcedureFieldValues=rs,s.addAssetProcedureFieldValuesAttachment=Fp,s.addAssetProcedureFieldValuesAttachments=mt,s.addAssetProcedureFieldValuesMany=On,s.addAssetProcedureFields=ln,s.addAssetProcedureFieldsAttachment=rp,s.addAssetProcedureFieldsAttachments=sn,s.addAssetProcedureFieldsMany=pp,s.addAssetProcedureInstance=hs,s.addAssetProcedureInstances=jn,s.addAssetProcedureStep=zs,s.addAssetProcedureStepFieldValues=Es,s.addAssetProcedureStepFieldValuesAttachment=nA,s.addAssetProcedureStepFieldValuesAttachments=At,s.addAssetProcedureStepFieldValuesMany=nr,s.addAssetProcedureStepFields=Is,s.addAssetProcedureStepFieldsAttachment=Np,s.addAssetProcedureStepFieldsAttachments=$n,s.addAssetProcedureStepFieldsMany=Xp,s.addAssetProcedureSteps=SA,s.addAssetProcedures=Dp,s.addAssetStage=Qs,s.addAssetStageCompletion=Ws,s.addAssetStageCompletions=Ys,s.addAssetStages=jA,s.addAssetType=pi,s.addAssetTypeAttachment=CA,s.addAssetTypeAttachments=si,s.addAssetTypeFieldValues=ui,s.addAssetTypeFieldValuesAttachment=sf,s.addAssetTypeFieldValuesAttachments=It,s.addAssetTypeFieldValuesMany=md,s.addAssetTypeFields=xr,s.addAssetTypeFieldsAttachment=GA,s.addAssetTypeFieldsAttachments=Hr,s.addAssetTypeFieldsMany=KA,s.addAssetTypes=Af,s.addAssets=bt,s.addCategories=If,s.addCategory=gi,s.addConversation=Mc,s.addConversations=Ym,s.addDocumentAttachment=Ef,s.addDocumentAttachments=qd,s.addDocuments=Nd,s.addEmailDomain=Zd,s.addEmailDomains=Cf,s.addForm=zi,s.addFormRevision=Mi,s.addFormRevisionAttachment=Wf,s.addFormRevisionAttachments=ru,s.addFormRevisions=pu,s.addFormSubmission=Bi,s.addFormSubmissionAttachment=oy,s.addFormSubmissionAttachments=vt,s.addFormSubmissions=Et,s.addForms=iy,s.addGeoImage=$u,s.addGeoImages=Lu,s.addIssue=la,s.addIssueAssociation=Zi,s.addIssueAssociations=Ji,s.addIssueAttachment=Ty,s.addIssueAttachments=ta,s.addIssueComment=na,s.addIssueCommentAttachment=_y,s.addIssueCommentAttachments=po,s.addIssueComments=Ey,s.addIssueType=yl,s.addIssueTypeAttachment=Gy,s.addIssueTypeAttachments=Vo,s.addIssueTypeFieldValues=ba,s.addIssueTypeFieldValuesAttachment=mS,s.addIssueTypeFieldValuesAttachments=zt,s.addIssueTypeFieldValuesMany=Qy,s.addIssueTypeFields=il,s.addIssueTypeFieldsAttachment=Hy,s.addIssueTypeFieldsAttachments=Ho,s.addIssueTypeFieldsMany=aS,s.addIssueTypes=gS,s.addIssueUpdate=Tl,s.addIssueUpdates=Il,s.addIssues=wo,s.addOrganization=Wl,s.addOrganizationAccess=Bl,s.addOrganizationAccesses=kS,s.addOrganizations=KS,s.addProject=Za,s.addProjectAccess=Ba,s.addProjectAccesses=ah,s.addProjectAttachment=dg,s.addProjectAttachments=oh,s.addProjectFile=hg,s.addProjectFiles=Fh,s.addProjects=bg,s.addTeam=Wh,s.addTeamMembership=Bh,s.addTeamMemberships=vg,s.addTeams=zg,s.addUser=ql,s.addUsers=jS,s.agentsReducer=qc,s.agentsSlice=Kt,s.areArraysEqual=wm,s.assetAttachmentReducer=$c,s.assetAttachmentSlice=Jt,s.assetProcedureAttachmentReducer=Jc,s.assetProcedureAttachmentSlice=es,s.assetProcedureFieldValuesAttachmentReducer=Fn,s.assetProcedureFieldValuesAttachmentSlice=as,s.assetProcedureFieldValuesReducer=vn,s.assetProcedureFieldValuesSlice=ns,s.assetProcedureFieldsAttachmentReducer=dn,s.assetProcedureFieldsAttachmentSlice=ts,s.assetProcedureFieldsReducer=An,s.assetProcedureFieldsSlice=ss,s.assetProcedureInstanceReducer=Vn,s.assetProcedureInstanceSlice=ls,s.assetProcedureReducer=Cn,s.assetProcedureSlice=ys,s.assetProcedureStepFieldValuesAttachmentReducer=ir,s.assetProcedureStepFieldValuesAttachmentSlice=vs,s.assetProcedureStepFieldValuesReducer=or,s.assetProcedureStepFieldValuesSlice=Ms,s.assetProcedureStepFieldsAttachmentReducer=Yn,s.assetProcedureStepFieldsAttachmentSlice=Fs,s.assetProcedureStepFieldsReducer=Jn,s.assetProcedureStepFieldsSlice=Ts,s.assetProcedureStepReducer=pr,s.assetProcedureStepSlice=Vs,s.assetReducer=br,s.assetSlice=Cs,s.assetStageCompletionReducer=Or,s.assetStageCompletionSlice=Hs,s.assetStageReducer=Er,s.assetStageSlice=Xs,s.assetTypeAttachmentReducer=$r,s.assetTypeAttachmentSlice=ti,s.assetTypeFieldValuesAttachmentReducer=od,s.assetTypeFieldValuesAttachmentSlice=ni,s.assetTypeFieldValuesReducer=yd,s.assetTypeFieldValuesSlice=di,s.assetTypeFieldsAttachmentReducer=Jr,s.assetTypeFieldsAttachmentSlice=ai,s.assetTypeFieldsReducer=id,s.assetTypeFieldsSlice=ci,s.assetTypeReducer=Pd,s.assetTypeSlice=mi,s.authReducer=Id,s.authSlice=_t,s.baseReducer=$g,s.baseReducers=rc,s.blobToBase64=Cm,s.categoryReducer=Md,s.categorySlice=Si,s.clearTokens=Pf,s.constructUploadedFilePayloads=Dm,s.coordinatesAreEqual=Rm,s.createModelAdapter=I,s.createMultiPointGeometry=_m,s.createOfflineAction=Jl,s.createPayload=w,s.createPointGeometry=Om,s.createSelectionAdapter=Im,s.deleteAsset=Bs,s.deleteAssetAttachment=Dc,s.deleteAssetAttachments=xt,s.deleteAssetProcedure=gs,s.deleteAssetProcedureAttachment=Kc,s.deleteAssetProcedureAttachments=Zc,s.deleteAssetProcedureFieldValues=ds,s.deleteAssetProcedureFieldValuesAttachment=_p,s.deleteAssetProcedureFieldValuesAttachments=pt,s.deleteAssetProcedureFieldValuesMany=Rn,s.deleteAssetProcedureFields=mn,s.deleteAssetProcedureFieldsAttachment=lp,s.deleteAssetProcedureFieldsAttachments=cn,s.deleteAssetProcedureFieldsMany=Sp,s.deleteAssetProcedureInstance=ms,s.deleteAssetProcedureInstances=qn,s.deleteAssetProcedureStep=Us,s.deleteAssetProcedureStepFieldValues=js,s.deleteAssetProcedureStepFieldValuesAttachment=oA,s.deleteAssetProcedureStepFieldValuesAttachments=ft,s.deleteAssetProcedureStepFieldValuesMany=dr,s.deleteAssetProcedureStepFields=Os,s.deleteAssetProcedureStepFieldsAttachment=Kp,s.deleteAssetProcedureStepFieldsAttachments=Nn,s.deleteAssetProcedureStepFieldsMany=tA,s.deleteAssetProcedureSteps=bA,s.deleteAssetProcedures=kp,s.deleteAssetStage=xs,s.deleteAssetStageCompletion=Ks,s.deleteAssetStageCompletions=Zs,s.deleteAssetStages=VA,s.deleteAssetType=Ai,s.deleteAssetTypeAttachment=Dr,s.deleteAssetTypeAttachments=ii,s.deleteAssetTypeFieldValues=oi,s.deleteAssetTypeFieldValuesAttachment=rf,s.deleteAssetTypeFieldValuesAttachments=Ot,s.deleteAssetTypeFieldValuesMany=Ad,s.deleteAssetTypeFields=td,s.deleteAssetTypeFieldsAttachment=HA,s.deleteAssetTypeFieldsAttachments=Yr,s.deleteAssetTypeFieldsMany=QA,s.deleteAssetTypes=yf,s.deleteAssets=Gs,s.deleteCategories=vf,s.deleteCategory=vd,s.deleteConversation=Jm,s.deleteConversations=Xm,s.deleteDocumentAttachment=Ud,s.deleteDocumentAttachments=Dd,s.deleteEmailDomain=Jd,s.deleteEmailDomains=Lf,s.deleteForm=Ui,s.deleteFormRevision=Ei,s.deleteFormRevisionAttachment=Jf,s.deleteFormRevisionAttachments=uu,s.deleteFormRevisions=fu,s.deleteFormSubmission=Gi,s.deleteFormSubmissionAttachment=py,s.deleteFormSubmissionAttachments=wt,s.deleteFormSubmissions=jt,s.deleteForms=dy,s.deleteGeoImage=Wi,s.deleteGeoImages=Hu,s.deleteIssue=ha,s.deleteIssueAssociation=Xi,s.deleteIssueAssociations=Qi,s.deleteIssueAttachment=no,s.deleteIssueAttachments=sa,s.deleteIssueComment=da,s.deleteIssueCommentAttachment=yo,s.deleteIssueCommentAttachments=So,s.deleteIssueComments=Vy,s.deleteIssueType=FS,s.deleteIssueTypeAttachment=Do,s.deleteIssueTypeAttachments=Co,s.deleteIssueTypeFieldValues=Pa,s.deleteIssueTypeFieldValuesAttachment=yS,s.deleteIssueTypeFieldValuesAttachments=Ut,s.deleteIssueTypeFieldValuesMany=sS,s.deleteIssueTypeFields=cl,s.deleteIssueTypeFieldsAttachment=Zy,s.deleteIssueTypeFieldsAttachments=Yo,s.deleteIssueTypeFieldsMany=dS,s.deleteIssueTypes=TS,s.deleteIssueUpdate=Ol,s.deleteIssueUpdates=_l,s.deleteIssues=Mo,s.deleteOrganization=JS,s.deleteOrganizationAccess=Gl,s.deleteOrganizationAccesses=LS,s.deleteOrganizations=XS,s.deleteProject=Ja,s.deleteProjectAccess=Ga,s.deleteProjectAccesses=ch,s.deleteProjectAttachment=ph,s.deleteProjectAttachments=Ha,s.deleteProjectFile=Th,s.deleteProjectFiles=Ih,s.deleteProjects=Fg,s.deleteTeam=ac,s.deleteTeamMembership=tc,s.deleteTeamMemberships=jg,s.deleteTeams=Cg,s.deleteUser=Vl,s.deleteUsers=zS,s.dequeue=dm,s.discard=oc,s.documentAttachmentReducer=Gd,s.documentAttachmentSlice=Fi,s.documentSlice=Ti,s.documentsReducer=Wd,s.downloadFile=km,s.downloadInMemoryFile=Um,s.emailDomainsReducer=xd,s.emailDomainsSlice=_i,s.emailRegex=Wm,s.enqueue=rm,s.enqueueRequest=Ql,s.fallbackToEmptyArray=g,s.fallbackToEmptyObject=ht,s.fileReducer=au,s.fileSlice=Ri,s.fileToBlob=Tc,s.formReducer=Pu,s.formRevisionAttachmentReducer=lu,s.formRevisionAttachmentSlice=vi,s.formRevisionReducer=Su,s.formRevisionsSlice=wi,s.formSlice=Vi,s.formSubmissionAttachmentReducer=Eu,s.formSubmissionAttachmentSlice=Di,s.formSubmissionReducer=Cu,s.formSubmissionSlice=ki,s.geoImageReducer=Ku,s.geoImageSlice=Hi,s.getFileIdentifier=zm,s.getFileS3Key=Yt,s.getLocalDateString=Pc,s.getLocalRelativeDateString=qm,s.getOutboxCoordinator=Ge,s.getRenamedFile=Fc,s.hashFile=He,s.initSDK=TP,s.initializeAssetAttachments=Xt,s.initializeAssetProcedureAttachments=Nc,s.initializeAssetProcedureFieldValues=In,s.initializeAssetProcedureFieldValuesAttachments=yn,s.initializeAssetProcedureFields=on,s.initializeAssetProcedureFieldsAttachments=tn,s.initializeAssetProcedureInstances=En,s.initializeAssetProcedureStepFieldValues=cr,s.initializeAssetProcedureStepFieldValuesAttachments=Qn,s.initializeAssetProcedureStepFields=Zn,s.initializeAssetProcedureStepFieldsAttachments=Gn,s.initializeAssetProcedureSteps=hr,s.initializeAssetProcedures=Dn,s.initializeAssetStageCompletions=Fr,s.initializeAssetStages=wr,s.initializeAssetTypeAttachments=Vr,s.initializeAssetTypeFieldValues=hd,s.initializeAssetTypeFieldValuesAttachments=cd,s.initializeAssetTypeFields=Qr,s.initializeAssetTypeFieldsAttachments=Nr,s.initializeAssetTypes=gd,s.initializeAssets=yr,s.initializeCategories=_d,s.initializeConversations=wc,s.initializeDocumentAttachments=jd,s.initializeEmailDomains=Kd,s.initializeFormRevisionAttachments=nu,s.initializeFormRevisions=mu,s.initializeFormSubmissionAttachments=_u,s.initializeFormSubmissions=qu,s.initializeForms=bu,s.initializeGeoImages=Bu,s.initializeIssueAssociations=Ju,s.initializeIssueAttachments=ea,s.initializeIssueCommentAttachments=aa,s.initializeIssueComments=My,s.initializeIssueTypeAttachments=ya,s.initializeIssueTypeFieldValues=Qo,s.initializeIssueTypeFieldValuesAttachments=ul,s.initializeIssueTypeFields=sl,s.initializeIssueTypeFieldsAttachments=No,s.initializeIssueTypes=fl,s.initializeIssueUpdates=Fl,s.initializeIssues=vo,s.initializeOrganizationAccesses=kl,s.initializeOrganizations=Hl,s.initializeProjectAccesses=ih,s.initializeProjectAttachments=uh,s.initializeProjectFiles=Ph,s.initializeProjects=jh,s.initializeTeamMemberships=kh,s.initializeTeams=Hh,s.initializeUsers=jl,s.isToday=jm,s.issueAssociationReducer=so,s.issueAssociationSlice=Ki,s.issueAttachmentReducer=ho,s.issueAttachmentSlice=xi,s.issueCommentAttachmentReducer=Fo,s.issueCommentAttachmentSlice=ia,s.issueCommentReducer=_o,s.issueCommentSlice=ca,s.issueReducer=jo,s.issueSlice=oa,s.issueTypeAttachmentReducer=$o,s.issueTypeAttachmentSlice=fa,s.issueTypeFieldValuesAttachmentReducer=pl,s.issueTypeFieldValuesAttachmentSlice=Oa,s.issueTypeFieldValuesReducer=el,s.issueTypeFieldValuesSlice=ga,s.issueTypeFieldsAttachmentReducer=Jo,s.issueTypeFieldsAttachmentSlice=Sa,s.issueTypeFieldsReducer=rl,s.issueTypeFieldsSlice=Ia,s.issueTypeReducer=bl,s.issueTypeSlice=Ra,s.issueUpdateReducer=Ml,s.issueUpdateSlice=Ea,s.logOnlyOnce=Bm,s.markAsDeleted=xl,s.markForDeletion=sg,s.memoize=Ht,s.offline=T,s.onlyUniqueHashes=Hm,s.onlyUniqueOfflineIds=Rc,s.organizationAccessReducer=$l,s.organizationAccessSlice=Va,s.organizationReducer=Zl,s.organizationSlice=Da,s.outboxReducer=th,s.outboxSlice=Ca,s.overmapEnhancer=sb,s.overmapReducer=Lg,s.overmapReducers=Qh,s.performRequest=uc,s.projectAccessReducer=nh,s.projectAccessSlice=ka,s.projectAttachmentReducer=gh,s.projectAttachmentSlice=Na,s.projectFileReducer=Mh,s.projectFileSlice=Wa,s.projectReducer=Vh,s.projectSlice=Ka,s.rehydratedReducer=Dh,s.rehydratedSlice=Qa,s.removeDocuments=Ii,s.removeIssueType=va,s.resetProjectFileObjectUrls=pg,s.restructureCreateSelectorWithArgs=y,s.saveActiveProjectFileBounds=Rh,s.selectAccessToken=Ff,s.selectAccessesByUserOfProject=ng,s.selectAccessibleProjects=Tg,s.selectActiveOrganizationAccess=NS,s.selectActiveProjectFileId=fg,s.selectAllDocumentAttachments=kd,s.selectAllProjectAttachments=fh,s.selectAssetAttachmentById=Bc,s.selectAssetAttachmentMapping=Cc,s.selectAssetAttachments=kc,s.selectAssetById=Ns,s.selectAssetProcedureAttachmentById=xc,s.selectAssetProcedureAttachmentMapping=Xc,s.selectAssetProcedureAttachments=Qc,s.selectAssetProcedureById=Ps,s.selectAssetProcedureFieldValues=us,s.selectAssetProcedureFieldValuesAttachmentById=Rp,s.selectAssetProcedureFieldValuesAttachments=gn,s.selectAssetProcedureFieldValuesAttachmentsByIds=bn,s.selectAssetProcedureFieldValuesAttachmentsMapping=cs,s.selectAssetProcedureFieldValuesById=os,s.selectAssetProcedureFieldValuesMapping=wn,s.selectAssetProcedureFieldValuesOfAsset=Mp,s.selectAssetProcedureFields=is,s.selectAssetProcedureFieldsAttachmentById=mp,s.selectAssetProcedureFieldsAttachments=rn,s.selectAssetProcedureFieldsAttachmentsMapping=nn,s.selectAssetProcedureFieldsById=Pp,s.selectAssetProcedureFieldsMapping=pn,s.selectAssetProcedureFieldsOfAssetProcedure=gp,s.selectAssetProcedureInstanceById=fs,s.selectAssetProcedureInstances=As,s.selectAssetProcedureInstancesByIds=Up,s.selectAssetProcedureInstancesMapping=ps,s.selectAssetProcedureInstancesOfAssetProcedure=zn,s.selectAssetProcedureInstancesOfAssetType=zp,s.selectAssetProcedureStepById=Ds,s.selectAssetProcedureStepFieldValues=yt,s.selectAssetProcedureStepFieldValuesAttachmentById=lA,s.selectAssetProcedureStepFieldValuesAttachments=er,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=tr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=ws,s.selectAssetProcedureStepFieldValuesById=qs,s.selectAssetProcedureStepFieldValuesMapping=ur,s.selectAssetProcedureStepFieldValuesOfAsset=pA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=AA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=fA,s.selectAssetProcedureStepFields=Rs,s.selectAssetProcedureStepFieldsAttachmentById=Jp,s.selectAssetProcedureStepFieldsAttachments=Wn,s.selectAssetProcedureStepFieldsAttachmentsMapping=Hn,s.selectAssetProcedureStepFieldsById=cA,s.selectAssetProcedureStepFieldsMapping=_s,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=sA,s.selectAssetProcedureStepMapping=gt,s.selectAssetProcedureSteps=Ar,s.selectAssetProcedureStepsByIds=TA,s.selectAssetProcedureStepsMappingOfAssetProcedure=PA,s.selectAssetProcedureStepsOfAssetProcedure=FA,s.selectAssetProcedures=kn,s.selectAssetProceduresByIds=$p,s.selectAssetProceduresMapping=bs,s.selectAssetProceduresOfOrganization=Lp,s.selectAssetStageById=ei,s.selectAssetStageCompletionById=_r,s.selectAssetStageCompletionMapping=Js,s.selectAssetStageCompletions=MA,s.selectAssetStageCompletionsByIds=Rr,s.selectAssetStages=jr,s.selectAssetStagesByIds=DA,s.selectAssetStagesMappingOfAssetProcedure=zA,s.selectAssetStagesOfAssetProcedure=UA,s.selectAssetTypeAttachmentById=Br,s.selectAssetTypeAttachmentMapping=Cr,s.selectAssetTypeAttachments=kr,s.selectAssetTypeById=yi,s.selectAssetTypeFieldValues=li,s.selectAssetTypeFieldValuesAttachmentById=df,s.selectAssetTypeFieldValuesAttachments=rd,s.selectAssetTypeFieldValuesAttachmentsByIds=dd,s.selectAssetTypeFieldValuesAttachmentsMapping=ri,s.selectAssetTypeFieldValuesById=hi,s.selectAssetTypeFieldValuesMapping=fd,s.selectAssetTypeFieldValuesOfAsset=lf,s.selectAssetTypeFields=Tt,s.selectAssetTypeFieldsAttachmentById=YA,s.selectAssetTypeFieldsAttachments=Zr,s.selectAssetTypeFieldsAttachmentsMapping=Kr,s.selectAssetTypeFieldsById=tf,s.selectAssetTypeFieldsMapping=sd,s.selectAssetTypeFieldsOfAssetType=xA,s.selectAssetTypeValuesOfAssetType=hf,s.selectAssetTypes=bd,s.selectAssetTypesByIds=Sf,s.selectAssetTypesMapping=fi,s.selectAssetTypesOfOrganization=gf,s.selectAssets=Sr,s.selectAssetsByIds=gr,s.selectAssetsMapping=$s,s.selectAssetsOfAssetType=Ls,s.selectAttachmentsOfAsset=Gc,s.selectAttachmentsOfAssetProcedure=np,s.selectAttachmentsOfAssetProcedureFieldValues=Pn,s.selectAttachmentsOfAssetProcedureFields=hp,s.selectAttachmentsOfAssetProcedureStepFieldValues=sr,s.selectAttachmentsOfAssetProcedureStepFields=Zp,s.selectAttachmentsOfAssetType=Gr,s.selectAttachmentsOfAssetTypeFieldValues=ud,s.selectAttachmentsOfAssetTypeFields=WA,s.selectAttachmentsOfDocument=Vf,s.selectAttachmentsOfFormRevision=Xf,s.selectAttachmentsOfFormSubmission=Mu,s.selectAttachmentsOfIssue=oo,s.selectAttachmentsOfIssueComment=wy,s.selectAttachmentsOfIssueType=Ny,s.selectAttachmentsOfIssueTypeFieldValues=ml,s.selectAttachmentsOfIssueTypeFields=Jy,s.selectAttachmentsOfProject=Sh,s.selectCategories=wd,s.selectCategoriesByIds=wf,s.selectCategoriesOfProject=Mf,s.selectCategoryById=Pi,s.selectCategoryMapping=bi,s.selectCommentsOfIssue=zy,s.selectConversation=xm,s.selectConversationMapping=Zt,s.selectConversations=Qm,s.selectCurrentUser=Ul,s.selectDeletedRequests=eg,s.selectDocumentAttachmentById=Bd,s.selectDocumentAttachmentMapping=Cd,s.selectDocumentById=Hd,s.selectDocuments=Oi,s.selectDocumentsByIds=zf,s.selectDocumentsMapping=Rt,s.selectEmailDomains=Qd,s.selectEmailDomainsAsMapping=Xd,s.selectEmailDomainsOfOrganization=Nf,s.selectFieldValuesOfAssetProcedureInstance=Ep,s.selectFormById=Iu,s.selectFormMapping=Fu,s.selectFormRevisionAttachmentsMapping=ou,s.selectFormRevisionById=ty,s.selectFormRevisionMapping=ji,s.selectFormRevisions=qi,s.selectFormRevisionsOfForm=yu,s.selectFormSubmissionAttachemntsByIds=wu,s.selectFormSubmissionAttachments=Ci,s.selectFormSubmissionAttachmentsMapping=vu,s.selectFormSubmissionById=Ni,s.selectFormSubmissions=Li,s.selectFormSubmissionsMapping=$i,s.selectFormSubmissionsOfAsset=Du,s.selectFormSubmissionsOfForm=zu,s.selectFormSubmissionsOfIssue=Uu,s.selectForms=Tu,s.selectFormsOfOrganization=uy,s.selectGeoImageById=Yi,s.selectGeoImageMapping=Wu,s.selectGeoImages=Yu,s.selectGeoImagesOfProject=Sy,s.selectIsImportingProjectFile=yg,s.selectIsLoggedIn=Tf,s.selectIssueAssociationById=Qu,s.selectIssueAssociationMapping=ct,s.selectIssueAssociations=Fy,s.selectIssueAssociationsOfAsset=to,s.selectIssueAssociationsOfIssue=eo,s.selectIssueAssociationsToIssue=xu,s.selectIssueAttachmentById=lo,s.selectIssueAttachmentMapping=ro,s.selectIssueAttachments=uo,s.selectIssueById=Aa,s.selectIssueCommentAttachmentById=Po,s.selectIssueCommentAttachmentMapping=go,s.selectIssueCommentAttachments=bo,s.selectIssueCommentById=ua,s.selectIssueCommentMapping=Oo,s.selectIssueMapping=ma,s.selectIssueTypeAttachmentById=Go,s.selectIssueTypeAttachmentMapping=ko,s.selectIssueTypeAttachments=Bo,s.selectIssueTypeById=Ma,s.selectIssueTypeFieldValues=Fa,s.selectIssueTypeFieldValuesAttachmentById=SS,s.selectIssueTypeFieldValuesAttachments=_a,s.selectIssueTypeFieldValuesAttachmentsByIds=hl,s.selectIssueTypeFieldValuesAttachmentsMapping=ll,s.selectIssueTypeFieldValuesById=Ta,s.selectIssueTypeFieldValuesMapping=xo,s.selectIssueTypeFieldValuesOfIssue=iS,s.selectIssueTypeFields=Vt,s.selectIssueTypeFieldsAttachmentById=Xy,s.selectIssueTypeFieldsAttachments=Zo,s.selectIssueTypeFieldsAttachmentsMapping=Ko,s.selectIssueTypeFieldsById=hS,s.selectIssueTypeFieldsMapping=nl,s.selectIssueTypeFieldsOfIssueType=uS,s.selectIssueTypeMapping=wa,s.selectIssueTypeValuesOfIssueType=lS,s.selectIssueTypes=gl,s.selectIssueTypesByIds=IS,s.selectIssueTypesOfOrganization=OS,s.selectIssueUpdateMapping=Rl,s.selectIssueUpdates=vl,s.selectIssueUpdatesOfIssue=wl,s.selectIssues=pa,s.selectIssuesByIds=ky,s.selectIssuesOfIssueType=Eo,s.selectIssuesOfProject=By,s.selectLatestAssetProcedureFieldsOfAssetProcedure=bp,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=iA,s.selectLatestAssetTypeFieldsOfAssetType=ef,s.selectLatestFieldsByAssetProcedureStep=aA,s.selectLatestFormRevisionOfForm=sy,s.selectLatestIssueTypeFieldsOfIssueType=oS,s.selectLatestRetryTime=tg,s.selectMembershipsByUserOfTeam=qg,s.selectNumberOfAssetsOfAssetType=RA,s.selectOrganizationAccessById=Ua,s.selectOrganizationAccessMapping=za,s.selectOrganizationAccessUserMapping=Ll,s.selectOrganizationById=xS,s.selectOrganizationDocuments=Df,s.selectOrganizations=QS,s.selectOrganizationsMapping=Kl,s.selectProjectAccessById=La,s.selectProjectAccessMapping=$a,s.selectProjectAccesses=kt,s.selectProjectAccessesOfProject=rh,s.selectProjectAttachmentById=yh,s.selectProjectAttachmentMapping=Ah,s.selectProjectById=Uh,s.selectProjectDocuments=Uf,s.selectProjectFileById=Ag,s.selectProjectFileMapping=vh,s.selectProjectFiles=wh,s.selectProjectMapping=zh,s.selectProjects=Xa,s.selectProjectsOfOrganization=Ig,s.selectRehydrated=Rg,s.selectStageMapping=Ft,s.selectTeamById=nc,s.selectTeamMembershipById=Lh,s.selectTeamMemberships=sc,s.selectTeamMembershipsMapping=$h,s.selectTeams=Kh,s.selectTeamsByIds=kg,s.selectTeamsMapping=cc,s.selectTeamsOfOrganization=Bg,s.selectUploadUrl=iu,s.selectUserById=Dl,s.selectUsers=qa,s.selectUsersByIds=CS,s.selectUsersMapping=Dt,s.selectUsersOfOrganization=HS,s.selectUsersOfProject=rg,s.selectUsersOfTeam=Vg,s.setActiveProjectFileId=_h,s.setAsset=OA,s.setAssetAttachment=zc,s.setAssetAttachments=tp,s.setAssetProcedure=Bp,s.setAssetProcedureAttachment=Wc,s.setAssetProcedureAttachments=ap,s.setAssetProcedureFieldValues=vp,s.setAssetProcedureFieldValuesAttachment=Tp,s.setAssetProcedureFieldValuesAttachments=Ip,s.setAssetProcedureFieldValuesMany=wp,s.setAssetProcedureFields=Ap,s.setAssetProcedureFieldsAttachment=dp,s.setAssetProcedureFieldsAttachments=up,s.setAssetProcedureFieldsMany=fp,s.setAssetProcedureInstance=qp,s.setAssetProcedureInstances=Vp,s.setAssetProcedureStep=mr,s.setAssetProcedureStepFieldValues=hA,s.setAssetProcedureStepFieldValuesAttachment=rA,s.setAssetProcedureStepFieldValuesAttachments=dA,s.setAssetProcedureStepFieldValuesMany=mA,s.setAssetProcedureStepFields=Qp,s.setAssetProcedureStepFieldsAttachment=Hp,s.setAssetProcedureStepFieldsAttachments=Wp,s.setAssetProcedureStepFieldsMany=xp,s.setAssetProcedureSteps=yA,s.setAssetProcedures=Gp,s.setAssetStage=Mr,s.setAssetStageCompletion=vA,s.setAssetStageCompletions=wA,s.setAssetStages=EA,s.setAssetType=mf,s.setAssetTypeAttachment=zr,s.setAssetTypeAttachments=kA,s.setAssetTypeFieldValues=uf,s.setAssetTypeFieldValuesAttachment=af,s.setAssetTypeFieldValuesAttachments=cf,s.setAssetTypeFieldValuesMany=of,s.setAssetTypeFields=ZA,s.setAssetTypeFieldsAttachment=$A,s.setAssetTypeFieldsAttachments=LA,s.setAssetTypeFieldsMany=JA,s.setAssetTypes=pf,s.setAssets=_A,s.setCategories=_f,s.setCategory=Of,s.setConversation=Ec,s.setConversations=Km,s.setCurrentUser=US,s.setDocumentAttachment=Vd,s.setDocumentAttachments=jf,s.setDocuments=Ld,s.setEmailDomain=kf,s.setEmailDomains=Bf,s.setForm=ay,s.setFormRevision=Au,s.setFormRevisionAttachment=Yf,s.setFormRevisionAttachments=Kf,s.setFormRevisions=Qf,s.setFormSubmission=Mt,s.setFormSubmissionAttachment=ly,s.setFormSubmissionAttachments=hy,s.setFormSubmissions=Ay,s.setForms=cy,s.setGeoImage=at,s.setGeoImages=Gu,s.setIsImportingProjectFile=Oh,s.setIssue=Uy,s.setIssueAssociation=by,s.setIssueAssociations=gy,s.setIssueAttachment=ao,s.setIssueAttachments=Iy,s.setIssueComment=ra,s.setIssueCommentAttachment=Ao,s.setIssueCommentAttachments=Ry,s.setIssueComments=Io,s.setIssueType=rt,s.setIssueTypeAttachment=zo,s.setIssueTypeAttachments=$y,s.setIssueTypeFieldValues=xy,s.setIssueTypeFieldValuesAttachment=pS,s.setIssueTypeFieldValuesAttachments=AS,s.setIssueTypeFieldValuesMany=eS,s.setIssueTypeFields=cS,s.setIssueTypeFieldsAttachment=Wy,s.setIssueTypeFieldsAttachments=Yy,s.setIssueTypeFieldsMany=nS,s.setIssueTypes=bS,s.setIssueUpdate=_S,s.setIssueUpdates=RS,s.setIssues=Dy,s.setLoggedIn=Td,s.setOrganization=YS,s.setOrganizationAccess=BS,s.setOrganizationAccesses=GS,s.setOrganizations=WS,s.setProfilePicture=DS,s.setProject=gg,s.setProjectAccess=ig,s.setProjectAccesses=ag,s.setProjectAttachment=lh,s.setProjectAttachments=hh,s.setProjectFile=og,s.setProjectFiles=lg,s.setProjects=Sg,s.setRehydrated=_g,s.setTeam=ut,s.setTeamMembership=ec,s.setTeamMemberships=wg,s.setTeams=Ug,s.setTokens=bf,s.setUploadUrl=su,s.setUser=ES,s.setUsers=MS,s.shallowEqual=vm,s.slugify=Lm,s.spacesToDashesLower=$m,s.teamMembershipReducer=Gh,s.teamMembershipSlice=xa,s.teamReducer=Zh,s.teamSlice=ic,s.toFileNameSafeString=Gm,s.toOfflineIdRecord=_c,s.truncate=Nm,s.updateAsset=tt,s.updateAssetAttachment=sp,s.updateAssetAttachments=Uc,s.updateAssetProcedure=Qe,s.updateAssetProcedureAttachment=cp,s.updateAssetProcedureAttachments=Yc,s.updateAssetProcedureFieldValues=Je,s.updateAssetProcedureFieldValuesAttachment=Op,s.updateAssetProcedureFieldValuesAttachments=Sn,s.updateAssetProcedureFieldValuesMany=_n,s.updateAssetProcedureFields=hn,s.updateAssetProcedureFieldsAttachment=op,s.updateAssetProcedureFieldsAttachments=an,s.updateAssetProcedureFieldsMany=yp,s.updateAssetProcedureInstance=Xe,s.updateAssetProcedureInstances=jp,s.updateAssetProcedureStep=St,s.updateAssetProcedureStepFieldValues=et,s.updateAssetProcedureStepFieldValuesAttachment=uA,s.updateAssetProcedureStepFieldValuesAttachments=xn,s.updateAssetProcedureStepFieldValuesMany=rr,s.updateAssetProcedureStepFields=xe,s.updateAssetProcedureStepFieldsAttachment=Yp,s.updateAssetProcedureStepFieldsAttachments=Ln,s.updateAssetProcedureStepFieldsMany=eA,s.updateAssetProcedureSteps=gA,s.updateAssetProcedures=Cp,s.updateAssetStage=Pt,s.updateAssetStageCompletion=Tr,s.updateAssetStageCompletions=Ir,s.updateAssetStages=qA,s.updateAssetType=it,s.updateAssetTypeAttachment=BA,s.updateAssetTypeAttachments=Ur,s.updateAssetTypeFieldValues=st,s.updateAssetTypeFieldValuesAttachment=nf,s.updateAssetTypeFieldValuesAttachments=nd,s.updateAssetTypeFieldValuesMany=pd,s.updateAssetTypeFields=ed,s.updateAssetTypeFieldsAttachment=NA,s.updateAssetTypeFieldsAttachments=Wr,s.updateAssetTypeFieldsMany=XA,s.updateAssetTypes=ff,s.updateAssets=IA,s.updateCategories=Rf,s.updateCategory=Rd,s.updateConversation=jc,s.updateConversations=Zm,s.updateDocumentAttachment=qf,s.updateDocumentAttachments=zd,s.updateDocuments=We,s.updateEmailDomain=Gf,s.updateEmailDomains=$f,s.updateForm=ny,s.updateFormRevision=xf,s.updateFormRevisionAttachment=Zf,s.updateFormRevisionAttachments=du,s.updateFormRevisions=ey,s.updateFormSubmission=Vu,s.updateFormSubmissionAttachment=my,s.updateFormSubmissionAttachments=Ru,s.updateFormSubmissions=fy,s.updateForms=ry,s.updateGeoImage=Nu,s.updateGeoImages=yy,s.updateIssue=qt,s.updateIssueAssociation=Xu,s.updateIssueAssociations=Py,s.updateIssueAttachment=Oy,s.updateIssueAttachments=co,s.updateIssueComment=jy,s.updateIssueCommentAttachment=vy,s.updateIssueCommentAttachments=fo,s.updateIssueComments=qy,s.updateIssueType=Sl,s.updateIssueTypeAttachment=Ly,s.updateIssueTypeAttachments=Uo,s.updateIssueTypeFieldValues=nt,s.updateIssueTypeFieldValuesAttachment=fS,s.updateIssueTypeFieldValuesAttachments=ol,s.updateIssueTypeFieldValuesMany=tS,s.updateIssueTypeFields=al,s.updateIssueTypeFieldsAttachment=Ky,s.updateIssueTypeFieldsAttachments=Wo,s.updateIssueTypeFieldsMany=rS,s.updateIssueTypes=PS,s.updateIssueUpdate=vS,s.updateIssueUpdates=wS,s.updateIssues=Cy,s.updateOrganization=Yl,s.updateOrganizationAccess=Ct,s.updateOrganizationAccesses=$S,s.updateOrganizations=ZS,s.updateProject=qh,s.updateProjectAccess=dt,s.updateProjectAccesses=cg,s.updateProjectAttachment=ug,s.updateProjectAttachments=mh,s.updateProjectFile=Ya,s.updateProjectFiles=mg,s.updateProjects=Pg,s.updateTeam=Yh,s.updateTeamMembership=Mg,s.updateTeamMemberships=Eg,s.updateTeams=Dg,s.updateUser=VS,s.updateUsers=qS,s.useSelectorBuilder=Ng,s.userReducer=zl,s.userSlice=ja,s.versioningReducer=Xh,s.versioningSlice=Jh,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
14
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(A)}const y=r.type.split("/")[1];if(!y)throw new Error("File has no extension");const f=a??h+"."+y;if(r=dc(r,f),!r.name)throw new Error("Failed to set file's name");await this.addCache(r,h),ls[c]=new Promise(A=>{A(r)})}return r}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await ft(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class hR extends k{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:ap,deleteOne:cp,deleteMany:rp,initialize:xm});p(this,"selectors",{selectById:lp,selectByIds:op})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.form],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class mR extends k{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:pp,addMany:yp,setOne:fp,setMany:Ap,updateOne:Sp,updateMany:Tp,deleteOne:wp,deleteMany:Op,initialize:mp});p(this,"selectors",{selectById:Fp,selectByIds:Pp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class pR extends k{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:Mp,addMany:Rp,setOne:kp,setMany:vp,updateOne:Ep,updateMany:Vp,deleteOne:Bp,deleteMany:zp,initialize:_p});p(this,"selectors",{selectById:qp,selectByIds:Cp})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{revisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,form_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.form_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class yR extends k{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:qi,addMany:Ci,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Hp,deleteOne:ji,deleteMany:$i,initialize:Dp});p(this,"selectors",{selectById:Gp,selectByIds:Kp})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class fR extends k{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:Qp,addMany:xp,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:ny,deleteMany:ay,initialize:Xp});p(this,"selectors",{selectById:dy,selectByIds:ly})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=_({...e,submitted_at:o,created_by:l}),h=_({...n,form:r.uuid,submitted_at:o,created_by:l});this.dispatch(c(r)),this.dispatch(qi(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...E(r),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[r.uuid,h.uuid]});return y.catch(A=>{throw this.dispatch(d(r.uuid)),this.dispatch(ji(h.uuid)),A}),[r,h,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error("Expected form to exist");const r=Vy(e)(o),h=Yp(e)(o);this.dispatch(a(e)),this.dispatch(Qi(z(r))),this.dispatch($i(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ci(h)),this.dispatch(Xi(r)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class AR extends k{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:hy,addMany:Hi,setOne:my,setMany:py,updateOne:yy,updateMany:fy,deleteOne:Ay,deleteMany:Gi,initialize:uy});p(this,"selectors",{selectById:Sy,selectByIds:Ty})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{submissionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_submission:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,form_submission:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.form_submission),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),o=Zi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class SR extends k{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:by,addMany:Xi,setOne:Py,setMany:gy,updateOne:_y,updateMany:My,deleteOne:Ry,deleteMany:Qi,initialize:Fy});p(this,"selectors",{selectById:vy,selectByIds:Ey})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=wy(e)(o);this.dispatch(a(e)),this.dispatch(Gi(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Hi(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(d)),d}}class TR extends k{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:jy,addMany:$y,setOne:qy,setMany:Cy,updateOne:Dy,updateMany:Uy,deleteOne:Ly,deleteMany:Ny,initialize:Wy});p(this,"selectors",{selectById:Gy,selectByIds:Ky})}async add(e){var P;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,{file:o,...l}=e,r=new Date().toISOString(),h=((P=n.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=l.project,f=await this.client.files.getFilePayload(o),A=_({...l,file_name:o.name,file_sha1:f.sha1,file_type:o.type,file:URL.createObjectURL(o),submitted_at:r,created_by:h});this.dispatch(a(A));const O=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{uuid:A.uuid,submitted_at:r,title:A.title,description:A.description,geo_marker:A.geo_marker,canvas_marker:A.canvas_marker,sha1:A.file_sha1,project:A.project,file_name:A.file_name,direction:A.direction,original_date:A.original_date,file:f},blocks:[y],blockers:[y]});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(c(I.geo_image))}).catch(()=>{this.dispatch(d(A.uuid))}),[A,O.then(I=>I.geo_image)]}async bulkAdd(e,n){var P;const{store:a}=this.client,{addMany:c,setMany:d,deleteMany:o}=this.actions,l=new Date().toISOString(),r=((P=a.getState().userReducer.currentUser)==null?void 0:P.id)??null,h=[],y=[],f=[],A={};for(const I of e){const{file:F,...g}=I,v=await this.client.files.getFilePayload(F);v.sha1 in A||(A[v.sha1]=v);const B=_({...g,file_name:F.name,file_sha1:v.sha1,file_type:F.type,file:URL.createObjectURL(F),submitted_at:l,created_by:r,project:n});h.push(B),y.push(B.uuid),f.push({uuid:B.uuid,sha1:B.file_sha1,file_name:B.file_name,title:B.title,description:B.description,geo_marker:B.geo_marker,canvas_marker:B.canvas_marker,direction:B.direction,original_date:B.original_date})}this.dispatch(c(h));const O=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,project:n,geo_images:f,files:Object.values(A)},blocks:[n],blockers:y});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(d(I.geo_images))}).catch(()=>{this.dispatch(o(y))}),[h,O.then(I=>I.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class wR extends k{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:tf,addMany:Ht,setOne:Qy,setMany:Xy,updateOne:xy,updateMany:ef,deleteOne:sf,deleteMany:Gt,initialize:Jy});p(this,"selectors",{selectById:af,selectByIds:cf})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class OR extends L{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:mf,addMany:an,setOne:pf,setMany:yf,updateOne:ff,updateMany:Af,deleteOne:Sf,deleteMany:cn,initialize:hf});p(this,"selectors",{selectById:Of,selectByIds:If})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class IR extends L{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:bf,addMany:_f,setOne:Mf,setMany:Rf,updateOne:kf,updateMany:vf,deleteOne:Ef,deleteMany:Vf,initialize:gf});p(this,"selectors",{selectById:zf,selectByIds:Wf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class FR extends k{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:$f,addMany:Df,setOne:Uf,setMany:Lf,updateOne:Nf,updateMany:Hf,deleteOne:Gf,deleteMany:Kf,initialize:jf});p(this,"selectors",{selectById:Yf,selectByIds:Zf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.issue],blocks:[o.uuid]});return l.then(r=>{this.dispatch(c(r))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class PR extends k{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:xf,addMany:mn,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:pn,initialize:Qf});p(this,"selectors",{selectById:cA,selectByIds:rA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=n.getState(),l=new Date().toISOString(),r=((f=o.userReducer.currentUser)==null?void 0:f.id)??null,h=_({...e,submitted_at:l,created_by:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(h.uuid)),A}),[h,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const o={...d,...e};this.dispatch(n(o));const l={};for(const f of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(f in e&&e[f]!==d[f])switch(f){case j.PRIORITY:l[f]=e[f];break;case j.DUE_DATE:l[f]=e[f];break;case j.DESCRIPTION:l[f]=e[f];break;case j.TITLE:l[f]=e[f];break;case j.STATUS:{const A=e[f],O=En(A)(c);if(!O)throw new Error(`Trying to update issue type status with ${A} which does not exist in store`);l[f]={name:O.name,color:O.color,uuid:O.uuid};break}case j.CATEGORY:{const A=e[f];if(A===null)l[f]=null;else{const O=Pi(A)(c);if(!O)throw new Error(`Trying to update category with ${A} which does not exist in store.`);l[f]={name:O.name,color:O.color,uuid:O.uuid}}break}case j.ASSIGNED_TO:{const A=e[f];if(A===null)l[f]=null;else{const O=Xt(A)(c);if(!O)throw new Error(`Trying to update assigned to with ${A} which does not exist in store.`);l[f]={full_name:O.username,id:O.id}}break}}const r=_({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:l});this.dispatch(Bn(r));const h=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(d)),this.dispatch(Wn(r.uuid))}),[o,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=z(e).toSorted(vt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(As);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} issues that dont exist in the store`);const r=[];for(let A=0;A<o.length;A++)r.push({...l[A],...e[A]});this.dispatch(c(r));const h=ut(e,Math.min(n??e.length,U)),y=[];let f=null;for(const A of h){const O=ht.v4(),P=z(A),I=A.map(({status:v})=>v).filter(Boolean),F=A.map(({category:v})=>v).filter(Boolean),g=this.enqueueRequest({description:w(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:A},blockers:(f?[f]:[]).concat(P).concat(I).concat(F),blocks:[O].concat(P)});y.push(g),f=O}return Promise.all(y).then(A=>{this.dispatch(c(A.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const r=wf(e)(o),h=BT(e)(o),y={};for(const A of rf(e)(o))y[A.uuid]=A;for(const A of df(e)(o))y[A.uuid]=A;const f=Object.values(y);this.dispatch(a(e)),this.dispatch(cn(z(r))),this.dispatch(qn(z(h))),this.dispatch(Gt(z(f)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(c(l)),this.dispatch(an(r)),this.dispatch(zn(h)),this.dispatch(Ht(f)),A}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class gR extends L{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:hA,addMany:mA,setOne:pA,setMany:yA,updateOne:fA,updateMany:AA,deleteOne:SA,deleteMany:TA,initialize:uA});p(this,"selectors",{selectById:OA,selectByIds:IA})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class bR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:bA,addMany:_A,setOne:MA,setMany:RA,updateOne:kA,updateMany:vA,deleteOne:EA,deleteMany:VA,initialize:gA});p(this,"selectors",{selectById:zA,selectByIds:WA})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_extension:F.extension,field_identifier:P,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class _R extends k{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:eS,addMany:tS,setOne:sS,setMany:iS,updateOne:nS,updateMany:aS,deleteOne:cS,deleteMany:rS,initialize:xA});p(this,"selectors",{selectById:lS,selectByIds:oS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class MR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:pS,addMany:In,setOne:yS,setMany:fS,updateOne:AS,updateMany:SS,deleteOne:TS,deleteMany:Fn,initialize:mS});p(this,"selectors",{selectById:OS,selectByIds:IS})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.field_values),blocks:r.map(A=>A.uuid)});return y.then(({presigned_urls:A,attachments:O})=>{this.client.files.processPresignedUrls(A),this.dispatch(a(O))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class RR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:$A,addMany:DA,setOne:UA,setMany:LA,updateOne:NA,updateMany:HA,deleteOne:GA,deleteMany:KA,initialize:jA});p(this,"selectors",{selectById:ZA,selectByIds:JA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=FS(e)(o);this.dispatch(a(e)),this.dispatch(Fn(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(In(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class kR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:_S,addMany:MS,setOne:RS,setMany:kS,updateOne:vS,updateMany:ES,deleteOne:VS,deleteMany:BS,initialize:bS});p(this,"selectors",{selectById:WS,selectByIds:qS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class vR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:DS,addMany:US,setOne:LS,setMany:NS,updateOne:HS,updateMany:GS,deleteOne:KS,deleteMany:YS,initialize:$S});p(this,"selectors",{selectById:JS,selectByIds:XS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ER extends k{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});p(this,"selectors",{selectById:oT,selectByIds:uT})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,submitted_at:r,created_by:l});this.dispatch(a(h));const y=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const r=dA(e)(o);this.dispatch(a(e)),this.dispatch(pn(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(mn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:yT,addMany:fT,setOne:AT,setMany:ST,updateOne:TT,updateMany:wT,deleteOne:OT,deleteMany:IT,initialize:pT});p(this,"selectors",{selectById:En,selectByIds:PT})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class BR extends k{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:Bn,addMany:zn,setOne:MT,setMany:RT,updateOne:kT,updateMany:vT,deleteOne:Wn,deleteMany:qn,initialize:_T});p(this,"selectors",{selectById:ET,selectByIds:VT})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}const zR=1800;function WR(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class qR extends EM{constructor(){super(...arguments);p(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:m.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Nh(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.log("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Jg(e).exp??n}catch{a=n}return a-n<zR}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof $&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??At).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new $({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new $({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ht.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:m.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(WR(a))})}}class CR extends St{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:ZT,addMany:JT,setOne:XT,setMany:QT,updateOne:xT,updateMany:ew,deleteOne:tw,deleteMany:sw,initialize:YT});p(this,"selectors",{selectById:nw,selectByIds:aw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o),r=Xt(l.user)(o);this.dispatch(a(l.uuid)),this.dispatch(Un(l.user));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Dn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class jR extends St{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:hw,addMany:uw,setOne:ow,setMany:lw,updateOne:pw,updateMany:mw,deleteOne:yw,deleteMany:fw,initialize:dw});p(this,"selectors",{selectById:Tw,selectByIds:ww})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class $R extends k{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:kw,addMany:vw,setOne:Ew,setMany:Vw,updateOne:Bw,updateMany:zw,deleteOne:Ww,deleteMany:qw,initialize:Rw});p(this,"selectors",{selectById:jw,selectByIds:$w})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[o.organization_access,o.project],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(o.uuid)),h}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>E(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(d(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class DR extends L{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:Lw,addMany:Nw,setOne:Hw,setMany:Gw,updateOne:Kw,updateMany:Yw,deleteOne:Zw,deleteMany:Jw,initialize:Uw});p(this,"selectors",{selectById:Qw,selectByIds:xw})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class UR extends k{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:aO,addMany:cO,setOne:iO,setMany:nO,updateOne:rO,updateMany:dO,deleteOne:lO,deleteMany:oO,initialize:sO});p(this,"selectors",{selectById:fO,selectByIds:AO})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(d=>{this.dispatch(n(d))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const d=a.projectFileReducer.instances[c];if(!d)throw new Error("No active project file");if(!d.bounds&&!d.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let o;if(typeof d.file=="string"&&!d.file.startsWith("blob:")){const h={...d};delete h.file,o={method:m.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else o=new Promise((h,y)=>{this.client.files.uploadFileToS3(d.file_sha1).then(([f])=>{h({method:m.POST,url:`${this.url}/`,payload:{...d,...f},blockers:[c],blocks:[c]})}).catch(y)});const r=Promise.resolve(o).then(h=>this.enqueueRequest(h));return r.then(h=>{this.dispatch(n(h))}),this.dispatch(mO),this.dispatch(hO(null)),this.dispatch(uO(!1)),[d,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class LR extends St{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:PO,addMany:FO,setOne:IO,setMany:OO,updateOne:bO,updateMany:gO,deleteOne:_O,deleteMany:MO,initialize:wO});p(this,"selectors",{selectById:vO,selectByIds:EO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:m.POST,url:`${this.url}/`,payload:E(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class NR extends k{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:WO,addMany:qO,setOne:CO,setMany:jO,updateOne:$O,updateMany:DO,deleteOne:UO,deleteMany:LO,initialize:zO});p(this,"selectors",{selectById:GO,selectByIds:KO})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.team],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>E(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(d(l.map(y=>y.uuid)))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class HR extends k{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:JO,addMany:XO,setOne:QO,setMany:xO,updateOne:eI,updateMany:tI,deleteOne:sI,deleteMany:iI,initialize:ZO});p(this,"selectors",{selectById:aI,selectByIds:cI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,submitted_at:new Date().toISOString(),created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class GR extends St{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Dn,addMany:$T,setOne:jT,setMany:CT,updateOne:UT,updateMany:DT,deleteOne:Un,deleteMany:LT,initialize:qT});p(this,"selectors",{selectById:Xt,selectByIds:GT})}async list(e,n){const{organizationUuid:a,...c}=e,d=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:m.GET,url:d,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class KR extends k{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:oI,addMany:na,setOne:uI,setMany:hI,updateOne:mI,updateMany:pI,deleteOne:yI,deleteMany:aa,initialize:lI});p(this,"selectors",{selectById:AI,selectByIds:SI})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.workflow_type],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const r=$F(e)(o),h=EI(e)(o),y=_P(e)(o),f=$P(e)(o),A=fF(e)(o),O=iF(e)(o),P={};for(const F of O)for(const g of ua(F.uuid)(o))P[g.uuid]=g;const I=Object.values(P);this.dispatch(a(e)),this.dispatch(Pa(z(r))),this.dispatch(da(z(h))),this.dispatch(Va(z(y))),this.dispatch(Wa(z(f))),this.dispatch(Aa(z(A))),this.dispatch(pa(z(O))),this.dispatch(is(z(I)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(F){throw this.dispatch(c(l)),this.dispatch(Fa(r)),this.dispatch(ra(h)),this.dispatch(Ea(y)),this.dispatch(za(f)),this.dispatch(fa(A)),this.dispatch(ma(O)),this.dispatch(ss(I)),F}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class YR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:FI,addMany:ra,setOne:PI,setMany:gI,updateOne:bI,updateMany:_I,deleteOne:MI,deleteMany:da,initialize:II});p(this,"selectors",{selectById:kI,selectByIds:vI})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ZR extends L{constructor(){super(...arguments);p(this,"name","Workflow Step Comment Attachment");p(this,"url","/workflow-step-comment-attachments");p(this,"actions",{addOne:WI,addMany:ss,setOne:qI,setMany:CI,updateOne:jI,updateMany:$I,deleteOne:DI,deleteMany:is,initialize:zI});p(this,"selectors",{selectById:LI,selectByIds:NI})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,workflow_step_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,workflow_step_comment:e.workflow_step_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.workflowStepCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow_step_comment__workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class JR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:YI,addMany:ma,setOne:ZI,setMany:JI,updateOne:XI,updateMany:QI,deleteOne:xI,deleteMany:pa,initialize:KI});p(this,"selectors",{selectById:tF,selectByIds:sF})}add(e){var r;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.workflow,e.workflow_step],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);const l=ua(e)(n.getState());this.dispatch(a(e)),this.dispatch(is(z(l)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(o)),this.dispatch(ss(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class XR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Completion");p(this,"url","/workflow-step-completions");p(this,"actions",{addOne:rF,addMany:fa,setOne:dF,setMany:lF,updateOne:oF,updateMany:uF,deleteOne:hF,deleteMany:Aa,initialize:cF});p(this,"selectors",{selectById:pF,selectByIds:yF})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step completion with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class QR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:wF,addMany:Ta,setOne:OF,setMany:IF,updateOne:FF,updateMany:PF,deleteOne:gF,deleteMany:wa,initialize:TF});p(this,"selectors",{selectById:_F,selectByIds:MF})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.field_values),blocks:r.map(A=>A.uuid)});return y.then(({presigned_urls:A,attachments:O})=>{this.client.files.processPresignedUrls(A),this.dispatch(a(O))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class xR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:VF,addMany:Fa,setOne:BF,setMany:zF,updateOne:WF,updateMany:qF,deleteOne:CF,deleteMany:Pa,initialize:EF});p(this,"selectors",{selectById:DF,selectByIds:UF})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.workflow,l.workflow_step],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=RF(e)(o);this.dispatch(a(e)),this.dispatch(wa(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ta(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class ek extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:GF,addMany:ba,setOne:KF,setMany:YF,updateOne:ZF,updateMany:JF,deleteOne:XF,deleteMany:_a,initialize:HF});p(this,"selectors",{selectById:eP,selectByIds:tP})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class tk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:aP,addMany:cP,setOne:rP,setMany:dP,updateOne:lP,updateMany:oP,deleteOne:uP,deleteMany:hP,initialize:nP});p(this,"selectors",{selectById:mP,selectByIds:pP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().workflowStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`WorkflowStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().workflowStepFieldsReducer.instances[e];if(!d)throw new Error(`WorkflowStepFields with uuid ${e} not found`);const o=xF(e)(n.getState());this.dispatch(a(e)),this.dispatch(_a(z(o)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),this.dispatch(ba(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class sk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Review Request");p(this,"url","/workflow-step-review-requests");p(this,"actions",{addOne:SP,addMany:Ea,setOne:TP,setMany:wP,updateOne:OP,updateMany:IP,deleteOne:FP,deleteMany:Va,initialize:AP});p(this,"selectors",{selectById:gP,selectByIds:bP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review request with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review request with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ik extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Review");p(this,"url","/workflow-step-reviews");p(this,"actions",{addOne:vP,addMany:za,setOne:EP,setMany:VP,updateOne:BP,updateMany:zP,deleteOne:WP,deleteMany:Wa,initialize:kP});p(this,"selectors",{selectById:CP,selectByIds:jP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class nk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:NP,addMany:Ca,setOne:HP,setMany:GP,updateOne:KP,updateMany:YP,deleteOne:ZP,deleteMany:ja,initialize:LP});p(this,"selectors",{selectById:QP,selectByIds:eg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No workflow step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,order:e.order},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No workflow step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class ak extends k{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:ig,addMany:ng,setOne:ag,setMany:cg,updateOne:rg,updateMany:dg,deleteOne:lg,deleteMany:og,initialize:sg});p(this,"selectors",{selectById:hg,selectByIds:mg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow type with uuid ${e} to exist`);const r=TI(e)(o),h=xP(e)(o);this.dispatch(a(e)),this.dispatch(aa(z(r))),this.dispatch(ja(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(na(r)),this.dispatch(Ca(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function Ya(t,s,e,n,a){const c=n instanceof mt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:o,payload:l,headers:r,method:h,queryParams:y,attachmentHash:f,isExternalUrl:A,isAuthNeeded:O,isResponseBlob:P}={...d,...s};let I=s.url;const F=f?await e.files.fetchCache(f):void 0;if(f&&!F)throw new Error(`Cannot upload file ${f} because it's not cached.`);!A&&!I.startsWith("http")&&(!I.startsWith("/")&&!I.startsWith("blob:")&&(I="/"+I),I=t+I);const g=C=>{if(f){if(!o)throw new Error(`No S3 URL for file ${f}`);if("warning"in o)throw new Error(`S3 URL warning for file ${f}`);if(!F)throw new Error(`No file for file ${f}`);const q=o.fields["x-amz-checksum-sha1"];if(!q)throw new Error(`No checksum for file ${f}`);return C.set("x-amz-checksum-sha1",q).field({...l,...o.fields}).attach("file",F)}return C.send(l)},B={[m.GET]:()=>P?yt.get(I.toString()).responseType("blob"):yt.get(I.toString()),[m.POST]:()=>{const C=yt.post(I.toString());return g(C)},[m.PATCH]:()=>{const C=yt.patch(I.toString());return g(C)},[m.PUT]:()=>{const C=yt.put(I.toString());return g(C)},[m.DELETE]:()=>{const C=yt.delete(I.toString());return g(C)}}[h];let V=B();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),V.abort()}),O&&c){const C=n.auth.getAuthHeader();V=V.set("Authorization",C)}r&&(V=V.set(r));try{return await V.query(y)}catch(C){const q=vg(C),Lg=q==null?void 0:q.status;if(c&&Lg===401)return await n.auth.handleUnauthorized(V,q),V.query(y);throw new $({response:q,innerError:C,discard:Na.includes(Lg)})}}class ck{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new hs,d={...e,uuid:e.uuid??ht.v4()};return Ya(s,d,this,n,a).then(o=>{c.resolve(o.body)}).catch(o=>{o instanceof Error?c.reject(o):c.reject(new Error((o??At).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof $)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof $)throw a;return a})}_enqueueRequest(s,e,n){const a=new hs,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(Pw(c)),o=r=>{if(r)a.resolve(r.body);else{const h=new $({message:"Could not get a response from the server.",response:r,discard:!0});a.reject(h)}},l=r=>{r instanceof $?r.options.discard=!0:(console.error("Received an unexpected error while processing a request:",r,`
|
|
15
|
+
Converting error to APIError and discarding.`),r=new $({message:"An error occurred while processing the request.",innerError:r,discard:!0})),a.reject(r)};return d.then(o,l),a}async performPagination(s,e,n,a,c){const d={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:o}=d,l=[];let r=await this.performRequest(s,d,a,c);for(l.push(r.results);r.next;)r=await this.performRequest(s,{url:r.next,method:o},a,c),l.push(r.results);return l}}class Tt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new Xg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Tt;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const d=s[c];if(!d){console.error("Previous outbox item was undefined");continue}d.payload.uuid!==a.payload.uuid&&d.payload.blocks.some(o=>a.payload.blockers.includes(o))&&Tt._addDependency(a.payload.uuid,d.payload.uuid,e.graph)}}return e}_addDependency(s,e){Tt._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let Eg;function Vg(t){Eg=t}function wt(){return Eg}let Bg;function zg(t){Bg=t}function Wg(){return Bg}let Za=null;function pt(){const t=wt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Za)return Za;const s=t.getState().offline.outbox,e=Tt._fromOutbox(s);return Za=e,e}const rk=(t,s)=>{const e=new s(t);return zg(e),Vg(t),e};class dk{constructor(s){p(this,"_all");p(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class Ja{constructor(){p(this,"next");this.next=null}then(s){return new dk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!wt())throw new Error("Client store not set");const n=Wg();if(!n)throw new Error("Client SDK not set");return Mg(s,n)}}}class qg extends Ja{async run(s){return super.run(s)}}class Cg extends Ja{async run(s){return super.run(s)}}const jg=new qg().then(new Cg).compile();function $g(t){var s;return(s=jg[0])==null?void 0:s.run(t)}var Dg=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(Dg||{});i.ALL_MIDDLEWARE=jg,i.APIError=$,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=Tg,i.AgentService=VM,i.AssetAttachmentService=BM,i.AssetProcedureService=$M,i.AssetProcedureStepFieldValuesAttachmentService=NM,i.AssetProcedureStepFieldValuesService=HM,i.AssetProcedureStepFieldsAttachmentService=UM,i.AssetProcedureStepFieldsService=LM,i.AssetProcedureStepService=GM,i.AssetProcedureTypeAttachmentService=zM,i.AssetProcedureTypeFieldValuesAttachmentService=CM,i.AssetProcedureTypeFieldValuesService=jM,i.AssetProcedureTypeFieldsAttachmentService=WM,i.AssetProcedureTypeFieldsService=qM,i.AssetProcedureTypeService=DM,i.AssetService=KM,i.AssetStageCompletionService=YM,i.AssetStageService=ZM,i.AssetStatusType=sc,i.AssetTypeAttachmentService=JM,i.AssetTypeFieldValuesAttachmentService=xM,i.AssetTypeFieldValuesService=eR,i.AssetTypeFieldsAttachmentService=XM,i.AssetTypeFieldsService=QM,i.AssetTypeIdentifierService=tR,i.AssetTypeIdentifierValueService=sR,i.AssetTypeService=iR,i.AssetTypeStatusService=nR,i.AttachmentModel=ic,i.BaseApiService=mt,i.BaseModelApiService=St,i.BaseOfflineAttachmentModelService=L,i.BaseOfflineModelApiService=k,i.BaseSDK=ck,i.COMMON_AUTO_FIELDS=uc,i.CategoryService=aR,i.DEFAULT_ISSUE_PRIORITY=Qg,i.DEFAULT_PAGE_SIZE=Sg,i.DISCARD_HTTP_STATUSES=Na,i.DeferredPromise=hs,i.DocumentAttachmentService=cR,i.DocumentService=rR,i.EMPTY_ARRAY=xa,i.EMPTY_OBJECT=ec,i.EmailDomainsService=dR,i.EmailVerificationService=lR,i.FileService=uR,i.FormIdentifierService=hR,i.FormIdentifierValueService=mR,i.FormRevisionAttachmentService=pR,i.FormRevisionService=yR,i.FormService=fR,i.FormSubmissionAttachmentService=AR,i.FormSubmissionService=SR,i.GeoImageService=TR,i.HttpMethod=m,i.IssueAssociationService=wR,i.IssueAttachmentService=OR,i.IssueCommentAttachmentService=IR,i.IssueCommentService=FR,i.IssuePriority=us,i.IssueService=PR,i.IssueStatusType=nc,i.IssueTypeAttachmentService=gR,i.IssueTypeFieldValuesAttachmentService=MR,i.IssueTypeFieldValuesService=RR,i.IssueTypeFieldsAttachmentService=bR,i.IssueTypeFieldsService=_R,i.IssueTypeIdentifierService=kR,i.IssueTypeIdentifierValueService=vR,i.IssueTypeService=ER,i.IssueTypeStatusService=VR,i.IssueUpdateChange=j,i.IssueUpdateService=BR,i.JWTService=qR,i.MAX_SERVICE_BATCH_SIZE=U,i.OUTBOX_RETRY_DELAY=cc,i.OfflineAnalyticsMiddleware=qg,i.OfflineMiddleware=Ja,i.OrganizationAccessLevel=tc,i.OrganizationAccessService=CR,i.OrganizationService=jR,i.OutboxCoordinator=Tt,i.ProjectAccessService=$R,i.ProjectAttachmentService=DR,i.ProjectFileService=UR,i.ProjectService=LR,i.RESET_ORGANIZATION_STATE=R,i.RESET_PROJECT_STATE=W,i.RESET_STATE=b,i.RateLimitingMiddleware=Cg,i.SelectorBuilder=Ib,i.TeamMembershipService=NR,i.TeamService=HR,i.UNKNOWN_ERROR_MESSAGE=At,i.UserService=GR,i.VERSION_REDUCER_KEY=Ot,i.VerificationCodeType=Dg,i.WorkflowReviewType=ac,i.WorkflowService=KR,i.WorkflowStepAssigneeService=YR,i.WorkflowStepCommentAttachmentService=ZR,i.WorkflowStepCommentService=JR,i.WorkflowStepCompletionService=XR,i.WorkflowStepFieldValuesAttachmentService=QR,i.WorkflowStepFieldValuesService=xR,i.WorkflowStepFieldsAttachmentService=ek,i.WorkflowStepFieldsService=tk,i.WorkflowStepReviewRequestService=sk,i.WorkflowStepReviewService=ik,i.WorkflowStepService=nk,i.WorkflowTypeService=ak,i._setLatestRetryTime=bw,i.addAsset=Dl,i.addAssetAttachment=bc,i.addAssetAttachments=Os,i.addAssetProcedure=ed,i.addAssetProcedureStep=Rl,i.addAssetProcedureStepFieldValues=ml,i.addAssetProcedureStepFieldValuesAttachment=el,i.addAssetProcedureStepFieldValuesAttachments=Ns,i.addAssetProcedureStepFieldValuesMany=pl,i.addAssetProcedureStepFields=Dd,i.addAssetProcedureStepFieldsAttachment=_d,i.addAssetProcedureStepFieldsAttachments=Md,i.addAssetProcedureStepFieldsMany=Ud,i.addAssetProcedureSteps=kl,i.addAssetProcedureType=md,i.addAssetProcedureTypeAttachment=jc,i.addAssetProcedureTypeAttachments=$c,i.addAssetProcedureTypeFieldValues=$r,i.addAssetProcedureTypeFieldValuesAttachment=_r,i.addAssetProcedureTypeFieldValuesAttachments=ks,i.addAssetProcedureTypeFieldValuesMany=Dr,i.addAssetProcedureTypeFields=mr,i.addAssetProcedureTypeFieldsAttachment=xc,i.addAssetProcedureTypeFieldsAttachments=er,i.addAssetProcedureTypeFieldsMany=pr,i.addAssetProcedureTypes=pd,i.addAssetProcedures=zs,i.addAssetStage=So,i.addAssetStageCompletion=eo,i.addAssetStageCompletions=to,i.addAssetStages=To,i.addAssetType=Th,i.addAssetTypeAttachment=Ro,i.addAssetTypeAttachments=ni,i.addAssetTypeFieldValues=Ru,i.addAssetTypeFieldValuesAttachment=fu,i.addAssetTypeFieldValuesAttachments=ui,i.addAssetTypeFieldValuesMany=ku,i.addAssetTypeFields=su,i.addAssetTypeFieldsAttachment=Uo,i.addAssetTypeFieldsAttachments=Lo,i.addAssetTypeFieldsMany=iu,i.addAssetTypeIdentifier=Lu,i.addAssetTypeIdentifierValue=ih,i.addAssetTypeIdentifierValues=nh,i.addAssetTypeIdentifiers=Nu,i.addAssetTypeStatus=vh,i.addAssetTypeStatuses=Eh,i.addAssetTypes=wh,i.addAssets=Xs,i.addCategories=Zh,i.addCategory=Yh,i.addConversation=wc,i.addConversations=Fb,i.addDocument=Om,i.addDocumentAttachment=rm,i.addDocumentAttachments=dm,i.addDocuments=Im,i.addEmailDomain=zm,i.addEmailDomains=Wm,i.addForm=Qp,i.addFormIdentifier=ep,i.addFormIdentifierValue=pp,i.addFormIdentifierValues=yp,i.addFormIdentifiers=tp,i.addFormRevision=qi,i.addFormRevisionAttachment=Mp,i.addFormRevisionAttachments=Rp,i.addFormRevisions=Ci,i.addFormSubmission=by,i.addFormSubmissionAttachment=hy,i.addFormSubmissionAttachments=Hi,i.addFormSubmissions=Xi,i.addForms=xp,i.addGeoImage=jy,i.addGeoImages=$y,i.addIssue=xf,i.addIssueAssociation=tf,i.addIssueAssociations=Ht,i.addIssueAttachment=mf,i.addIssueAttachments=an,i.addIssueComment=$f,i.addIssueCommentAttachment=bf,i.addIssueCommentAttachments=_f,i.addIssueComments=Df,i.addIssueType=tT,i.addIssueTypeAttachment=hA,i.addIssueTypeAttachments=mA,i.addIssueTypeFieldValues=$A,i.addIssueTypeFieldValuesAttachment=pS,i.addIssueTypeFieldValuesAttachments=In,i.addIssueTypeFieldValuesMany=DA,i.addIssueTypeFields=eS,i.addIssueTypeFieldsAttachment=bA,i.addIssueTypeFieldsAttachments=_A,i.addIssueTypeFieldsMany=tS,i.addIssueTypeIdentifier=_S,i.addIssueTypeIdentifierValue=DS,i.addIssueTypeIdentifierValues=US,i.addIssueTypeIdentifiers=MS,i.addIssueTypeStatus=yT,i.addIssueTypeStatuses=fT,i.addIssueTypes=sT,i.addIssueUpdate=Bn,i.addIssueUpdates=zn,i.addIssues=mn,i.addOrganization=hw,i.addOrganizationAccess=ZT,i.addOrganizationAccesses=JT,i.addOrganizations=uw,i.addProject=PO,i.addProjectAccess=kw,i.addProjectAccesses=vw,i.addProjectAttachment=Lw,i.addProjectAttachments=Nw,i.addProjectFile=aO,i.addProjectFiles=cO,i.addProjects=FO,i.addTeam=JO,i.addTeamMembership=WO,i.addTeamMemberships=qO,i.addTeams=XO,i.addUser=Dn,i.addUsers=$T,i.addWorkflow=oI,i.addWorkflowStep=NP,i.addWorkflowStepAssignee=FI,i.addWorkflowStepAssignees=ra,i.addWorkflowStepComment=YI,i.addWorkflowStepCommentAttachment=WI,i.addWorkflowStepCommentAttachments=ss,i.addWorkflowStepComments=ma,i.addWorkflowStepCompletion=rF,i.addWorkflowStepCompletions=fa,i.addWorkflowStepFieldValues=VF,i.addWorkflowStepFieldValuesAttachment=wF,i.addWorkflowStepFieldValuesAttachments=Ta,i.addWorkflowStepFieldValuesMany=Fa,i.addWorkflowStepFields=aP,i.addWorkflowStepFieldsAttachment=GF,i.addWorkflowStepFieldsAttachments=ba,i.addWorkflowStepFieldsMany=cP,i.addWorkflowStepReview=vP,i.addWorkflowStepReviewRequest=SP,i.addWorkflowStepReviewRequests=Ea,i.addWorkflowStepReviews=za,i.addWorkflowSteps=Ca,i.addWorkflowType=ig,i.addWorkflowTypes=ng,i.addWorkflows=na,i.agentsReducer=Fc,i.agentsSlice=Ss,i.areArraysEqual=sb,i.assetAttachmentReducer=Wc,i.assetAttachmentSlice=ws,i.assetProcedureReducer=cd,i.assetProcedureSlice=Bs,i.assetProcedureStepFieldValuesAttachmentReducer=ol,i.assetProcedureStepFieldValuesAttachmentSlice=Ls,i.assetProcedureStepFieldValuesReducer=Pl,i.assetProcedureStepFieldValuesSlice=Ks,i.assetProcedureStepFieldsAttachmentReducer=Cd,i.assetProcedureStepFieldsAttachmentSlice=js,i.assetProcedureStepFieldsReducer=Xd,i.assetProcedureStepFieldsSlice=Ds,i.assetProcedureStepReducer=zl,i.assetProcedureStepSlice=Ys,i.assetProcedureTypeAttachmentReducer=Kc,i.assetProcedureTypeAttachmentSlice=Ps,i.assetProcedureTypeFieldValuesAttachmentReducer=Vr,i.assetProcedureTypeFieldValuesAttachmentSlice=Rs,i.assetProcedureTypeFieldValuesReducer=Yr,i.assetProcedureTypeFieldValuesSlice=Vs,i.assetProcedureTypeFieldsAttachmentReducer=rr,i.assetProcedureTypeFieldsAttachmentSlice=bs,i.assetProcedureTypeFieldsReducer=Or,i.assetProcedureTypeFieldsSlice=Ms,i.assetProcedureTypeReducer=Od,i.assetProcedureTypeSlice=qs,i.assetReducer=Xl,i.assetSlice=Js,i.assetStageCompletionReducer=lo,i.assetStageCompletionSlice=xs,i.assetStageReducer=Po,i.assetStageSlice=ei,i.assetTypeAttachmentReducer=jo,i.assetTypeAttachmentSlice=ii,i.assetTypeFieldValuesAttachmentReducer=bu,i.assetTypeFieldValuesAttachmentSlice=oi,i.assetTypeFieldValuesReducer=$u,i.assetTypeFieldValuesSlice=pi,i.assetTypeFieldsAttachmentReducer=xo,i.assetTypeFieldsAttachmentSlice=ri,i.assetTypeFieldsReducer=mu,i.assetTypeFieldsSlice=li,i.assetTypeIdentifierReducer=eh,i.assetTypeIdentifierSlice=yi,i.assetTypeIdentifierValueReducer=ph,i.assetTypeIdentifierValueSlice=Ai,i.assetTypeReducer=Mh,i.assetTypeSlice=Si,i.assetTypeStatusReducer=Uh,i.assetTypeStatusSlice=wi,i.assetTypeStatusSortFn=pc,i.authReducer=Hh,i.authSlice=$t,i.baseReducer=SM,i.baseReducers=La,i.blobToBase64=ub,i.categoryReducer=nm,i.categorySlice=Ii,i.clearTokens=r_,i.constructUploadedFilePayloads=ob,i.createModelAdapter=M,i.createOfflineAction=Iw,i.createPayload=E,i.createSelectionAdapter=xg,i.deleteAsset=Nl,i.deleteAssetAttachment=vc,i.deleteAssetAttachments=Is,i.deleteAssetProcedure=id,i.deleteAssetProcedureStep=Vl,i.deleteAssetProcedureStepFieldValues=Tl,i.deleteAssetProcedureStepFieldValuesAttachment=al,i.deleteAssetProcedureStepFieldValuesAttachments=Hs,i.deleteAssetProcedureStepFieldValuesMany=wl,i.deleteAssetProcedureStepFields=Kd,i.deleteAssetProcedureStepFieldsAttachment=Vd,i.deleteAssetProcedureStepFieldsAttachments=Bd,i.deleteAssetProcedureStepFieldsMany=Yd,i.deleteAssetProcedureSteps=Bl,i.deleteAssetProcedureType=Ad,i.deleteAssetProcedureTypeAttachment=Hc,i.deleteAssetProcedureTypeAttachments=Gc,i.deleteAssetProcedureTypeFieldValues=Gr,i.deleteAssetProcedureTypeFieldValuesAttachment=Er,i.deleteAssetProcedureTypeFieldValuesAttachments=vs,i.deleteAssetProcedureTypeFieldValuesMany=Kr,i.deleteAssetProcedureTypeFields=Tr,i.deleteAssetProcedureTypeFieldsAttachment=ar,i.deleteAssetProcedureTypeFieldsAttachments=cr,i.deleteAssetProcedureTypeFieldsMany=wr,i.deleteAssetProcedureTypes=Sd,i.deleteAssetProcedures=Ws,i.deleteAssetStage=Io,i.deleteAssetStageCompletion=co,i.deleteAssetStageCompletions=ro,i.deleteAssetStages=Fo,i.deleteAssetType=Fh,i.deleteAssetTypeAttachment=Bo,i.deleteAssetTypeAttachments=ai,i.deleteAssetTypeFieldValues=zu,i.deleteAssetTypeFieldValuesAttachment=Ou,i.deleteAssetTypeFieldValuesAttachments=hi,i.deleteAssetTypeFieldValuesMany=Wu,i.deleteAssetTypeFields=du,i.deleteAssetTypeFieldsAttachment=Yo,i.deleteAssetTypeFieldsAttachments=Zo,i.deleteAssetTypeFieldsMany=lu,i.deleteAssetTypeIdentifier=Zu,i.deleteAssetTypeIdentifierValue=lh,i.deleteAssetTypeIdentifierValues=oh,i.deleteAssetTypeIdentifiers=Ju,i.deleteAssetTypeStatus=qh,i.deleteAssetTypeStatuses=Ch,i.deleteAssetTypes=Ph,i.deleteAssets=Qs,i.deleteCategories=tm,i.deleteCategory=em,i.deleteConversation=bb,i.deleteConversations=_b,i.deleteDocument=_m,i.deleteDocumentAttachment=mm,i.deleteDocumentAttachments=pm,i.deleteDocuments=Mm,i.deleteEmailDomain=Dm,i.deleteEmailDomains=Um,i.deleteForm=ny,i.deleteFormIdentifier=cp,i.deleteFormIdentifierValue=wp,i.deleteFormIdentifierValues=Op,i.deleteFormIdentifiers=rp,i.deleteFormRevision=ji,i.deleteFormRevisionAttachment=Bp,i.deleteFormRevisionAttachments=zp,i.deleteFormRevisions=$i,i.deleteFormSubmission=Ry,i.deleteFormSubmissionAttachment=Ay,i.deleteFormSubmissionAttachments=Gi,i.deleteFormSubmissions=Qi,i.deleteForms=ay,i.deleteGeoImage=Ly,i.deleteGeoImages=Ny,i.deleteIssue=nA,i.deleteIssueAssociation=sf,i.deleteIssueAssociations=Gt,i.deleteIssueAttachment=Sf,i.deleteIssueAttachments=cn,i.deleteIssueComment=Gf,i.deleteIssueCommentAttachment=Ef,i.deleteIssueCommentAttachments=Vf,i.deleteIssueComments=Kf,i.deleteIssueType=rT,i.deleteIssueTypeAttachment=SA,i.deleteIssueTypeAttachments=TA,i.deleteIssueTypeFieldValues=GA,i.deleteIssueTypeFieldValuesAttachment=TS,i.deleteIssueTypeFieldValuesAttachments=Fn,i.deleteIssueTypeFieldValuesMany=KA,i.deleteIssueTypeFields=cS,i.deleteIssueTypeFieldsAttachment=EA,i.deleteIssueTypeFieldsAttachments=VA,i.deleteIssueTypeFieldsMany=rS,i.deleteIssueTypeIdentifier=VS,i.deleteIssueTypeIdentifierValue=KS,i.deleteIssueTypeIdentifierValues=YS,i.deleteIssueTypeIdentifiers=BS,i.deleteIssueTypeStatus=OT,i.deleteIssueTypeStatuses=IT,i.deleteIssueTypes=dT,i.deleteIssueUpdate=Wn,i.deleteIssueUpdates=qn,i.deleteIssues=pn,i.deleteOrganization=yw,i.deleteOrganizationAccess=tw,i.deleteOrganizationAccesses=sw,i.deleteOrganizations=fw,i.deleteProject=_O,i.deleteProjectAccess=Ww,i.deleteProjectAccesses=qw,i.deleteProjectAttachment=Zw,i.deleteProjectAttachments=Jw,i.deleteProjectFile=lO,i.deleteProjectFiles=oO,i.deleteProjects=MO,i.deleteTeam=sI,i.deleteTeamMembership=UO,i.deleteTeamMemberships=LO,i.deleteTeams=iI,i.deleteUser=Un,i.deleteUsers=LT,i.deleteWorkflow=yI,i.deleteWorkflowStep=ZP,i.deleteWorkflowStepAssignee=MI,i.deleteWorkflowStepAssignees=da,i.deleteWorkflowStepComment=xI,i.deleteWorkflowStepCommentAttachment=DI,i.deleteWorkflowStepCommentAttachments=is,i.deleteWorkflowStepComments=pa,i.deleteWorkflowStepCompletion=hF,i.deleteWorkflowStepCompletions=Aa,i.deleteWorkflowStepFieldValues=CF,i.deleteWorkflowStepFieldValuesAttachment=gF,i.deleteWorkflowStepFieldValuesAttachments=wa,i.deleteWorkflowStepFieldValuesMany=Pa,i.deleteWorkflowStepFields=uP,i.deleteWorkflowStepFieldsAttachment=XF,i.deleteWorkflowStepFieldsAttachments=_a,i.deleteWorkflowStepFieldsMany=hP,i.deleteWorkflowStepReview=WP,i.deleteWorkflowStepReviewRequest=FP,i.deleteWorkflowStepReviewRequests=Va,i.deleteWorkflowStepReviews=Wa,i.deleteWorkflowSteps=ja,i.deleteWorkflowType=lg,i.deleteWorkflowTypes=og,i.deleteWorkflows=aa,i.dequeue=_g,i.discard=Rg,i.documentAttachmentReducer=Sm,i.documentAttachmentSlice=gi,i.documentSlice=_i,i.documentsReducer=Rm,i.downloadFile=hb,i.downloadInMemoryFile=lb,i.emailDomainsReducer=Gm,i.emailDomainsSlice=Ri,i.emailRegex=Tb,i.enqueue=bg,i.enqueueRequest=Pw,i.extractResponseFromError=vg,i.fallbackToEmptyArray=T,i.fallbackToEmptyObject=kt,i.fileReducer=Xm,i.fileSlice=vi,i.fileToBlob=lc,i.formIdentifierReducer=up,i.formIdentifierSlice=Ei,i.formIdentifierValueReducer=gp,i.formIdentifierValueSlice=Bi,i.formReducer=cy,i.formRevisionAttachmentReducer=jp,i.formRevisionAttachmentSlice=zi,i.formRevisionReducer=Zp,i.formRevisionsSlice=Wi,i.formSlice=Ui,i.formSubmissionAttachmentReducer=Oy,i.formSubmissionAttachmentSlice=Ni,i.formSubmissionReducer=By,i.formSubmissionSlice=Ji,i.geoImageReducer=Yy,i.geoImageSlice=en,i.getAssetProcedureStepSubTree=mc,i.getAssetProcedureStepTrees=wb,i.getClientSDK=Wg,i.getClientStore=wt,i.getDocumentSubTree=Ac,i.getDocumentTrees=Ob,i.getFileIdentifier=db,i.getFileS3Key=fs,i.getLocalDateString=rc,i.getLocalRelativeDateString=cb,i.getOutboxCoordinator=pt,i.getRenamedFile=dc,i.getRequestDescription=w,i.hashFile=ft,i.initSDK=rk,i.initializeAssetAttachments=gc,i.initializeAssetProcedureStepFieldValues=hl,i.initializeAssetProcedureStepFieldValuesAttachments=xd,i.initializeAssetProcedureStepFields=$d,i.initializeAssetProcedureStepFieldsAttachments=bd,i.initializeAssetProcedureSteps=bl,i.initializeAssetProcedureTypeAttachments=Cc,i.initializeAssetProcedureTypeFieldValues=jr,i.initializeAssetProcedureTypeFieldValuesAttachments=br,i.initializeAssetProcedureTypeFields=hr,i.initializeAssetProcedureTypeFieldsAttachments=Qc,i.initializeAssetProcedureTypes=hd,i.initializeAssetProcedures=xr,i.initializeAssetStageCompletions=xl,i.initializeAssetStages=yo,i.initializeAssetTypeAttachments=Mo,i.initializeAssetTypeFieldValues=Mu,i.initializeAssetTypeFieldValuesAttachments=yu,i.initializeAssetTypeFields=tu,i.initializeAssetTypeFieldsAttachments=Do,i.initializeAssetTypeIdentifierValues=sh,i.initializeAssetTypeIdentifiers=Uu,i.initializeAssetTypeStatuses=kh,i.initializeAssetTypes=fh,i.initializeAssets=$l,i.initializeCategories=Kh,i.initializeConversations=Tc,i.initializeDocumentAttachments=cm,i.initializeDocuments=wm,i.initializeEmailDomains=Bm,i.initializeFormIdentifierValues=mp,i.initializeFormIdentifiers=xm,i.initializeFormRevisionAttachments=_p,i.initializeFormRevisions=Dp,i.initializeFormSubmissionAttachments=uy,i.initializeFormSubmissions=Fy,i.initializeForms=Xp,i.initializeGeoImages=Wy,i.initializeIssueAssociations=Jy,i.initializeIssueAttachments=hf,i.initializeIssueCommentAttachments=gf,i.initializeIssueComments=jf,i.initializeIssueTypeAttachments=uA,i.initializeIssueTypeFieldValues=jA,i.initializeIssueTypeFieldValuesAttachments=mS,i.initializeIssueTypeFields=xA,i.initializeIssueTypeFieldsAttachments=gA,i.initializeIssueTypeIdentifierValues=$S,i.initializeIssueTypeIdentifiers=bS,i.initializeIssueTypeStatuses=pT,i.initializeIssueTypes=eT,i.initializeIssueUpdates=_T,i.initializeIssues=Qf,i.initializeOrganizationAccesses=YT,i.initializeOrganizations=dw,i.initializeProjectAccesses=Rw,i.initializeProjectAttachments=Uw,i.initializeProjectFiles=sO,i.initializeProjects=wO,i.initializeTeamMemberships=zO,i.initializeTeams=ZO,i.initializeUsers=qT,i.initializeWorkflowStepAssignees=II,i.initializeWorkflowStepCommentAttachments=zI,i.initializeWorkflowStepComments=KI,i.initializeWorkflowStepCompletions=cF,i.initializeWorkflowStepFieldValues=EF,i.initializeWorkflowStepFieldValuesAttachments=TF,i.initializeWorkflowStepFields=nP,i.initializeWorkflowStepFieldsAttachments=HF,i.initializeWorkflowStepReviewRequests=AP,i.initializeWorkflowStepReviews=kP,i.initializeWorkflowSteps=LP,i.initializeWorkflowTypes=sg,i.initializeWorkflows=lI,i.isToday=ab,i.issueAssociationReducer=of,i.issueAssociationSlice=sn,i.issueAttachmentReducer=Ff,i.issueAttachmentSlice=nn,i.issueCommentAttachmentReducer=qf,i.issueCommentAttachmentSlice=dn,i.issueCommentReducer=Jf,i.issueCommentSlice=on,i.issueReducer=lA,i.issueSlice=hn,i.issueTypeAttachmentReducer=FA,i.issueTypeAttachmentSlice=yn,i.issueTypeFieldValuesAttachmentReducer=PS,i.issueTypeFieldValuesAttachmentSlice=On,i.issueTypeFieldValuesReducer=XA,i.issueTypeFieldValuesSlice=Tn,i.issueTypeFieldsAttachmentReducer=qA,i.issueTypeFieldsAttachmentSlice=An,i.issueTypeFieldsReducer=uS,i.issueTypeFieldsSlice=wn,i.issueTypeIdentifierReducer=CS,i.issueTypeIdentifierSlice=gn,i.issueTypeIdentifierValueReducer=QS,i.issueTypeIdentifierValueSlice=_n,i.issueTypeReducer=hT,i.issueTypeSlice=Mn,i.issueTypeStatusReducer=gT,i.issueTypeStatusSlice=kn,i.issueTypeStatusSortFn=yc,i.issueUpdateReducer=zT,i.issueUpdateSlice=Vn,i.logOnlyOnce=mb,i.markAsDeleted=gw,i.markForDeletion=L_,i.memoize=ps,i.organizationAccessReducer=iw,i.organizationAccessSlice=Nn,i.organizationReducer=Ow,i.organizationSlice=Hn,i.outboxReducer=_w,i.outboxSlice=Gn,i.overmapEnhancer=_M,i.overmapReducer=TM,i.overmapReducers=Ag,i.performRequest=Ya,i.performRequestFromAction=Mg,i.projectAccessReducer=Cw,i.projectAccessSlice=Kn,i.projectAttachmentReducer=eO,i.projectAttachmentSlice=Zn,i.projectFileReducer=SO,i.projectFileSlice=Xn,i.projectReducer=RO,i.projectSlice=Qn,i.rehydratedReducer=VO,i.rehydratedSlice=xn,i.restructureSelectorWithArgs=S,i.runMiddleware=$g,i.saveActiveProjectFileBounds=mO,i.selectAccessToken=d_,i.selectAccessesByUserOfProject=H_,i.selectAccessibleProjects=J_,i.selectActiveOrganizationAccess=j_,i.selectActiveProjectFileId=Y_,i.selectAllDocumentAttachments=bi,i.selectAssetAttachmentById=Vc,i.selectAssetAttachmentMapping=Ec,i.selectAssetAttachments=Fs,i.selectAssetAttachmentsByIds=Bc,i.selectAssetById=Zl,i.selectAssetProcedureById=ld,i.selectAssetProcedureStepById=Wl,i.selectAssetProcedureStepFieldValues=It,i.selectAssetProcedureStepFieldValuesAttachmentById=rl,i.selectAssetProcedureStepFieldValuesAttachments=Gs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=dl,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=cl,i.selectAssetProcedureStepFieldValuesById=Il,i.selectAssetProcedureStepFieldValuesByIds=Fl,i.selectAssetProcedureStepFieldValuesMapping=Ol,i.selectAssetProcedureStepFieldValuesOfAsset=Ub,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Lb,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Nb,i.selectAssetProcedureStepFields=zt,i.selectAssetProcedureStepFieldsAttachmentById=Wd,i.selectAssetProcedureStepFieldsAttachments=$s,i.selectAssetProcedureStepFieldsAttachmentsByIds=qd,i.selectAssetProcedureStepFieldsAttachmentsMapping=zd,i.selectAssetProcedureStepFieldsById=Zd,i.selectAssetProcedureStepFieldsByIds=Jd,i.selectAssetProcedureStepFieldsMapping=Us,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=jb,i.selectAssetProcedureStepMapping=Wt,i.selectAssetProcedureSteps=Zs,i.selectAssetProcedureStepsByIds=ql,i.selectAssetProcedureStepsMappingOfAssetProcedureType=Hb,i.selectAssetProcedureStepsOfAssetProcedureType=Gb,i.selectAssetProcedureTypeAttachmentById=Zc,i.selectAssetProcedureTypeAttachmentMapping=Yc,i.selectAssetProcedureTypeAttachments=gs,i.selectAssetProcedureTypeAttachmentsByIds=Jc,i.selectAssetProcedureTypeById=Fd,i.selectAssetProcedureTypeFieldValues=Vt,i.selectAssetProcedureTypeFieldValuesAttachmentById=zr,i.selectAssetProcedureTypeFieldValuesAttachments=Es,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Wr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Br,i.selectAssetProcedureTypeFieldValuesById=Jr,i.selectAssetProcedureTypeFieldValuesByIds=Xr,i.selectAssetProcedureTypeFieldValuesMapping=Zr,i.selectAssetProcedureTypeFieldValuesOfAsset=Bb,i.selectAssetProcedureTypeFields=Et,i.selectAssetProcedureTypeFieldsAttachmentById=lr,i.selectAssetProcedureTypeFieldsAttachments=_s,i.selectAssetProcedureTypeFieldsAttachmentsByIds=or,i.selectAssetProcedureTypeFieldsAttachmentsMapping=dr,i.selectAssetProcedureTypeFieldsById=Fr,i.selectAssetProcedureTypeFieldsByIds=Pr,i.selectAssetProcedureTypeFieldsMapping=Ir,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=Eb,i.selectAssetProcedureTypes=Cs,i.selectAssetProcedureTypesByIds=Pd,i.selectAssetProcedureTypesMapping=Id,i.selectAssetProcedureTypesOfOrganization=qb,i.selectAssetProcedures=Bt,i.selectAssetProceduresByIds=od,i.selectAssetProceduresMapping=rd,i.selectAssetProceduresOfAssetProcedureType=dd,i.selectAssetProceduresOfAssetType=Wb,i.selectAssetStageById=go,i.selectAssetStageCompletionById=ho,i.selectAssetStageCompletionMapping=oo,i.selectAssetStageCompletions=uo,i.selectAssetStageCompletionsByIds=mo,i.selectAssetStages=si,i.selectAssetStagesByIds=bo,i.selectAssetStagesMappingOfAssetProcedureType=Yb,i.selectAssetStagesOfAssetProcedureType=Zb,i.selectAssetTypeAttachmentById=Wo,i.selectAssetTypeAttachmentMapping=zo,i.selectAssetTypeAttachments=ci,i.selectAssetTypeAttachmentsByIds=qo,i.selectAssetTypeById=bh,i.selectAssetTypeFieldValues=Ct,i.selectAssetTypeFieldValuesAttachmentById=Fu,i.selectAssetTypeFieldValuesAttachments=mi,i.selectAssetTypeFieldValuesAttachmentsByIds=Pu,i.selectAssetTypeFieldValuesAttachmentsMapping=Iu,i.selectAssetTypeFieldValuesById=Cu,i.selectAssetTypeFieldValuesByIds=ju,i.selectAssetTypeFieldValuesMapping=qu,i.selectAssetTypeFieldValuesOfAsset=xb,i.selectAssetTypeFields=Ft,i.selectAssetTypeFieldsAttachmentById=Xo,i.selectAssetTypeFieldsAttachments=di,i.selectAssetTypeFieldsAttachmentsByIds=Qo,i.selectAssetTypeFieldsAttachmentsMapping=Jo,i.selectAssetTypeFieldsById=uu,i.selectAssetTypeFieldsByIds=hu,i.selectAssetTypeFieldsMapping=ou,i.selectAssetTypeFieldsOfAssetType=Xb,i.selectAssetTypeIdentifierById=Qu,i.selectAssetTypeIdentifierMapping=Xu,i.selectAssetTypeIdentifierValueById=hh,i.selectAssetTypeIdentifierValueMapping=uh,i.selectAssetTypeIdentifierValues=jt,i.selectAssetTypeIdentifierValuesByIds=mh,i.selectAssetTypeIdentifierValuesOfAsset=s_,i.selectAssetTypeIdentifierValuesOfIdentifier=i_,i.selectAssetTypeIdentifiers=fi,i.selectAssetTypeIdentifiersByIds=xu,i.selectAssetTypeIdentifiersOfAssetType=t_,i.selectAssetTypeStatusById=$h,i.selectAssetTypeStatusMapping=jh,i.selectAssetTypeStatuses=Oi,i.selectAssetTypeStatusesByIds=Dh,i.selectAssetTypeStatusesOfAssetType=a_,i.selectAssetTypeValuesOfAssetType=e_,i.selectAssetTypes=Ti,i.selectAssetTypesByIds=_h,i.selectAssetTypesMapping=gh,i.selectAssetTypesOfOrganization=n_,i.selectAssets=qt,i.selectAssetsByIds=Jl,i.selectAssetsMapping=Kl,i.selectAssetsOfAssetType=Yl,i.selectAssetsOfProject=Kb,i.selectAttachmentsOfAsset=zc,i.selectAttachmentsOfAssetProcedureStepFieldValues=ll,i.selectAttachmentsOfAssetProcedureStepFields=Cb,i.selectAttachmentsOfAssetProcedureType=kb,i.selectAttachmentsOfAssetProcedureTypeFieldValues=qr,i.selectAttachmentsOfAssetProcedureTypeFields=vb,i.selectAttachmentsOfAssetType=Co,i.selectAttachmentsOfAssetTypeFieldValues=gu,i.selectAttachmentsOfAssetTypeFields=Jb,i.selectAttachmentsOfDocument=u_,i.selectAttachmentsOfFormRevision=T_,i.selectAttachmentsOfFormSubmission=wy,i.selectAttachmentsOfIssue=wf,i.selectAttachmentsOfIssueComment=F_,i.selectAttachmentsOfIssueType=b_,i.selectAttachmentsOfIssueTypeFieldValues=FS,i.selectAttachmentsOfIssueTypeFields=__,i.selectAttachmentsOfProject=K_,i.selectAttachmentsOfWorkflowStepComment=ua,i.selectAttachmentsOfWorkflowStepFieldValues=RF,i.selectAttachmentsOfWorkflowStepFields=xF,i.selectCategories=Fi,i.selectCategoriesByIds=im,i.selectCategoriesOfProject=o_,i.selectCategoryById=Pi,i.selectCategoryMapping=sm,i.selectCommentsOfIssue=P_,i.selectCommentsOfWorkflow=iF,i.selectCommentsOfWorkflowStep=rM,i.selectConversation=Rb,i.selectConversationMapping=Ts,i.selectConversations=Mb,i.selectCurrentUser=HT,i.selectDeletedRequests=D_,i.selectDescendantsOfAssetProcedureStep=Cl,i.selectDescendantsOfDocument=Em,i.selectDocumentAttachmentById=fm,i.selectDocumentAttachmentMapping=ym,i.selectDocumentAttachmentsByIds=Am,i.selectDocumentById=km,i.selectDocuments=Dt,i.selectDocumentsByIds=vm,i.selectDocumentsMapping=Mi,i.selectEmailDomainById=Nm,i.selectEmailDomains=ki,i.selectEmailDomainsAsMapping=Lm,i.selectEmailDomainsByIds=Hm,i.selectEmailDomainsOfOrganization=p_,i.selectFieldValuesOfAssetProcedure=zb,i.selectFormById=dy,i.selectFormIdentifierById=lp,i.selectFormIdentifierMapping=dp,i.selectFormIdentifierValueById=Fp,i.selectFormIdentifierValueMapping=Ip,i.selectFormIdentifierValues=Ut,i.selectFormIdentifierValuesByIds=Pp,i.selectFormIdentifierValuesOfFormSubmission=A_,i.selectFormIdentifierValuesOfIdentifier=S_,i.selectFormIdentifiers=Vi,i.selectFormIdentifiersByIds=op,i.selectFormIdentifiersOfForm=f_,i.selectFormMapping=ry,i.selectFormRevisionAttachmentById=qp,i.selectFormRevisionAttachments=Wp,i.selectFormRevisionAttachmentsByIds=Cp,i.selectFormRevisionAttachmentsMapping=Lt,i.selectFormRevisionById=Gp,i.selectFormRevisionMapping=Di,i.selectFormRevisions=Nt,i.selectFormRevisionsByIds=Kp,i.selectFormRevisionsOfForm=Yp,i.selectFormSubmissionAttachemntsByIds=Zi,i.selectFormSubmissionAttachmentById=Sy,i.selectFormSubmissionAttachments=Yi,i.selectFormSubmissionAttachmentsByIds=Ty,i.selectFormSubmissionAttachmentsMapping=Ki,i.selectFormSubmissionById=vy,i.selectFormSubmissions=ky,i.selectFormSubmissionsByIds=Ey,i.selectFormSubmissionsMapping=xi,i.selectFormSubmissionsOfForm=Vy,i.selectForms=Li,i.selectFormsByIds=ly,i.selectFormsOfOrganization=O_,i.selectGeoImageById=Gy,i.selectGeoImageMapping=Hy,i.selectGeoImages=tn,i.selectGeoImagesByIds=Ky,i.selectGeoImagesOfProject=I_,i.selectIsImportingProjectFile=Z_,i.selectIsLoggedIn=l_,i.selectIssueAssociationById=af,i.selectIssueAssociationMapping=Pt,i.selectIssueAssociations=nf,i.selectIssueAssociationsByIds=cf,i.selectIssueAssociationsOfAsset=lf,i.selectIssueAssociationsOfIssue=df,i.selectIssueAssociationsToIssue=rf,i.selectIssueAttachmentById=Of,i.selectIssueAttachmentMapping=Tf,i.selectIssueAttachments=rn,i.selectIssueAttachmentsByIds=If,i.selectIssueById=cA,i.selectIssueCommentAttachmentById=zf,i.selectIssueCommentAttachmentMapping=Bf,i.selectIssueCommentAttachments=ln,i.selectIssueCommentAttachmentsByIds=Wf,i.selectIssueCommentById=Yf,i.selectIssueCommentMapping=un,i.selectIssueCommentsByIds=Zf,i.selectIssueMapping=aA,i.selectIssueTypeAttachmentById=OA,i.selectIssueTypeAttachmentMapping=wA,i.selectIssueTypeAttachments=fn,i.selectIssueTypeAttachmentsByIds=IA,i.selectIssueTypeById=oT,i.selectIssueTypeFieldValues=Yt,i.selectIssueTypeFieldValuesAttachmentById=OS,i.selectIssueTypeFieldValuesAttachments=Pn,i.selectIssueTypeFieldValuesAttachmentsByIds=IS,i.selectIssueTypeFieldValuesAttachmentsMapping=wS,i.selectIssueTypeFieldValuesById=ZA,i.selectIssueTypeFieldValuesByIds=JA,i.selectIssueTypeFieldValuesMapping=YA,i.selectIssueTypeFieldValuesOfIssue=M_,i.selectIssueTypeFields=gt,i.selectIssueTypeFieldsAttachmentById=zA,i.selectIssueTypeFieldsAttachments=Sn,i.selectIssueTypeFieldsAttachmentsByIds=WA,i.selectIssueTypeFieldsAttachmentsMapping=BA,i.selectIssueTypeFieldsById=lS,i.selectIssueTypeFieldsByIds=oS,i.selectIssueTypeFieldsMapping=dS,i.selectIssueTypeFieldsOfIssueType=R_,i.selectIssueTypeIdentifierById=WS,i.selectIssueTypeIdentifierMapping=zS,i.selectIssueTypeIdentifierValueById=JS,i.selectIssueTypeIdentifierValueMapping=ZS,i.selectIssueTypeIdentifierValues=Zt,i.selectIssueTypeIdentifierValuesByIds=XS,i.selectIssueTypeIdentifierValuesOfIdentifier=B_,i.selectIssueTypeIdentifierValuesOfIssue=V_,i.selectIssueTypeIdentifiers=bn,i.selectIssueTypeIdentifiersByIds=qS,i.selectIssueTypeIdentifiersOfIssueType=E_,i.selectIssueTypeMapping=lT,i.selectIssueTypeStatusById=En,i.selectIssueTypeStatusMapping=FT,i.selectIssueTypeStatuses=vn,i.selectIssueTypeStatusesByIds=PT,i.selectIssueTypeStatusesOfIssueType=W_,i.selectIssueTypeValuesOfIssueType=v_,i.selectIssueTypes=Rn,i.selectIssueTypesByIds=uT,i.selectIssueTypesOfOrganization=z_,i.selectIssueUpdateById=ET,i.selectIssueUpdateMapping=Cn,i.selectIssueUpdates=jn,i.selectIssueUpdatesByIds=VT,i.selectIssueUpdatesOfIssue=BT,i.selectIssues=Kt,i.selectIssuesByIds=rA,i.selectIssuesOfIssueType=dA,i.selectIssuesOfProject=g_,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=$b,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Vb,i.selectLatestAssetTypeFieldsOfAssetType=Qb,i.selectLatestFieldsByAssetProcedureStep=Db,i.selectLatestFieldsByWorkflowStep=mM,i.selectLatestFormRevisionOfForm=w_,i.selectLatestIssueTypeFieldsOfIssueType=k_,i.selectLatestRetryTime=U_,i.selectLatestWorkflowStepFieldsOfWorkflowStep=hM,i.selectMembershipsByUserOfTeam=tM,i.selectOrganizationAccessById=nw,i.selectOrganizationAccessMapping=Qt,i.selectOrganizationAccessUserMapping=cw,i.selectOrganizationAccessesByIds=aw,i.selectOrganizationById=Tw,i.selectOrganizationDocuments=m_,i.selectOrganizations=Sw,i.selectOrganizationsByIds=ww,i.selectOrganizationsMapping=Aw,i.selectProjectAccessById=jw,i.selectProjectAccessMapping=Yn,i.selectProjectAccesses=bt,i.selectProjectAccessesByIds=$w,i.selectProjectAccessesOfProject=N_,i.selectProjectAttachmentById=Qw,i.selectProjectAttachmentMapping=Xw,i.selectProjectAttachments=Jn,i.selectProjectAttachmentsByIds=xw,i.selectProjectById=vO,i.selectProjectDocuments=h_,i.selectProjectFileById=fO,i.selectProjectFileMapping=pO,i.selectProjectFiles=yO,i.selectProjectFilesByIds=AO,i.selectProjectMapping=kO,i.selectProjects=xt,i.selectProjectsByIds=EO,i.selectProjectsOfOrganization=X_,i.selectRehydrated=eM,i.selectStageMapping=ti,i.selectTeamById=aI,i.selectTeamMembershipById=GO,i.selectTeamMemberships=es,i.selectTeamMembershipsByIds=KO,i.selectTeamMembershipsMapping=HO,i.selectTeams=sa,i.selectTeamsByIds=cI,i.selectTeamsMapping=nI,i.selectTeamsOfOrganization=iM,i.selectUploadUrl=Jm,i.selectUserById=Xt,i.selectUsers=Jt,i.selectUsersByIds=GT,i.selectUsersMapping=Ln,i.selectUsersOfOrganization=$_,i.selectUsersOfProject=G_,i.selectUsersOfTeam=sM,i.selectWorkflowById=AI,i.selectWorkflowMapping=fI,i.selectWorkflowStepAssigneeById=kI,i.selectWorkflowStepAssigneeMapping=RI,i.selectWorkflowStepAssignees=_t,i.selectWorkflowStepAssigneesByIds=vI,i.selectWorkflowStepAssigneesOfUser=cM,i.selectWorkflowStepAssigneesOfWorkflow=EI,i.selectWorkflowStepAssigneesOfWorkflowStep=aM,i.selectWorkflowStepById=QP,i.selectWorkflowStepCommentAttachmentById=LI,i.selectWorkflowStepCommentAttachmentMapping=UI,i.selectWorkflowStepCommentAttachments=oa,i.selectWorkflowStepCommentAttachmentsByIds=NI,i.selectWorkflowStepCommentById=tF,i.selectWorkflowStepCommentMapping=eF,i.selectWorkflowStepComments=ns,i.selectWorkflowStepCommentsByIds=sF,i.selectWorkflowStepCompletionById=pF,i.selectWorkflowStepCompletionMapping=mF,i.selectWorkflowStepCompletions=as,i.selectWorkflowStepCompletionsByIds=yF,i.selectWorkflowStepCompletionsOfWorkflow=fF,i.selectWorkflowStepCompletionsOfWorkflowStep=dM,i.selectWorkflowStepFieldValues=Mt,i.selectWorkflowStepFieldValuesAttachmentById=_F,i.selectWorkflowStepFieldValuesAttachments=Oa,i.selectWorkflowStepFieldValuesAttachmentsByIds=MF,i.selectWorkflowStepFieldValuesAttachmentsMapping=bF,i.selectWorkflowStepFieldValuesById=DF,i.selectWorkflowStepFieldValuesByIds=UF,i.selectWorkflowStepFieldValuesMapping=jF,i.selectWorkflowStepFieldValuesOfFieldsRevision=oM,i.selectWorkflowStepFieldValuesOfWorkflow=$F,i.selectWorkflowStepFieldValuesOfWorkflowStep=lM,i.selectWorkflowStepFields=cs,i.selectWorkflowStepFieldsAttachmentById=eP,i.selectWorkflowStepFieldsAttachments=Ma,i.selectWorkflowStepFieldsAttachmentsByIds=tP,i.selectWorkflowStepFieldsAttachmentsMapping=QF,i.selectWorkflowStepFieldsById=mP,i.selectWorkflowStepFieldsByIds=pP,i.selectWorkflowStepFieldsMapping=ka,i.selectWorkflowStepFieldsOfWorkflowStep=uM,i.selectWorkflowStepMapping=XP,i.selectWorkflowStepReviewById=CP,i.selectWorkflowStepReviewMapping=qP,i.selectWorkflowStepReviewRequestById=gP,i.selectWorkflowStepReviewRequestMapping=PP,i.selectWorkflowStepReviewRequests=rs,i.selectWorkflowStepReviewRequestsByIds=bP,i.selectWorkflowStepReviewRequestsOfWorkflow=_P,i.selectWorkflowStepReviewRequestsOfWorkflowStep=pM,i.selectWorkflowStepReviews=ds,i.selectWorkflowStepReviewsByIds=jP,i.selectWorkflowStepReviewsOfWorkflow=$P,i.selectWorkflowStepReviewsOfWorkflowStep=yM,i.selectWorkflowSteps=$a,i.selectWorkflowStepsByIds=eg,i.selectWorkflowStepsOfWorkflowType=xP,i.selectWorkflowTypeById=hg,i.selectWorkflowTypeMapping=ug,i.selectWorkflowTypes=Ua,i.selectWorkflowTypesByIds=mg,i.selectWorkflowTypesOfOrganization=fM,i.selectWorkflows=ts,i.selectWorkflowsByIds=SI,i.selectWorkflowsOfProject=nM,i.selectWorkflowsOfWorkflowType=TI,i.setActiveProjectFileId=hO,i.setAsset=Hl,i.setAssetAttachment=_c,i.setAssetAttachments=Mc,i.setAssetProcedure=nd,i.setAssetProcedureStep=_l,i.setAssetProcedureStepFieldValues=yl,i.setAssetProcedureStepFieldValuesAttachment=tl,i.setAssetProcedureStepFieldValuesAttachments=sl,i.setAssetProcedureStepFieldValuesMany=fl,i.setAssetProcedureStepFields=Ld,i.setAssetProcedureStepFieldsAttachment=Rd,i.setAssetProcedureStepFieldsAttachments=kd,i.setAssetProcedureStepFieldsMany=Nd,i.setAssetProcedureSteps=Ml,i.setAssetProcedureType=Td,i.setAssetProcedureTypeAttachment=Dc,i.setAssetProcedureTypeAttachments=Uc,i.setAssetProcedureTypeFieldValues=Ur,i.setAssetProcedureTypeFieldValuesAttachment=Mr,i.setAssetProcedureTypeFieldValuesAttachments=Rr,i.setAssetProcedureTypeFieldValuesMany=Lr,i.setAssetProcedureTypeFields=yr,i.setAssetProcedureTypeFieldsAttachment=tr,i.setAssetProcedureTypeFieldsAttachments=sr,i.setAssetProcedureTypeFieldsMany=fr,i.setAssetProcedureTypes=wd,i.setAssetProcedures=ad,i.setAssetStage=fo,i.setAssetStageCompletion=so,i.setAssetStageCompletions=io,i.setAssetStages=Ao,i.setAssetType=Ah,i.setAssetTypeAttachment=ko,i.setAssetTypeAttachments=vo,i.setAssetTypeFieldValues=vu,i.setAssetTypeFieldValuesAttachment=Au,i.setAssetTypeFieldValuesAttachments=Su,i.setAssetTypeFieldValuesMany=Eu,i.setAssetTypeFields=nu,i.setAssetTypeFieldsAttachment=No,i.setAssetTypeFieldsAttachments=Ho,i.setAssetTypeFieldsMany=au,i.setAssetTypeIdentifier=Hu,i.setAssetTypeIdentifierValue=ah,i.setAssetTypeIdentifierValues=ch,i.setAssetTypeIdentifiers=Gu,i.setAssetTypeStatus=Vh,i.setAssetTypeStatuses=Bh,i.setAssetTypes=Sh,i.setAssets=Gl,i.setCategories=Xh,i.setCategory=Jh,i.setClientSDK=zg,i.setClientStore=Vg,i.setConversation=Oc,i.setConversations=Pb,i.setCurrentUser=q_,i.setDocument=Fm,i.setDocumentAttachment=lm,i.setDocumentAttachments=om,i.setDocuments=Pm,i.setEmailDomain=qm,i.setEmailDomains=Cm,i.setForm=ey,i.setFormIdentifier=sp,i.setFormIdentifierValue=fp,i.setFormIdentifierValues=Ap,i.setFormIdentifiers=ip,i.setFormRevision=Up,i.setFormRevisionAttachment=kp,i.setFormRevisionAttachments=vp,i.setFormRevisions=Lp,i.setFormSubmission=Py,i.setFormSubmissionAttachment=my,i.setFormSubmissionAttachments=py,i.setFormSubmissions=gy,i.setForms=ty,i.setGeoImage=qy,i.setGeoImages=Cy,i.setIsImportingProjectFile=uO,i.setIssue=eA,i.setIssueAssociation=Qy,i.setIssueAssociations=Xy,i.setIssueAttachment=pf,i.setIssueAttachments=yf,i.setIssueComment=Uf,i.setIssueCommentAttachment=Mf,i.setIssueCommentAttachments=Rf,i.setIssueComments=Lf,i.setIssueType=iT,i.setIssueTypeAttachment=pA,i.setIssueTypeAttachments=yA,i.setIssueTypeFieldValues=UA,i.setIssueTypeFieldValuesAttachment=yS,i.setIssueTypeFieldValuesAttachments=fS,i.setIssueTypeFieldValuesMany=LA,i.setIssueTypeFields=sS,i.setIssueTypeFieldsAttachment=MA,i.setIssueTypeFieldsAttachments=RA,i.setIssueTypeFieldsMany=iS,i.setIssueTypeIdentifier=RS,i.setIssueTypeIdentifierValue=LS,i.setIssueTypeIdentifierValues=NS,i.setIssueTypeIdentifiers=kS,i.setIssueTypeStatus=AT,i.setIssueTypeStatuses=ST,i.setIssueTypes=nT,i.setIssueUpdate=MT,i.setIssueUpdates=RT,i.setIssues=tA,i.setLoggedIn=Nh,i.setOrganization=ow,i.setOrganizationAccess=XT,i.setOrganizationAccesses=QT,i.setOrganizations=lw,i.setProfilePicture=C_,i.setProject=IO,i.setProjectAccess=Ew,i.setProjectAccesses=Vw,i.setProjectAttachment=Hw,i.setProjectAttachments=Gw,i.setProjectFile=iO,i.setProjectFiles=nO,i.setProjects=OO,i.setRehydrated=x_,i.setTeam=QO,i.setTeamMembership=CO,i.setTeamMemberships=jO,i.setTeams=xO,i.setTokens=c_,i.setUploadUrl=Zm,i.setUser=jT,i.setUsers=CT,i.setWorkflow=uI,i.setWorkflowStep=HP,i.setWorkflowStepAssignee=PI,i.setWorkflowStepAssignees=gI,i.setWorkflowStepComment=ZI,i.setWorkflowStepCommentAttachment=qI,i.setWorkflowStepCommentAttachments=CI,i.setWorkflowStepComments=JI,i.setWorkflowStepCompletion=dF,i.setWorkflowStepCompletions=lF,i.setWorkflowStepFieldValues=BF,i.setWorkflowStepFieldValuesAttachment=OF,i.setWorkflowStepFieldValuesAttachments=IF,i.setWorkflowStepFieldValuesMany=zF,i.setWorkflowStepFields=rP,i.setWorkflowStepFieldsAttachment=KF,i.setWorkflowStepFieldsAttachments=YF,i.setWorkflowStepFieldsMany=dP,i.setWorkflowStepReview=EP,i.setWorkflowStepReviewRequest=TP,i.setWorkflowStepReviewRequests=wP,i.setWorkflowStepReviews=VP,i.setWorkflowSteps=GP,i.setWorkflowType=ag,i.setWorkflowTypes=cg,i.setWorkflows=hI,i.shallowEqual=tb,i.slugify=Ab,i.spacesToDashesLower=fb,i.teamMembershipReducer=NO,i.teamMembershipSlice=ea,i.teamReducer=rI,i.teamSlice=ta,i.toFileNameSafeString=yb,i.toUuidArray=z,i.toUuidIdRecord=pb,i.truncate=Sb,i.updateAsset=Ul,i.updateAssetAttachment=Rc,i.updateAssetAttachments=kc,i.updateAssetProcedure=td,i.updateAssetProcedureStep=vl,i.updateAssetProcedureStepFieldValues=Al,i.updateAssetProcedureStepFieldValuesAttachment=il,i.updateAssetProcedureStepFieldValuesAttachments=nl,i.updateAssetProcedureStepFieldValuesMany=Sl,i.updateAssetProcedureStepFields=Hd,i.updateAssetProcedureStepFieldsAttachment=vd,i.updateAssetProcedureStepFieldsAttachments=Ed,i.updateAssetProcedureStepFieldsMany=Gd,i.updateAssetProcedureSteps=El,i.updateAssetProcedureType=yd,i.updateAssetProcedureTypeAttachment=Lc,i.updateAssetProcedureTypeAttachments=Nc,i.updateAssetProcedureTypeFieldValues=Nr,i.updateAssetProcedureTypeFieldValuesAttachment=kr,i.updateAssetProcedureTypeFieldValuesAttachments=vr,i.updateAssetProcedureTypeFieldValuesMany=Hr,i.updateAssetProcedureTypeFields=Ar,i.updateAssetProcedureTypeFieldsAttachment=ir,i.updateAssetProcedureTypeFieldsAttachments=nr,i.updateAssetProcedureTypeFieldsMany=Sr,i.updateAssetProcedureTypes=fd,i.updateAssetProcedures=sd,i.updateAssetStage=wo,i.updateAssetStageCompletion=no,i.updateAssetStageCompletions=ao,i.updateAssetStages=Oo,i.updateAssetType=Oh,i.updateAssetTypeAttachment=Eo,i.updateAssetTypeAttachments=Vo,i.updateAssetTypeFieldValues=Vu,i.updateAssetTypeFieldValuesAttachment=Tu,i.updateAssetTypeFieldValuesAttachments=wu,i.updateAssetTypeFieldValuesMany=Bu,i.updateAssetTypeFields=cu,i.updateAssetTypeFieldsAttachment=Go,i.updateAssetTypeFieldsAttachments=Ko,i.updateAssetTypeFieldsMany=ru,i.updateAssetTypeIdentifier=Ku,i.updateAssetTypeIdentifierValue=rh,i.updateAssetTypeIdentifierValues=dh,i.updateAssetTypeIdentifiers=Yu,i.updateAssetTypeStatus=zh,i.updateAssetTypeStatuses=Wh,i.updateAssetTypes=Ih,i.updateAssets=Ll,i.updateCategories=xh,i.updateCategory=Qh,i.updateConversation=Ic,i.updateConversations=gb,i.updateDocument=gm,i.updateDocumentAttachment=um,i.updateDocumentAttachments=hm,i.updateDocuments=bm,i.updateEmailDomain=jm,i.updateEmailDomains=$m,i.updateForm=sy,i.updateFormIdentifier=np,i.updateFormIdentifierValue=Sp,i.updateFormIdentifierValues=Tp,i.updateFormIdentifiers=ap,i.updateFormRevision=Np,i.updateFormRevisionAttachment=Ep,i.updateFormRevisionAttachments=Vp,i.updateFormRevisions=Hp,i.updateFormSubmission=_y,i.updateFormSubmissionAttachment=yy,i.updateFormSubmissionAttachments=fy,i.updateFormSubmissions=My,i.updateForms=iy,i.updateGeoImage=Dy,i.updateGeoImages=Uy,i.updateIssue=sA,i.updateIssueAssociation=xy,i.updateIssueAssociations=ef,i.updateIssueAttachment=ff,i.updateIssueAttachments=Af,i.updateIssueComment=Nf,i.updateIssueCommentAttachment=kf,i.updateIssueCommentAttachments=vf,i.updateIssueComments=Hf,i.updateIssueType=aT,i.updateIssueTypeAttachment=fA,i.updateIssueTypeAttachments=AA,i.updateIssueTypeFieldValues=NA,i.updateIssueTypeFieldValuesAttachment=AS,i.updateIssueTypeFieldValuesAttachments=SS,i.updateIssueTypeFieldValuesMany=HA,i.updateIssueTypeFields=nS,i.updateIssueTypeFieldsAttachment=kA,i.updateIssueTypeFieldsAttachments=vA,i.updateIssueTypeFieldsMany=aS,i.updateIssueTypeIdentifier=vS,i.updateIssueTypeIdentifierValue=HS,i.updateIssueTypeIdentifierValues=GS,i.updateIssueTypeIdentifiers=ES,i.updateIssueTypeStatus=TT,i.updateIssueTypeStatuses=wT,i.updateIssueTypes=cT,i.updateIssueUpdate=kT,i.updateIssueUpdates=vT,i.updateIssues=iA,i.updateOrganization=pw,i.updateOrganizationAccess=xT,i.updateOrganizationAccesses=ew,i.updateOrganizations=mw,i.updateProject=bO,i.updateProjectAccess=Bw,i.updateProjectAccesses=zw,i.updateProjectAttachment=Kw,i.updateProjectAttachments=Yw,i.updateProjectFile=rO,i.updateProjectFiles=dO,i.updateProjects=gO,i.updateTeam=eI,i.updateTeamMembership=$O,i.updateTeamMemberships=DO,i.updateTeams=tI,i.updateUser=UT,i.updateUsers=DT,i.updateWorkflow=mI,i.updateWorkflowStep=KP,i.updateWorkflowStepAssignee=bI,i.updateWorkflowStepAssignees=_I,i.updateWorkflowStepComment=XI,i.updateWorkflowStepCommentAttachment=jI,i.updateWorkflowStepCommentAttachments=$I,i.updateWorkflowStepComments=QI,i.updateWorkflowStepCompletion=oF,i.updateWorkflowStepCompletions=uF,i.updateWorkflowStepFieldValues=WF,i.updateWorkflowStepFieldValuesAttachment=FF,i.updateWorkflowStepFieldValuesAttachments=PF,i.updateWorkflowStepFieldValuesMany=qF,i.updateWorkflowStepFields=lP,i.updateWorkflowStepFieldsAttachment=ZF,i.updateWorkflowStepFieldsAttachments=JF,i.updateWorkflowStepFieldsMany=oP,i.updateWorkflowStepReview=BP,i.updateWorkflowStepReviewRequest=OP,i.updateWorkflowStepReviewRequests=IP,i.updateWorkflowStepReviews=zP,i.updateWorkflowSteps=YP,i.updateWorkflowType=rg,i.updateWorkflowTypes=dg,i.updateWorkflows=pI,i.useSelectorBuilder=eb,i.userReducer=NT,i.userSlice=$n,i.uuidObj=_,i.uuidObjSortFn=As,i.uuidSortFn=vt,i.versioningReducer=fg,i.versioningSlice=yg,i.workflowReducer=wI,i.workflowSlice=ia,i.workflowStepAssigneeReducer=VI,i.workflowStepAssigneeSlice=ca,i.workflowStepCommentAttachmentReducer=HI,i.workflowStepCommentAttachmentSlice=la,i.workflowStepCommentReducer=nF,i.workflowStepCommentSlice=ha,i.workflowStepCompletionReducer=AF,i.workflowStepCompletionSlice=ya,i.workflowStepFieldValuesAttachmentReducer=kF,i.workflowStepFieldValuesAttachmentSlice=Sa,i.workflowStepFieldValuesReducer=LF,i.workflowStepFieldValuesSlice=Ia,i.workflowStepFieldsAttachmentReducer=sP,i.workflowStepFieldsAttachmentSlice=ga,i.workflowStepFieldsReducer=yP,i.workflowStepFieldsSlice=Ra,i.workflowStepReducer=JP,i.workflowStepReviewReducer=DP,i.workflowStepReviewRequestReducer=MP,i.workflowStepReviewRequestSlice=va,i.workflowStepReviewSlice=Ba,i.workflowStepSlice=qa,i.workflowTypeReducer=pg,i.workflowTypeSlice=Da,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|