@overmap-ai/core 1.0.79-project-folder.1 → 1.0.80-clean-ups.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/README.md +0 -0
- package/dist/constants/array.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/offline.d.ts +2 -0
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +2 -1
- package/dist/enums/issue.d.ts +14 -13
- package/dist/enums/procedures.d.ts +11 -0
- package/dist/overmap-core.js +11108 -8624
- package/dist/overmap-core.umd.cjs +10 -11
- package/dist/sdk/base.d.ts +6 -2
- package/dist/sdk/constants.d.ts +3 -3
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/performRequest.d.ts +6 -0
- package/dist/sdk/services/AgentService.d.ts +1 -0
- package/dist/sdk/services/AssetAttachmentService.d.ts +23 -24
- package/dist/sdk/services/AssetCommentService.d.ts +28 -0
- package/dist/sdk/services/AssetService.d.ts +22 -4
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +23 -24
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +26 -8
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +21 -9
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +26 -9
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +19 -2
- package/dist/sdk/services/AssetTypeIdentifierService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeIdentifierValueService.d.ts +22 -5
- package/dist/sdk/services/AssetTypeService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/BaseModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseOfflineFileModelApiService.d.ts +17 -0
- package/dist/sdk/services/BaseOfflineModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseService.d.ts +6 -4
- package/dist/sdk/services/DocumentAttachmentService.d.ts +25 -24
- package/dist/sdk/services/DocumentService.d.ts +21 -4
- package/dist/sdk/services/EmailDomainsService.d.ts +20 -3
- package/dist/sdk/services/FileService.d.ts +7 -25
- package/dist/sdk/services/FormIdentifierService.d.ts +20 -3
- package/dist/sdk/services/FormIdentifierValueService.d.ts +20 -4
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +26 -9
- package/dist/sdk/services/FormRevisionService.d.ts +19 -2
- package/dist/sdk/services/FormService.d.ts +23 -4
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +26 -9
- package/dist/sdk/services/FormSubmissionService.d.ts +20 -3
- package/dist/sdk/services/GeoImageService.d.ts +27 -7
- package/dist/sdk/services/IssueAssociationService.d.ts +22 -4
- package/dist/sdk/services/IssueAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueCommentService.d.ts +21 -4
- package/dist/sdk/services/IssueService.d.ts +23 -4
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +26 -9
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +26 -9
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeIdentifierService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeIdentifierValueService.d.ts +20 -4
- package/dist/sdk/services/IssueTypePriorityService.d.ts +28 -0
- package/dist/sdk/services/IssueTypeService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/IssueUpdateService.d.ts +173 -2
- package/dist/sdk/services/OrganizationAccessService.d.ts +20 -3
- package/dist/sdk/services/OrganizationService.d.ts +19 -2
- package/dist/sdk/services/ProcdureInitiativeService.d.ts +28 -0
- package/dist/sdk/services/ProcedureFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/ProcedureFieldValuesService.d.ts +29 -0
- package/dist/sdk/services/ProcedureService.d.ts +30 -0
- package/dist/sdk/services/ProcedureStepAssigneeService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepCommentService.d.ts +28 -0
- package/dist/sdk/services/ProcedureStepDefaultAssigneeService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepDefaultReviewerService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepEventService.d.ts +24 -0
- package/dist/sdk/services/ProcedureStepFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/ProcedureStepFieldValuesReviewService.d.ts +28 -0
- package/dist/sdk/services/ProcedureStepFieldValuesService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureStepFieldsService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepReviewerService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepService.d.ts +28 -0
- package/dist/sdk/services/ProcedureTypeAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureTypeFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureTypeFieldsService.d.ts +26 -0
- package/dist/sdk/services/ProcedureTypeService.d.ts +28 -0
- package/dist/sdk/services/ProjectAccessService.d.ts +22 -5
- package/dist/sdk/services/ProjectAttachmentService.d.ts +23 -24
- package/dist/sdk/services/ProjectCommentService.d.ts +28 -0
- package/dist/sdk/services/ProjectFileService.d.ts +28 -7
- package/dist/sdk/services/ProjectService.d.ts +21 -4
- package/dist/sdk/services/TeamMembershipService.d.ts +19 -2
- package/dist/sdk/services/TeamService.d.ts +20 -3
- package/dist/sdk/services/UserService.d.ts +23 -2
- package/dist/sdk/services/index.d.ts +28 -16
- package/dist/sdk/typings.d.ts +46 -61
- package/dist/sdk/utils.d.ts +3 -0
- package/dist/store/adapters/modelAdapter.d.ts +13 -14
- package/dist/store/adapters/selectionAdapter.d.ts +9 -10
- package/dist/store/adapters/typings.d.ts +20 -3
- package/dist/store/constants.d.ts +0 -1
- package/dist/store/reducers.d.ts +75 -51
- 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 +10 -37
- package/dist/store/slices/assetAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetCommentSlice.d.ts +23 -0
- package/dist/store/slices/assetSlice.d.ts +36 -55
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +35 -54
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +35 -53
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +35 -53
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +35 -53
- package/dist/store/slices/assetTypeIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeSlice.d.ts +11 -38
- package/dist/store/slices/assetTypeStatusSlice.d.ts +119 -0
- package/dist/store/slices/documentAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/documentSlice.d.ts +17 -24
- package/dist/store/slices/emailDomainsSlice.d.ts +38 -55
- package/dist/store/slices/fileSlice.d.ts +0 -3
- package/dist/store/slices/formIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/formIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +109 -36
- package/dist/store/slices/formRevisionSlice.d.ts +35 -53
- package/dist/store/slices/formSlice.d.ts +35 -53
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/formSubmissionSlice.d.ts +19 -37
- package/dist/store/slices/geoImageSlice.d.ts +35 -53
- package/dist/store/slices/index.d.ts +25 -17
- package/dist/store/slices/issueAssociationSlice.d.ts +37 -54
- package/dist/store/slices/issueAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/issueCommentAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/issueCommentSlice.d.ts +10 -36
- package/dist/store/slices/issueSlice.d.ts +10 -37
- package/dist/store/slices/issueTypeAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +35 -54
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +35 -53
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +35 -53
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +35 -53
- package/dist/store/slices/issueTypeIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/issueTypePrioritySlice.d.ts +119 -0
- package/dist/store/slices/issueTypeSlice.d.ts +11 -42
- package/dist/store/slices/issueTypeStatusSlice.d.ts +119 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +243 -37
- package/dist/store/slices/organizationAccessSlice.d.ts +10 -36
- package/dist/store/slices/organizationSlice.d.ts +35 -53
- package/dist/store/slices/outboxSlice.d.ts +6 -7
- package/dist/store/slices/procedureFieldValuesSlice.d.ts +119 -0
- package/dist/store/slices/procedureInitiativeSlice.d.ts +23 -0
- package/dist/store/slices/procedureSlice.d.ts +26 -0
- package/dist/store/slices/procedureStepAssigneeSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepCommentSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepDefaultAssigneeSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepDefaultReviewerSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepEventSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepFieldValuesAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepFieldValuesReviewSlice.d.ts +123 -0
- package/dist/store/slices/procedureStepFieldValuesSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepFieldsAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepFieldsSlice.d.ts +218 -0
- package/dist/store/slices/procedureStepReviewerSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepSlice.d.ts +120 -0
- package/dist/store/slices/procedureTypeAttachmentSlice.d.ts +99 -0
- package/dist/store/slices/procedureTypeFieldValuesAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureTypeFieldsAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureTypeFieldsSlice.d.ts +23 -0
- package/dist/store/slices/procedureTypeSlice.d.ts +22 -0
- package/dist/store/slices/projectAccessSlice.d.ts +10 -36
- package/dist/store/slices/projectAttachmentSlice.d.ts +12 -38
- package/dist/store/slices/projectCommentSlice.d.ts +23 -0
- package/dist/store/slices/projectFileSlice.d.ts +37 -69
- package/dist/store/slices/projectSlice.d.ts +35 -53
- package/dist/store/slices/teamMembershipSlice.d.ts +10 -36
- package/dist/store/slices/teamSlice.d.ts +10 -37
- package/dist/store/slices/userSlice.d.ts +38 -63
- package/dist/store/store.d.ts +7 -14
- package/dist/store/typings.d.ts +18 -1
- package/dist/typings/index.d.ts +0 -1
- package/dist/typings/models/agents.d.ts +1 -2
- package/dist/typings/models/assets.d.ts +18 -67
- package/dist/typings/models/base.d.ts +19 -4
- package/dist/typings/models/documents.d.ts +4 -6
- package/dist/typings/models/fields.d.ts +4 -4
- package/dist/typings/models/forms.d.ts +10 -2
- package/dist/typings/models/geoImages.d.ts +7 -8
- package/dist/typings/models/index.d.ts +1 -1
- package/dist/typings/models/issues.d.ts +47 -32
- package/dist/typings/models/procedures.d.ts +105 -0
- package/dist/typings/models/projects.d.ts +11 -11
- package/dist/typings/models/teams.d.ts +2 -3
- package/dist/typings/models/users.d.ts +1 -3
- package/dist/utils/file.d.ts +7 -12
- package/dist/utils/models/assets.d.ts +2 -4
- package/dist/utils/models/base.d.ts +2 -0
- package/dist/utils/models/documents.d.ts +4 -0
- package/dist/utils/models/index.d.ts +3 -1
- package/dist/utils/models/issues.d.ts +3 -0
- package/dist/utils/optimization.d.ts +0 -1
- package/dist/utils/utils.d.ts +0 -8
- package/dist/utils/uuid.d.ts +2 -1
- package/package.json +35 -42
- package/dist/constants/defaults.d.ts +0 -3
- package/dist/enums/attachments.d.ts +0 -7
- package/dist/sdk/services/AssetProcedureService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +0 -16
- package/dist/sdk/services/AssetProcedureStepFieldValuesService.d.ts +0 -23
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +0 -13
- package/dist/sdk/services/AssetProcedureStepFieldsService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureStepService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +0 -31
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +0 -16
- package/dist/sdk/services/AssetProcedureTypeFieldValuesService.d.ts +0 -22
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +0 -13
- package/dist/sdk/services/AssetProcedureTypeFieldsService.d.ts +0 -9
- package/dist/sdk/services/AssetProcedureTypeService.d.ts +0 -11
- package/dist/sdk/services/AssetStageCompletionService.d.ts +0 -12
- package/dist/sdk/services/AssetStageService.d.ts +0 -11
- package/dist/sdk/services/BaseAttachmentService.d.ts +0 -32
- package/dist/sdk/services/BaseUploadService.d.ts +0 -10
- package/dist/sdk/services/CategoryService.d.ts +0 -11
- package/dist/sdk/services/ProjectFolderService.d.ts +0 -11
- package/dist/store/migrations.d.ts +0 -2
- package/dist/store/slices/assetProcedureSlice.d.ts +0 -139
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +0 -139
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +0 -228
- package/dist/store/slices/assetProcedureStepSlice.d.ts +0 -140
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +0 -48
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureTypeFieldsSlice.d.ts +0 -49
- package/dist/store/slices/assetProcedureTypeSlice.d.ts +0 -49
- package/dist/store/slices/assetStageCompletionSlice.d.ts +0 -137
- package/dist/store/slices/assetStageSlice.d.ts +0 -139
- package/dist/store/slices/categorySlice.d.ts +0 -138
- package/dist/store/slices/projectFolderSlice.d.ts +0 -138
- package/dist/store/slices/versioningSlice.d.ts +0 -8
- package/dist/typings/files.d.ts +0 -26
- package/dist/typings/models/categories.d.ts +0 -7
- package/dist/utils/forms.d.ts +0 -2
- package/dist/utils/models/projectFolders.d.ts +0 -4
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
(function(s,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),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","fast-tree-builder","ts-tree-lib","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"],z):(s=typeof globalThis<"u"?globalThis:s||self,z(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.buildTree,s.tsTreeLib,s.react,s.reduxOffline,s.offlineConfig,null,s.localforage,s.createMigration,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,z,d,Je,Xe,sy,un,Rt,iy,ay,on,eP,cy,ny,tP,ry,dy,uy){"use strict";var QF=Object.defineProperty;var xF=(s,z,d)=>z in s?QF(s,z,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[z]=d;var S=(s,z,d)=>xF(s,typeof z!="symbol"?z+"":z,d);var ty;const ln=Object.freeze([]),hn=Object.freeze({}),mn=Object.freeze(new Set);var pn=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(pn||{}),l=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(l||{}),yn=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(yn||{}),ts=(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))(ts||{}),ss=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(ss||{}),E=(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))(E||{});const oy=ss.BACKLOG,ly=ts.MEDIUM,An=6e4;function P(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const I of y.payload){const b=t(I);f.add(b),p.instances[b]=I}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function hy(){return{initializeSelection:(m,o)=>{m.selection=Array.from(new Set(o.payload))},selectOne:(m,o)=>{new Set(m.selection).has(o.payload)||m.selection.push(o.payload)},selectMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)||h.add(p);m.selection=Array.from(h)},unselectOne:(m,o)=>{const h=new Set(m.selection);h.has(o.payload)&&(h.delete(o.payload),m.selection=Array.from(h))},unselectMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)&&h.delete(p);m.selection=Array.from(h)},toggleOne:(m,o)=>{const h=new Set(m.selection);h.has(o.payload)?h.delete(o.payload):h.add(o.payload),m.selection=Array.from(h)},toggleMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)?h.delete(p):h.add(p);m.selection=Array.from(h)},getInitialState:m=>({...m,selection:[]})}}const it="versioning",g=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),_=d.createAction("RESET_ORGANIZATION_STATE");ty=Symbol.toStringTag;class fn{constructor(){S(this,ty,"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")}}let is=!1;["true","1"].includes("".toLowerCase())&&(is=!0);function my(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 as(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(is&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(is&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function py(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 T=t=>t.length===0?ln:t,vt=t=>Object.keys(t).length===0?hn:t,yy=t=>t.size===0?mn:t,Sn=as(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===cs.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),Ay=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),fy=1e3*86400,cs=new Date,Sy=t=>new Date(t).toDateString()===cs.toDateString(),Ty=as((t,e,i)=>{const a=Math.round((new Date(t).getTime()-cs.getTime())/fy);return a<e||a>i?Sn(t):Ay.format(a,"days")});function gy(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const ns=async(t,e)=>{e||(e=await Qe(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 Qe(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=gy(n);e(r)})},a.readAsArrayBuffer(t)})}function Iy(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 Tn(t,e){return new File([t],e,{type:t.type})}function by(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 Fy=async t=>{const e={};for(const i of t){const a=await Qe(i);e[a]={sha1:a,extension:i.name.split(".").pop()||"",file_type:i.type,size:i.size}}return Object.values(e)},gn=async t=>(await fetch(t)).blob(),Py=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 _y(t){const e=new Blob([t]);sy.saveAs(e,t.name)}const In={};function Oy(t,e,i,...a){const c=In[t];let n=!1;c?c[e]||(c[e]=!0,n=!0):(In[t]={[e]:!0},n=!0),n&&console[i](...a)}const bn=["created_at","updated_at","index","revision"];function F(t){return{...t,uuid:Xe.v4()}}function Fn(t){const e={};for(const i of t)e[i.uuid]=i;return e}function Pn(t){return t.map(({uuid:e})=>e)}function Ry(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 vy(t){return t.toLowerCase().replace(" ","-")}function wy(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function My(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const A=t=>e=>i=>t(i,e);function _n(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function Ey(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const jy=/^.+@.+\..+$/;function v(t){const e={...t};for(const i of[...bn,"created_by"])i in e&&delete e[i];return e}const On=t=>{const e=t.toSorted((i,a)=>i.order-a.order);return un(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Vy=t=>{const{roots:e}=On(t);return e.map(i=>new Rt.Tree(i))},Rn=(t,e)=>{const{nodes:i}=On(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Rt.Tree(a)},vn=t=>{const e=t.toSorted((i,a)=>i.name.localeCompare(a.name));return un(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},qy=t=>{const{roots:e}=vn(t);return e.map(i=>new Rt.Tree(i))},zy=(t,e)=>{const{nodes:i}=vn(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in project folder tree.`);return new Rt.Tree(a)},C=P(t=>t.uuid),wn=C.getInitialState({}),rs=d.createSlice({name:"agents",initialState:wn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,wn)),reducers:{initializeConversations:C.initialize,addConversation:C.addOne,addConversations:C.addMany,setConversation:C.setOne,setConversations:C.setMany,updateConversation:C.updateOne,updateConversations:C.updateMany,deleteConversation:C.deleteOne,deleteConversations:C.deleteMany}}),{initializeConversations:Mn,addConversation:En,addConversations:Dy,setConversation:jn,setConversations:Uy,updateConversation:Vn,updateConversations:Cy,deleteConversation:ky,deleteConversations:By}=rs.actions,ds=t=>t.agentsReducer.instances,$y=d.createSelector([ds],t=>Object.values(t)),Gy=A(d.createSelector([ds,(t,e)=>e],(t,e)=>t[e])),qn=rs.reducer,k=P(t=>t.uuid),zn=k.getInitialState({}),us=d.createSlice({name:"assetAttachments",initialState:zn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,zn)),reducers:{initializeAssetAttachments:k.initialize,addAssetAttachment:k.addOne,addAssetAttachments:k.addMany,setAssetAttachment:k.setOne,setAssetAttachments:k.setMany,updateAssetAttachment:k.updateOne,updateAssetAttachments:k.updateMany,deleteAssetAttachment:k.deleteOne,deleteAssetAttachments:k.deleteMany}}),{initializeAssetAttachments:os,addAssetAttachment:Ly,addAssetAttachments:ls,setAssetAttachment:Dn,setAssetAttachments:Ny,updateAssetAttachment:Hy,updateAssetAttachments:Un,deleteAssetAttachment:Cn,deleteAssetAttachments:hs}=us.actions,kn=t=>t.assetAttachmentReducer.instances,Bn=d.createSelector([kn],t=>Object.values(t)),$n=t=>e=>e.assetAttachmentReducer.instances[t],Gn=A(d.createSelector([Bn,(t,e)=>e],(t,e)=>T(t.filter(({asset:i})=>e===i)))),Ln=us.reducer,B=P(({uuid:t})=>t),Nn=B.getInitialState({}),ms=d.createSlice({name:"assetProcedureTypeAttachments",initialState:Nn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Nn)),reducers:{initializeAssetProcedureTypeAttachments:B.initialize,addAssetProcedureTypeAttachment:B.addOne,addAssetProcedureTypeAttachments:B.addMany,setAssetProcedureTypeAttachment:B.setOne,setAssetProcedureTypeAttachments:B.setMany,updateAssetProcedureTypeAttachment:B.updateOne,updateAssetProcedureTypeAttachments:B.updateMany,deleteAssetProcedureTypeAttachment:B.deleteOne,deleteAssetProcedureTypeAttachments:B.deleteMany}}),{initializeAssetProcedureTypeAttachments:ps,addAssetProcedureTypeAttachment:Wy,addAssetProcedureTypeAttachments:Hn,setAssetProcedureTypeAttachment:Wn,setAssetProcedureTypeAttachments:Ky,updateAssetProcedureTypeAttachment:Yy,updateAssetProcedureTypeAttachments:Kn,deleteAssetProcedureTypeAttachment:Yn,deleteAssetProcedureTypeAttachments:Zn}=ms.actions,Jn=ms.reducer,Xn=t=>t.assetProcedureTypeAttachmentReducer.instances,Qn=d.createSelector([Xn],t=>Object.values(t)),xn=t=>e=>e.assetProcedureTypeAttachmentReducer.instances[t],Zy=A(d.createSelector([Qn,(t,e)=>e],(t,e)=>T(t.filter(({asset_procedure_type:i})=>e===i)))),$=P(({uuid:t})=>t),er=$.getInitialState({}),ys=d.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:er,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,er)),reducers:{initializeAssetProcedureTypeFieldsAttachments:$.initialize,addAssetProcedureTypeFieldsAttachment:$.addOne,addAssetProcedureTypeFieldsAttachments:$.addMany,setAssetProcedureTypeFieldsAttachment:$.setOne,setAssetProcedureTypeFieldsAttachments:$.setMany,updateAssetProcedureTypeFieldsAttachment:$.updateOne,updateAssetProcedureTypeFieldsAttachments:$.updateMany,deleteAssetProcedureTypeFieldsAttachment:$.deleteOne,deleteAssetProcedureTypeFieldsAttachments:$.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:tr,addAssetProcedureTypeFieldsAttachment:Jy,addAssetProcedureTypeFieldsAttachments:sr,setAssetProcedureTypeFieldsAttachment:Xy,setAssetProcedureTypeFieldsAttachments:Qy,updateAssetProcedureTypeFieldsAttachment:xy,updateAssetProcedureTypeFieldsAttachments:ir,deleteAssetProcedureTypeFieldsAttachment:eA,deleteAssetProcedureTypeFieldsAttachments:ar}=ys.actions,cr=ys.reducer,nr=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,rr=d.createSelector([nr],t=>Object.values(t)),tA=A(d.createSelector([rr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),sA=t=>e=>e.assetProcedureTypeFieldsAttachmentReducer.instances[t],G=P(({uuid:t})=>t),dr=G.getInitialState({}),As=d.createSlice({name:"assetProcedureTypeFields",initialState:dr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,dr)),reducers:{initializeAssetProcedureTypeFields:G.initialize,addAssetProcedureTypeFields:G.addOne,addAssetProcedureTypeFieldsMany:G.addMany,setAssetProcedureTypeFields:G.setOne,setAssetProcedureTypeFieldsMany:G.setMany,updateAssetProcedureTypeFields:G.updateOne,updateAssetProcedureTypeFieldsMany:G.updateMany,deleteAssetProcedureTypeFields:G.deleteOne,deleteAssetProcedureTypeFieldsMany:G.deleteMany}}),{initializeAssetProcedureTypeFields:ur,addAssetProcedureTypeFields:or,addAssetProcedureTypeFieldsMany:iA,setAssetProcedureTypeFields:aA,setAssetProcedureTypeFieldsMany:cA,updateAssetProcedureTypeFields:lr,updateAssetProcedureTypeFieldsMany:nA,deleteAssetProcedureTypeFields:hr,deleteAssetProcedureTypeFieldsMany:rA}=As.actions,mr=As.reducer,pr=t=>t.assetProcedureTypeFieldsReducer.instances,fs=d.createSelector([pr],t=>Object.values(t)),dA=A(d.createSelector([fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),uA=A(d.createSelector([fs,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),oA=t=>e=>e.assetProcedureTypeFieldsReducer.instances[t],L=P(({uuid:t})=>t),yr=L.getInitialState({}),Ss=d.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:yr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,yr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:L.initialize,addAssetProcedureTypeFieldValuesAttachment:L.addOne,addAssetProcedureTypeFieldValuesAttachments:L.addMany,setAssetProcedureTypeFieldValuesAttachment:L.setOne,setAssetProcedureTypeFieldValuesAttachments:L.setMany,updateAssetProcedureTypeFieldValuesAttachment:L.updateOne,updateAssetProcedureTypeFieldValuesAttachments:L.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:L.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:L.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Ar,addAssetProcedureTypeFieldValuesAttachment:lA,addAssetProcedureTypeFieldValuesAttachments:wt,setAssetProcedureTypeFieldValuesAttachment:hA,setAssetProcedureTypeFieldValuesAttachments:mA,updateAssetProcedureTypeFieldValuesAttachment:pA,updateAssetProcedureTypeFieldValuesAttachments:fr,deleteAssetProcedureTypeFieldValuesAttachment:yA,deleteAssetProcedureTypeFieldValuesAttachments:Mt}=Ss.actions,Sr=Ss.reducer,Ts=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Tr=d.createSelector([Ts],t=>Object.values(t)),AA=t=>e=>e.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],gr=A(d.createSelector([Ts,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),Ir=A(d.createSelector([Tr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),N=P(({uuid:t})=>t),br=N.getInitialState({}),gs=d.createSlice({name:"assetProcedureTypeFieldValues",initialState:br,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,br)),reducers:{initializeAssetProcedureTypeFieldValues:N.initialize,addAssetProcedureTypeFieldValues:N.addOne,addAssetProcedureTypeFieldValuesMany:N.addMany,setAssetProcedureTypeFieldValues:N.setOne,setAssetProcedureTypeFieldValuesMany:N.setMany,updateAssetProcedureTypeFieldValues:N.updateOne,updateAssetProcedureTypeFieldValuesMany:N.updateMany,deleteAssetProcedureTypeFieldValues:N.deleteOne,deleteAssetProcedureTypeFieldValuesMany:N.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Fr,addAssetProcedureTypeFieldValues:Is,addAssetProcedureTypeFieldValuesMany:Pr,setAssetProcedureTypeFieldValues:fA,setAssetProcedureTypeFieldValuesMany:SA,updateAssetProcedureTypeFieldValues:at,updateAssetProcedureTypeFieldValuesMany:_r,deleteAssetProcedureTypeFieldValues:bs,deleteAssetProcedureTypeFieldValuesMany:Or}=gs.actions,Rr=gs.reducer,vr=t=>t.assetProcedureFieldValuesReducer.instances,Fs=d.createSelector([vr],t=>Object.values(t)),TA=A(d.createSelector([Fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),gA=A(d.createSelector([Fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),Ps=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],H=P(({uuid:t})=>t),wr=H.getInitialState({}),_s=d.createSlice({name:"assetProcedures",initialState:wr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,wr)),reducers:{initializeAssetProcedures:H.initialize,addAssetProcedure:H.addOne,addAssetProcedures:H.addMany,setAssetProcedure:H.setOne,setAssetProcedures:H.setMany,updateAssetProcedure:H.updateOne,updateAssetProcedures:H.updateMany,deleteAssetProcedure:H.deleteOne,deleteAssetProcedures:H.deleteMany}}),{initializeAssetProcedures:Mr,addAssetProcedure:Os,addAssetProcedures:Er,updateAssetProcedure:ct,updateAssetProcedures:IA,deleteAssetProcedure:Rs,deleteAssetProcedures:jr,setAssetProcedure:bA,setAssetProcedures:FA}=_s.actions,Vr=_s.reducer,vs=t=>t.assetProcedureReducer.instances,ws=d.createSelector([vs],t=>Object.values(t)),qr=A(d.createSelector([ws,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),PA=A(d.createSelector([ws,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Ms=t=>e=>e.assetProcedureReducer.instances[t],_A=A(d.createSelector([vs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),W=P(t=>t.uuid),zr=W.getInitialState({}),Es=d.createSlice({name:"assetProcedureTypes",initialState:zr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,zr)),reducers:{initializeAssetProcedureTypes:W.initialize,addAssetProcedureType:W.addOne,addAssetProcedureTypes:W.addMany,setAssetProcedureType:W.setOne,setAssetProcedureTypes:W.setMany,updateAssetProcedureType:W.updateOne,updateAssetProcedureTypes:W.updateMany,deleteAssetProcedureType:W.deleteOne,deleteAssetProcedureTypes:W.deleteMany}}),{initializeAssetProcedureTypes:Dr,addAssetProcedureType:js,addAssetProcedureTypes:OA,updateAssetProcedureType:nt,updateAssetProcedureTypes:RA,deleteAssetProcedureType:Vs,deleteAssetProcedureTypes:vA,setAssetProcedureType:wA,setAssetProcedureTypes:MA}=Es.actions,Ur=Es.reducer,qs=t=>t.assetProcedureTypeReducer.instances,Cr=d.createSelector([qs],t=>Object.values(t)),zs=t=>e=>e.assetProcedureTypeReducer.instances[t],EA=A(d.createSelector([qs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),jA=A(d.createSelector([Cr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),K=P(t=>t.uuid),kr=K.getInitialState({}),Ds=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:kr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,kr)),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:Br,addAssetProcedureStepFieldsAttachment:VA,addAssetProcedureStepFieldsAttachments:$r,setAssetProcedureStepFieldsAttachment:qA,setAssetProcedureStepFieldsAttachments:zA,updateAssetProcedureStepFieldsAttachment:DA,updateAssetProcedureStepFieldsAttachments:Gr,deleteAssetProcedureStepFieldsAttachment:UA,deleteAssetProcedureStepFieldsAttachments:Lr}=Ds.actions,Nr=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Hr=d.createSelector([Nr],t=>Object.values(t)),CA=A(d.createSelector([Hr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),kA=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],Wr=Ds.reducer,Y=P(t=>t.uuid),Kr=Y.getInitialState({}),Us=d.createSlice({name:"assetProcedureStepFields",initialState:Kr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Kr)),reducers:{initializeAssetProcedureStepFields:Y.initialize,addAssetProcedureStepFields:Y.addOne,addAssetProcedureStepFieldsMany:Y.addMany,setAssetProcedureStepFields:Y.setOne,setAssetProcedureStepFieldsMany:Y.setMany,updateAssetProcedureStepFields:Y.updateOne,updateAssetProcedureStepFieldsMany:Y.updateMany,deleteAssetProcedureStepFields:Y.deleteOne,deleteAssetProcedureStepFieldsMany:Y.deleteMany}}),{initializeAssetProcedureStepFields:Yr,addAssetProcedureStepFields:Cs,addAssetProcedureStepFieldsMany:BA,setAssetProcedureStepFields:$A,setAssetProcedureStepFieldsMany:GA,updateAssetProcedureStepFields:rt,updateAssetProcedureStepFieldsMany:LA,deleteAssetProcedureStepFields:ks,deleteAssetProcedureStepFieldsMany:NA}=Us.actions,Bs=t=>t.assetProcedureStepFieldsReducer.instances,$s=d.createSelector([Bs],t=>Object.values(t)),HA=A(d.createSelector([$s,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),WA=A(d.createSelector([$s,(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])),KA=d.createSelector([Bs],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}),YA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Zr=Us.reducer,Z=P(t=>t.uuid),Jr=Z.getInitialState({}),Gs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Jr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Jr)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:Z.initialize,addAssetProcedureStepFieldValuesAttachment:Z.addOne,addAssetProcedureStepFieldValuesAttachments:Z.addMany,setAssetProcedureStepFieldValuesAttachment:Z.setOne,setAssetProcedureStepFieldValuesAttachments:Z.setMany,updateAssetProcedureStepFieldValuesAttachment:Z.updateOne,updateAssetProcedureStepFieldValuesAttachments:Z.updateMany,deleteAssetProcedureStepFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Xr,addAssetProcedureStepFieldValuesAttachment:ZA,addAssetProcedureStepFieldValuesAttachments:Et,setAssetProcedureStepFieldValuesAttachment:JA,setAssetProcedureStepFieldValuesAttachments:XA,updateAssetProcedureStepFieldValuesAttachment:QA,updateAssetProcedureStepFieldValuesAttachments:Qr,deleteAssetProcedureStepFieldValuesAttachment:xA,deleteAssetProcedureStepFieldValuesAttachments:jt}=Gs.actions,Ls=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,xr=d.createSelector([Ls],t=>Object.values(t)),ef=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],ed=A(d.createSelector([Ls,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),td=A(d.createSelector([xr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),sd=Gs.reducer,J=P(t=>t.uuid),id=J.getInitialState({}),Ns=d.createSlice({name:"assetProcedureStepFieldValues",initialState:id,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,id)),reducers:{initializeAssetProcedureStepFieldValues:J.initialize,addAssetProcedureStepFieldValues:J.addOne,addAssetProcedureStepFieldValuesMany:J.addMany,setAssetProcedureStepFieldValues:J.setOne,setAssetProcedureStepFieldValuesMany:J.setMany,updateAssetProcedureStepFieldValues:J.updateOne,updateAssetProcedureStepFieldValuesMany:J.updateMany,deleteAssetProcedureStepFieldValues:J.deleteOne,deleteAssetProcedureStepFieldValuesMany:J.deleteMany}}),{initializeAssetProcedureStepFieldValues:ad,addAssetProcedureStepFieldValues:Hs,addAssetProcedureStepFieldValuesMany:cd,setAssetProcedureStepFieldValues:tf,setAssetProcedureStepFieldValuesMany:sf,updateAssetProcedureStepFieldValues:dt,updateAssetProcedureStepFieldValuesMany:nd,deleteAssetProcedureStepFieldValues:Ws,deleteAssetProcedureStepFieldValuesMany:rd}=Ns.actions,dd=t=>t.assetProcedureStepFieldValuesReducer.instances,Vt=d.createSelector([dd],t=>Object.values(t)),af=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),cf=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),nf=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Ks=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],ud=Ns.reducer,X=P(t=>t.uuid),od=X.getInitialState({}),Ys=d.createSlice({name:"assetProcedureSteps",initialState:od,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,od)),reducers:{initializeAssetProcedureSteps:X.initialize,setAssetProcedureStep:X.setOne,setAssetProcedureSteps:X.setMany,addAssetProcedureStep:X.addOne,addAssetProcedureSteps:X.addMany,updateAssetProcedureStep:X.updateOne,updateAssetProcedureSteps:X.updateMany,deleteAssetProcedureStep:X.deleteOne,deleteAssetProcedureSteps:X.deleteMany}}),{initializeAssetProcedureSteps:ld,setAssetProcedureStep:hd,setAssetProcedureSteps:rf,addAssetProcedureStep:md,addAssetProcedureSteps:pd,updateAssetProcedureStep:qt,updateAssetProcedureSteps:df,deleteAssetProcedureStep:yd,deleteAssetProcedureSteps:Ad}=Ys.actions,fd=Ys.reducer,ut=t=>t.assetProcedureStepReducer.instances,Zs=t=>e=>e.assetProcedureStepReducer.instances[t],Sd=d.createSelector([ut],t=>Object.values(t)),uf=A(d.createSelector([ut,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure_type===e&&(i[a]=c);return vt(i)})),of=A(d.createSelector([Sd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),lf=A(d.createSelector([ut,(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 T(i)})),Td=A(d.createSelector([ut,(t,e)=>e],(t,e)=>{if(!t[e])return T([]);const c=Rn(e,Object.values(t)).all().map(({model:n})=>n);return T(c)})),Q=P(t=>t.uuid),gd=Q.getInitialState({}),Js=d.createSlice({name:"assets",initialState:gd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,gd)),reducers:{initializeAssets:Q.initialize,addAsset:Q.addOne,addAssets:Q.addMany,setAsset:Q.setOne,setAssets:Q.setMany,updateAsset:Q.updateOne,updateAssets:Q.updateMany,deleteAsset:Q.deleteOne,deleteAssets:Q.deleteMany}}),{initializeAssets:Id,addAsset:Xs,addAssets:zt,updateAsset:ot,updateAssets:hf,deleteAsset:Qs,deleteAssets:xs,setAsset:mf,setAssets:pf}=Js.actions,ei=t=>t.assetReducer.instances,bd=d.createSelector([ei],t=>T(Object.values(t))),ti=A(d.createSelector([bd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),si=t=>e=>e.assetReducer.instances[t],Fd=A(d.createSelector([ei,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),yf=t=>e=>ti(t)(e).length,Pd=Js.reducer,x=P(t=>t.uuid),_d=x.getInitialState({}),ii=d.createSlice({name:"assetStageCompletions",initialState:_d,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,_d)),reducers:{initializeAssetStageCompletions:x.initialize,addAssetStageCompletion:x.addOne,addAssetStageCompletions:x.addMany,setAssetStageCompletion:x.setOne,setAssetStageCompletions:x.setMany,updateAssetStageCompletion:x.updateOne,updateAssetStageCompletions:x.updateMany,deleteAssetStageCompletion:x.deleteOne,deleteAssetStageCompletions:x.deleteMany}}),{initializeAssetStageCompletions:Od,addAssetStageCompletion:ai,addAssetStageCompletions:ci,setAssetStageCompletion:Af,setAssetStageCompletions:ff,updateAssetStageCompletion:Rd,updateAssetStageCompletions:vd,deleteAssetStageCompletion:ni,deleteAssetStageCompletions:ri}=ii.actions,wd=ii.reducer,di=t=>t.assetStageCompletionReducer.instances,Sf=d.createSelector([di],t=>Object.values(t)),Md=t=>e=>e.assetStageCompletionReducer.instances[t],Ed=A(d.createSelector([di,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),ee=P(t=>t.uuid),jd=ee.getInitialState({}),ui=d.createSlice({name:"assetStages",initialState:jd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,jd)),reducers:{initializeAssetStages:ee.initialize,setAssetStage:ee.setOne,setAssetStages:ee.setMany,addAssetStage:ee.addOne,addAssetStages:ee.addMany,updateAssetStage:ee.updateOne,updateAssetStages:ee.updateMany,deleteAssetStage:ee.deleteOne,deleteAssetStages:ee.deleteMany}}),{initializeAssetStages:Vd,setAssetStage:qd,setAssetStages:Tf,addAssetStage:oi,addAssetStages:gf,updateAssetStage:Dt,updateAssetStages:If,deleteAssetStage:li,deleteAssetStages:bf}=ui.actions,zd=ui.reducer,Ut=t=>t.assetStageReducer.instances,hi=t=>e=>e.assetStageReducer.instances[t],Dd=d.createSelector([Ut],t=>Object.values(t)),Ff=A(d.createSelector([Ut,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure_type===e&&(i[a]=c);return vt(i)})),Pf=A(d.createSelector([Dd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),_f=A(d.createSelector([Ut,(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 T(i)})),te=P(t=>t.uuid),Ud=te.getInitialState({}),mi=d.createSlice({name:"assetTypeAttachments",initialState:Ud,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Ud)),reducers:{initializeAssetTypeAttachments:te.initialize,addAssetTypeAttachment:te.addOne,addAssetTypeAttachments:te.addMany,setAssetTypeAttachment:te.setOne,setAssetTypeAttachments:te.setMany,updateAssetTypeAttachment:te.updateOne,updateAssetTypeAttachments:te.updateMany,deleteAssetTypeAttachment:te.deleteOne,deleteAssetTypeAttachments:te.deleteMany}}),{initializeAssetTypeAttachments:pi,addAssetTypeAttachment:Of,addAssetTypeAttachments:yi,setAssetTypeAttachment:Cd,setAssetTypeAttachments:Rf,updateAssetTypeAttachment:vf,updateAssetTypeAttachments:kd,deleteAssetTypeAttachment:Bd,deleteAssetTypeAttachments:Ai}=mi.actions,$d=t=>t.assetTypeAttachmentReducer.instances,Gd=d.createSelector([$d],t=>Object.values(t)),Ld=t=>e=>e.assetTypeAttachmentReducer.instances[t],Nd=A(d.createSelector([Gd,(t,e)=>e],(t,e)=>T(t.filter(({asset_type:i})=>e===i)))),Hd=mi.reducer,se=P(t=>t.uuid),Wd=se.getInitialState({}),fi=d.createSlice({name:"assetTypeFieldsAttachments",initialState:Wd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Wd)),reducers:{initializeAssetTypeFieldsAttachments:se.initialize,addAssetTypeFieldsAttachment:se.addOne,addAssetTypeFieldsAttachments:se.addMany,setAssetTypeFieldsAttachment:se.setOne,setAssetTypeFieldsAttachments:se.setMany,updateAssetTypeFieldsAttachment:se.updateOne,updateAssetTypeFieldsAttachments:se.updateMany,deleteAssetTypeFieldsAttachment:se.deleteOne,deleteAssetTypeFieldsAttachments:se.deleteMany}}),{initializeAssetTypeFieldsAttachments:Kd,addAssetTypeFieldsAttachment:wf,addAssetTypeFieldsAttachments:Yd,setAssetTypeFieldsAttachment:Mf,setAssetTypeFieldsAttachments:Ef,updateAssetTypeFieldsAttachment:jf,updateAssetTypeFieldsAttachments:Zd,deleteAssetTypeFieldsAttachment:Vf,deleteAssetTypeFieldsAttachments:Jd}=fi.actions,Xd=t=>t.assetTypeFieldsAttachmentReducer.instances,Qd=d.createSelector([Xd],t=>Object.values(t)),qf=A(d.createSelector([Qd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),zf=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],xd=fi.reducer,ie=P(t=>t.uuid),eu=ie.getInitialState({}),Si=d.createSlice({name:"assetTypeFields",initialState:eu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,eu)),reducers:{initializeAssetTypeFields:ie.initialize,addAssetTypeFields:ie.addOne,addAssetTypeFieldsMany:ie.addMany,setAssetTypeFields:ie.setOne,setAssetTypeFieldsMany:ie.setMany,updateAssetTypeFields:ie.updateOne,updateAssetTypeFieldsMany:ie.updateMany,deleteAssetTypeFields:ie.deleteOne,deleteAssetTypeFieldsMany:ie.deleteMany}}),{initializeAssetTypeFields:tu,addAssetTypeFields:su,addAssetTypeFieldsMany:Df,setAssetTypeFields:Uf,setAssetTypeFieldsMany:Cf,updateAssetTypeFields:iu,updateAssetTypeFieldsMany:kf,deleteAssetTypeFields:au,deleteAssetTypeFieldsMany:Bf}=Si.actions,cu=t=>t.assetTypeFieldsReducer.instances,Ct=d.createSelector([cu],t=>Object.values(t)),$f=A(d.createSelector([Ct,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Gf=A(d.createSelector([Ct,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Lf=t=>e=>e.assetTypeFieldsReducer.instances[t],nu=Si.reducer,ae=P(t=>t.uuid),ru=ae.getInitialState({}),Ti=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:ru,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,ru)),reducers:{initializeAssetTypeFieldValuesAttachments:ae.initialize,addAssetTypeFieldValuesAttachment:ae.addOne,addAssetTypeFieldValuesAttachments:ae.addMany,setAssetTypeFieldValuesAttachment:ae.setOne,setAssetTypeFieldValuesAttachments:ae.setMany,updateAssetTypeFieldValuesAttachment:ae.updateOne,updateAssetTypeFieldValuesAttachments:ae.updateMany,deleteAssetTypeFieldValuesAttachment:ae.deleteOne,deleteAssetTypeFieldValuesAttachments:ae.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:du,addAssetTypeFieldValuesAttachment:Nf,addAssetTypeFieldValuesAttachments:kt,setAssetTypeFieldValuesAttachment:Hf,setAssetTypeFieldValuesAttachments:Wf,updateAssetTypeFieldValuesAttachment:Kf,updateAssetTypeFieldValuesAttachments:uu,deleteAssetTypeFieldValuesAttachment:Yf,deleteAssetTypeFieldValuesAttachments:Bt}=Ti.actions,gi=t=>t.assetTypeFieldValuesAttachmentReducer.instances,ou=d.createSelector([gi],t=>Object.values(t)),Zf=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],lu=A(d.createSelector([gi,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),hu=A(d.createSelector([ou,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),mu=Ti.reducer,ce=P(t=>t.uuid),pu=ce.getInitialState({}),Ii=d.createSlice({name:"assetTypeFieldValues",initialState:pu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,pu)),reducers:{initializeAssetTypeFieldValues:ce.initialize,addAssetTypeFieldValues:ce.addOne,addAssetTypeFieldValuesMany:ce.addMany,setAssetTypeFieldValues:ce.setOne,setAssetTypeFieldValuesMany:ce.setMany,updateAssetTypeFieldValues:ce.updateOne,updateAssetTypeFieldValuesMany:ce.updateMany,deleteAssetTypeFieldValues:ce.deleteOne,deleteAssetTypeFieldValuesMany:ce.deleteMany}}),{initializeAssetTypeFieldValues:yu,addAssetTypeFieldValues:bi,addAssetTypeFieldValuesMany:Au,setAssetTypeFieldValues:Jf,setAssetTypeFieldValuesMany:Xf,updateAssetTypeFieldValues:lt,updateAssetTypeFieldValuesMany:fu,deleteAssetTypeFieldValues:Fi,deleteAssetTypeFieldValuesMany:Su}=Ii.actions,Tu=t=>t.assetTypeFieldValuesReducer.instances,Pi=d.createSelector([Tu],t=>Object.values(t)),Qf=A(d.createSelector([Pi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),xf=A(d.createSelector([Ct,Pi,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.asset_type===i).map(c=>c.uuid));return T(e.filter(c=>a.has(c.fields_revision)))})),_i=t=>e=>e.assetTypeFieldValuesReducer.instances[t],gu=Ii.reducer,ne=P(t=>t.uuid),Iu=ne.getInitialState({}),Oi=d.createSlice({name:"assetTypeIdentifiers",initialState:Iu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Iu)),reducers:{initializeAssetTypeIdentifiers:ne.initialize,addAssetTypeIdentifier:ne.addOne,addAssetTypeIdentifiers:ne.addMany,setAssetTypeIdentifier:ne.setOne,setAssetTypeIdentifiers:ne.setMany,updateAssetTypeIdentifier:ne.updateOne,updateAssetTypeIdentifiers:ne.updateMany,deleteAssetTypeIdentifier:ne.deleteOne,deleteAssetTypeIdentifiers:ne.deleteMany}}),{initializeAssetTypeIdentifiers:bu,addAssetTypeIdentifier:Ri,addAssetTypeIdentifiers:eS,setAssetTypeIdentifier:tS,setAssetTypeIdentifiers:sS,updateAssetTypeIdentifier:ht,updateAssetTypeIdentifiers:iS,deleteAssetTypeIdentifier:vi,deleteAssetTypeIdentifiers:aS}=Oi.actions,Fu=t=>t.assetTypeIdentifierReducer.instances,Pu=d.createSelector([Fu],t=>Object.values(t)),wi=t=>e=>e.assetTypeIdentifierReducer.instances[t],cS=A(d.createSelector([Pu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_u=Oi.reducer,re=P(t=>t.uuid),Ou=re.getInitialState({}),Mi=d.createSlice({name:"assetTypeIdentifierValues",initialState:Ou,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Ou)),reducers:{initializeAssetTypeIdentifierValues:re.initialize,addAssetTypeIdentifierValue:re.addOne,addAssetTypeIdentifierValues:re.addMany,setAssetTypeIdentifierValue:re.setOne,setAssetTypeIdentifierValues:re.setMany,updateAssetTypeIdentifierValue:re.updateOne,updateAssetTypeIdentifierValues:re.updateMany,deleteAssetTypeIdentifierValue:re.deleteOne,deleteAssetTypeIdentifierValues:re.deleteMany}}),{initializeAssetTypeIdentifierValues:Ru,addAssetTypeIdentifierValue:Ei,addAssetTypeIdentifierValues:nS,setAssetTypeIdentifierValue:rS,setAssetTypeIdentifierValues:dS,updateAssetTypeIdentifierValue:mt,updateAssetTypeIdentifierValues:uS,deleteAssetTypeIdentifierValue:ji,deleteAssetTypeIdentifierValues:oS}=Mi.actions,vu=t=>t.assetTypeIdentifierValueReducer.instances,Vi=d.createSelector([vu],t=>Object.values(t)),qi=t=>e=>e.assetTypeIdentifierValueReducer.instances[t],lS=A(d.createSelector([Vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),hS=A(d.createSelector([Vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type_identifier===e)))),wu=Mi.reducer,de=P(t=>t.uuid),Mu=de.getInitialState({}),zi=d.createSlice({name:"assetTypes",initialState:Mu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Mu)),reducers:{initializeAssetTypes:de.initialize,setAssetType:de.setOne,setAssetTypes:de.setMany,addAssetType:de.addOne,addAssetTypes:de.addMany,updateAssetType:de.updateOne,updateAssetTypes:de.updateMany,deleteAssetType:de.deleteOne,deleteAssetTypes:de.deleteMany}}),{initializeAssetTypes:Eu,setAssetType:mS,setAssetTypes:pS,addAssetType:Di,addAssetTypes:yS,updateAssetType:pt,updateAssetTypes:AS,deleteAssetType:Ui,deleteAssetTypes:fS}=zi.actions,Ci=t=>t.assetTypeReducer.instances,ju=d.createSelector([Ci],t=>Object.values(t)),ki=t=>e=>e.assetTypeReducer.instances[t],SS=A(d.createSelector([Ci,(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 T(i)})),TS=A(d.createSelector([ju,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Vu=zi.reducer,qu={accessToken:"",refreshToken:"",isLoggedIn:!1},$t=d.createSlice({name:"auth",initialState:qu,extraReducers:t=>t.addCase(g,e=>Object.assign(e,qu)),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:gS,clearTokens:IS,setLoggedIn:zu}=$t.actions,bS=t=>t.authReducer.accessToken,FS=t=>t.authReducer.isLoggedIn,Du=$t.reducer,ue=P(t=>t.uuid),Uu=ue.getInitialState({}),Bi=d.createSlice({name:"categories",initialState:Uu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Uu)),reducers:{initializeCategories:ue.initialize,addCategory:ue.addOne,addCategories:ue.addMany,setCategory:ue.setOne,setCategories:ue.setMany,updateCategory:ue.updateOne,updateCategories:ue.updateMany,deleteCategory:ue.deleteOne,deleteCategories:ue.deleteMany}}),{initializeCategories:Cu,addCategory:$i,addCategories:PS,setCategory:_S,setCategories:OS,updateCategory:ku,updateCategories:RS,deleteCategory:Bu,deleteCategories:vS}=Bi.actions,Gi=t=>t.categoryReducer.instances,$u=d.createSelector([Gi],t=>Object.values(t)),Li=t=>e=>e.categoryReducer.instances[t],wS=A(d.createSelector([Gi,(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 T(i)})),MS=A(d.createSelector([$u,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),Gu=Bi.reducer,oe=P(t=>t.uuid),Lu=oe.getInitialState({}),Ni=d.createSlice({name:"documentAttachments",initialState:Lu,extraReducers:t=>t.addCase(g,e=>Object.assign(e,Lu)),reducers:{initializeDocumentAttachments:oe.initialize,addDocumentAttachment:oe.addOne,addDocumentAttachments:oe.addMany,setDocumentAttachment:oe.setOne,setDocumentAttachments:oe.setMany,updateDocumentAttachment:oe.updateOne,updateDocumentAttachments:oe.updateMany,deleteDocumentAttachment:oe.deleteOne,deleteDocumentAttachments:oe.deleteMany}}),{initializeDocumentAttachments:Hi,addDocumentAttachment:ES,addDocumentAttachments:Nu,setDocumentAttachment:Hu,setDocumentAttachments:jS,updateDocumentAttachment:VS,updateDocumentAttachments:Wu,deleteDocumentAttachment:Ku,deleteDocumentAttachments:Yu}=Ni.actions,Zu=t=>t.documentAttachmentReducer.instances,Ju=d.createSelector([Zu],t=>Object.values(t)),Xu=t=>e=>e.documentAttachmentReducer.instances[t],qS=A(d.createSelector([Ju,(t,e)=>e],(t,e)=>T(t.filter(({document:i})=>e===i)))),Qu=Ni.reducer,xu={documents:{}},Wi=d.createSlice({name:"documents",initialState:xu,extraReducers:t=>t.addCase(g,e=>{Object.assign(e,xu)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(_n).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=Fn(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:eo,addDocuments:to,updateDocuments:xe,removeDocuments:Ki}=Wi.actions,Gt=t=>t.documentsReducer.documents,Yi=d.createSelector([Gt],t=>Object.values(t)),so=t=>e=>e.documentsReducer.documents[t],zS=A(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("selectDocumentByIds: No document exists with the id",a)}return T(i)})),DS=A(d.createSelector([Yi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),US=A(d.createSelector([Yi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),io=Wi.reducer,le=P(t=>t.uuid),ao=le.getInitialState({}),Zi=d.createSlice({name:"emailDomains",initialState:ao,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,ao)),reducers:{initializeEmailDomains:le.initialize,addEmailDomain:le.addOne,addEmailDomains:le.addMany,setEmailDomain:le.setOne,setEmailDomains:le.setMany,updateEmailDomain:le.updateOne,updateEmailDomains:le.updateMany,deleteEmailDomain:le.deleteOne,deleteEmailDomains:le.deleteMany}}),{initializeEmailDomains:co,addEmailDomain:no,addEmailDomains:CS,setEmailDomain:kS,setEmailDomains:BS,updateEmailDomain:$S,updateEmailDomains:GS,deleteEmailDomain:ro,deleteEmailDomains:LS}=Zi.actions,uo=t=>t.emailDomainsReducer.instances,oo=d.createSelector([uo],t=>Object.values(t)),NS=A(d.createSelector([oo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),lo=Zi.reducer,ho={s3Urls:{}},mo=1e3*60*60,HS=mo*24*7,Ji=d.createSlice({name:"file",initialState:ho,extraReducers:t=>t.addCase(g,e=>Object.assign(e,ho)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:c}=e.payload,n=new Date,r=new Date(n.getTime()+HS);t.s3Urls[c]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:po}=Ji.actions,yo=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<mo))return i},Ao=Ji.reducer,he=P(t=>t.uuid),fo=he.getInitialState({}),Xi=d.createSlice({name:"formIdentifiers",initialState:fo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,fo)),reducers:{initializeFormIdentifiers:he.initialize,addFormIdentifier:he.addOne,addFormIdentifiers:he.addMany,setFormIdentifier:he.setOne,setFormIdentifiers:he.setMany,updateFormIdentifier:he.updateOne,updateFormIdentifiers:he.updateMany,deleteFormIdentifier:he.deleteOne,deleteFormIdentifiers:he.deleteMany}}),{initializeFormIdentifiers:So,addFormIdentifier:Qi,addFormIdentifiers:WS,setFormIdentifier:KS,setFormIdentifiers:YS,updateFormIdentifier:yt,updateFormIdentifiers:ZS,deleteFormIdentifier:xi,deleteFormIdentifiers:JS}=Xi.actions,To=t=>t.formIdentifierReducer.instances,go=d.createSelector([To],t=>Object.values(t)),ea=t=>e=>e.formIdentifierReducer.instances[t],XS=A(d.createSelector([go,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),Io=Xi.reducer,me=P(t=>t.uuid),bo=me.getInitialState({}),ta=d.createSlice({name:"formIdentifierValues",initialState:bo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,bo)),reducers:{initializeFormIdentifierValues:me.initialize,addFormIdentifierValue:me.addOne,addFormIdentifierValues:me.addMany,setFormIdentifierValue:me.setOne,setFormIdentifierValues:me.setMany,updateFormIdentifierValue:me.updateOne,updateFormIdentifierValues:me.updateMany,deleteFormIdentifierValue:me.deleteOne,deleteFormIdentifierValues:me.deleteMany}}),{initializeFormIdentifierValues:Fo,addFormIdentifierValue:sa,addFormIdentifierValues:QS,setFormIdentifierValue:xS,setFormIdentifierValues:eT,updateFormIdentifierValue:At,updateFormIdentifierValues:tT,deleteFormIdentifierValue:ia,deleteFormIdentifierValues:sT}=ta.actions,Po=t=>t.formIdentifierValueReducer.instances,aa=d.createSelector([Po],t=>Object.values(t)),ca=t=>e=>e.formIdentifierValueReducer.instances[t],iT=A(d.createSelector([aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),aT=A(d.createSelector([aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_identifier===e)))),_o=ta.reducer,pe=P(t=>t.uuid),Oo=pe.getInitialState({}),na=d.createSlice({name:"formRevisionAttachments",initialState:Oo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Oo)),reducers:{initializeFormRevisionAttachments:pe.initialize,addFormRevisionAttachment:pe.addOne,addFormRevisionAttachments:pe.addMany,setFormRevisionAttachment:pe.setOne,setFormRevisionAttachments:pe.setMany,updateFormRevisionAttachment:pe.updateOne,updateFormRevisionAttachments:pe.updateMany,deleteFormRevisionAttachment:pe.deleteOne,deleteFormRevisionAttachments:pe.deleteMany}}),{initializeFormRevisionAttachments:Ro,addFormRevisionAttachment:cT,addFormRevisionAttachments:vo,setFormRevisionAttachment:nT,setFormRevisionAttachments:rT,updateFormRevisionAttachment:dT,updateFormRevisionAttachments:wo,deleteFormRevisionAttachment:uT,deleteFormRevisionAttachments:Mo}=na.actions,Eo=t=>t.formRevisionAttachmentReducer.instances,oT=A(d.createSelector([Eo,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.form_revision===e)))),jo=na.reducer,ye=P(t=>t.uuid),Vo=ye.getInitialState({}),ra=d.createSlice({name:"formRevisions",initialState:Vo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Vo)),reducers:{initializeFormRevisions:ye.initialize,addFormRevision:ye.addOne,addFormRevisions:ye.addMany,setFormRevision:ye.setOne,setFormRevisions:ye.setMany,updateFormRevision:ye.updateOne,updateFormRevisions:ye.updateMany,deleteFormRevision:ye.deleteOne,deleteFormRevisions:ye.deleteMany}}),{initializeFormRevisions:qo,addFormRevision:da,addFormRevisions:zo,setFormRevision:Do,setFormRevisions:lT,updateFormRevision:hT,updateFormRevisions:mT,deleteFormRevision:ua,deleteFormRevisions:Uo}=ra.actions,oa=t=>t.formRevisionReducer.instances,la=d.createSelector([oa],t=>Object.values(t)),pT=t=>e=>e.formRevisionReducer.instances[t],yT=A(d.createSelector([la,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Co=A(d.createSelector([la,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),ko=ra.reducer,Ae=P(t=>t.uuid),Bo=Ae.getInitialState({}),ha=d.createSlice({name:"forms",initialState:Bo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Bo)),reducers:{initializeForms:Ae.initialize,addForm:Ae.addOne,addForms:Ae.addMany,setForm:Ae.setOne,setForms:Ae.setMany,updateForm:Ae.updateOne,updateForms:Ae.updateMany,deleteForm:Ae.deleteOne,deleteForms:Ae.deleteMany}}),{initializeForms:$o,addForm:ma,addForms:AT,setForm:fT,setForms:ST,updateForm:TT,updateForms:gT,deleteForm:pa,deleteForms:IT}=ha.actions,Go=ha.reducer,Lo=t=>t.formReducer.instances,No=d.createSelector([Lo],t=>Object.values(t)),Ho=t=>e=>e.formReducer.instances[t],bT=A(d.createSelector([No,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),fe=P(t=>t.uuid),Wo=fe.getInitialState({}),ya=d.createSlice({name:"formSubmissionAttachments",initialState:Wo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Wo)),reducers:{initializeFormSubmissionAttachments:fe.initialize,addFormSubmissionAttachment:fe.addOne,addFormSubmissionAttachments:fe.addMany,setFormSubmissionAttachment:fe.setOne,setFormSubmissionAttachments:fe.setMany,updateFormSubmissionAttachment:fe.updateOne,updateFormSubmissionAttachments:fe.updateMany,deleteFormSubmissionAttachment:fe.deleteOne,deleteFormSubmissionAttachments:fe.deleteMany}}),{initializeFormSubmissionAttachments:Ko,addFormSubmissionAttachment:FT,addFormSubmissionAttachments:Lt,setFormSubmissionAttachment:PT,setFormSubmissionAttachments:_T,updateFormSubmissionAttachment:OT,updateFormSubmissionAttachments:Yo,deleteFormSubmissionAttachment:RT,deleteFormSubmissionAttachments:Nt}=ya.actions,Zo=t=>t.formSubmissionAttachmentReducer.instances,Aa=d.createSelector([Zo],t=>Object.values(t)),Jo=A(d.createSelector([Aa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Xo=A(d.createSelector([Aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),Qo=ya.reducer,Se=P(t=>t.uuid),xo=Se.getInitialState({}),fa=d.createSlice({name:"formSubmissions",initialState:xo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,xo)),reducers:{initializeFormSubmissions:Se.initialize,setFormSubmission:Se.setOne,setFormSubmissions:Se.setMany,addFormSubmission:Se.addOne,addFormSubmissions:Se.addMany,updateFormSubmission:Se.updateOne,updateFormSubmissions:Se.updateMany,deleteFormSubmission:Se.deleteOne,deleteFormSubmissions:Se.deleteMany}}),{initializeFormSubmissions:el,setFormSubmission:Ht,setFormSubmissions:vT,addFormSubmission:Sa,addFormSubmissions:tl,updateFormSubmission:sl,updateFormSubmissions:wT,deleteFormSubmission:Ta,deleteFormSubmissions:il}=fa.actions,ga=t=>t.formSubmissionReducer.instances,MT=d.createSelector([ga],t=>Object.values(t)),Ia=t=>e=>e.formSubmissionReducer.instances[t],al=A(d.createSelector([ga,oa,(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))})),cl=fa.reducer,Te=P(t=>t.uuid),nl=Te.getInitialState({}),ba=d.createSlice({name:"geoImages",initialState:nl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,nl)),reducers:{initializeGeoImages:Te.initialize,setGeoImage:Te.setOne,setGeoImages:Te.setMany,addGeoImage:Te.addOne,addGeoImages:Te.addMany,updateGeoImage:Te.updateOne,updateGeoImages:Te.updateMany,deleteGeoImage:Te.deleteOne,deleteGeoImages:Te.deleteMany}}),{initializeGeoImages:rl,setGeoImage:ft,setGeoImages:dl,addGeoImage:ul,addGeoImages:ol,updateGeoImage:ll,updateGeoImages:ET,deleteGeoImage:Fa,deleteGeoImages:hl}=ba.actions,ml=t=>t.geoImageReducer.instances,pl=d.createSelector([ml],t=>Object.values(t)),Pa=t=>e=>e.geoImageReducer.instances[t],jT=A(d.createSelector([pl,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),yl=ba.reducer,ge=P(t=>t.uuid),Al=ge.getInitialState({}),_a=d.createSlice({name:"issueAssociations",initialState:Al,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Al)),reducers:{initializeIssueAssociations:ge.initialize,addIssueAssociation:ge.addOne,addIssueAssociations:ge.addMany,setIssueAssociation:ge.setOne,setIssueAssociations:ge.setMany,updateIssueAssociation:ge.updateOne,updateIssueAssociations:ge.updateMany,deleteIssueAssociation:ge.deleteOne,deleteIssueAssociations:ge.deleteMany}}),{initializeIssueAssociations:fl,setIssueAssociations:VT,setIssueAssociation:qT,updateIssueAssociation:Sl,updateIssueAssociations:zT,addIssueAssociation:Oa,addIssueAssociations:Ra,deleteIssueAssociation:va,deleteIssueAssociations:wa}=_a.actions,St=t=>t.issueAssociationReducer.instances,DT=d.createSelector([St],t=>Object.values(t)),Tl=t=>e=>e.issueAssociationReducer.instances[t],gl=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.associated_issue===e)))),Il=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),bl=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.asset===e)))),Fl=_a.reducer,Ie=P(t=>t.uuid),Pl=Ie.getInitialState({}),Ma=d.createSlice({name:"issueAttachments",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Pl)),reducers:{initializeIssueAttachments:Ie.initialize,addIssueAttachment:Ie.addOne,addIssueAttachments:Ie.addMany,setIssueAttachment:Ie.setOne,setIssueAttachments:Ie.setMany,updateIssueAttachment:Ie.updateOne,updateIssueAttachments:Ie.updateMany,deleteIssueAttachment:Ie.deleteOne,deleteIssueAttachments:Ie.deleteMany}}),{initializeIssueAttachments:Ea,addIssueAttachment:UT,addIssueAttachments:ja,setIssueAttachment:_l,setIssueAttachments:CT,updateIssueAttachment:kT,updateIssueAttachments:Ol,deleteIssueAttachment:Rl,deleteIssueAttachments:Va}=Ma.actions,vl=t=>t.issueAttachmentReducer.instances,wl=d.createSelector([vl],t=>Object.values(t)),Ml=A(d.createSelector([wl,(t,e)=>e],(t,e)=>T(t.filter(({issue:i})=>e===i)))),El=t=>e=>e.issueAttachmentReducer.instances[t],jl=Ma.reducer,be=P(t=>t.uuid),Vl=be.getInitialState({}),qa=d.createSlice({name:"issueCommentAttachments",initialState:Vl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Vl)),reducers:{initializeIssueCommentAttachments:be.initialize,addIssueCommentAttachment:be.addOne,addIssueCommentAttachments:be.addMany,setIssueCommentAttachment:be.setOne,setIssueCommentAttachments:be.setMany,updateIssueCommentAttachment:be.updateOne,updateIssueCommentAttachments:be.updateMany,deleteIssueCommentAttachment:be.deleteOne,deleteIssueCommentAttachments:be.deleteMany}}),{initializeIssueCommentAttachments:za,addIssueCommentAttachment:BT,addIssueCommentAttachments:ql,setIssueCommentAttachment:zl,setIssueCommentAttachments:$T,updateIssueCommentAttachment:GT,updateIssueCommentAttachments:Dl,deleteIssueCommentAttachment:Ul,deleteIssueCommentAttachments:Cl}=qa.actions,kl=t=>t.issueCommentAttachmentReducer.instances,Bl=d.createSelector([kl],t=>Object.values(t)),$l=t=>e=>e.issueCommentAttachmentReducer.instances[t],LT=A(d.createSelector([Bl,(t,e)=>e],(t,e)=>T(t.filter(({issue_comment:i})=>e===i)))),Gl=qa.reducer,Fe=P(t=>t.uuid),Ll=Fe.getInitialState({}),Da=d.createSlice({name:"issueComments",initialState:Ll,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Ll)),reducers:{initializeIssueComments:Fe.initialize,addIssueComment:Fe.addOne,addIssueComments:Fe.addMany,setIssueComment:Fe.setOne,setIssueComments:Fe.setMany,updateIssueComment:Fe.updateOne,updateIssueComments:Fe.updateMany,deleteIssueComment:Fe.deleteOne,deleteIssueComments:Fe.deleteMany}}),{initializeIssueComments:NT,addIssueComment:Ua,addIssueComments:HT,setIssueComment:Ca,setIssueComments:Nl,updateIssueComment:WT,updateIssueComments:KT,deleteIssueComment:ka,deleteIssueComments:YT}=Da.actions,Hl=t=>t.issueCommentReducer.instances,Ba=t=>e=>e.issueCommentReducer.instances[t],ZT=A(d.createSelector([Hl,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),Wl=Da.reducer,Pe=P(t=>t.uuid),Kl=Pe.getInitialState({}),$a=d.createSlice({name:"issues",initialState:Kl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Kl)),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:Yl,addIssue:Ga,addIssues:Zl,setIssue:JT,setIssues:XT,updateIssue:Wt,updateIssues:QT,deleteIssue:La,deleteIssues:Jl}=$a.actions,Na=t=>t.issueReducer.instances,Ha=d.createSelector([Na],t=>Object.values(t)),Wa=t=>e=>e.issueReducer.instances[t],xT=A(d.createSelector([Na,(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 T(i)})),eg=A(d.createSelector([Ha,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Xl=A(d.createSelector([Ha,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),Ql=$a.reducer,_e=P(t=>t.uuid),xl=_e.getInitialState({}),Ka=d.createSlice({name:"issueTypeAttachments",initialState:xl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,xl)),reducers:{initializeIssueTypeAttachments:_e.initialize,addIssueTypeAttachment:_e.addOne,addIssueTypeAttachments:_e.addMany,setIssueTypeAttachment:_e.setOne,setIssueTypeAttachments:_e.setMany,updateIssueTypeAttachment:_e.updateOne,updateIssueTypeAttachments:_e.updateMany,deleteIssueTypeAttachment:_e.deleteOne,deleteIssueTypeAttachments:_e.deleteMany}}),{initializeIssueTypeAttachments:Ya,addIssueTypeAttachment:tg,addIssueTypeAttachments:eh,setIssueTypeAttachment:th,setIssueTypeAttachments:sg,updateIssueTypeAttachment:ig,updateIssueTypeAttachments:sh,deleteIssueTypeAttachment:ih,deleteIssueTypeAttachments:ah}=Ka.actions,ch=t=>t.issueTypeAttachmentReducer.instances,nh=d.createSelector([ch],t=>Object.values(t)),rh=t=>e=>e.issueTypeAttachmentReducer.instances[t],ag=A(d.createSelector([nh,(t,e)=>e],(t,e)=>T(t.filter(({issue_type:i})=>e===i)))),dh=Ka.reducer,Oe=P(t=>t.uuid),uh=Oe.getInitialState({}),Za=d.createSlice({name:"issueTypeFieldsAttachments",initialState:uh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,uh)),reducers:{initializeIssueTypeFieldsAttachments:Oe.initialize,addIssueTypeFieldsAttachment:Oe.addOne,addIssueTypeFieldsAttachments:Oe.addMany,setIssueTypeFieldsAttachment:Oe.setOne,setIssueTypeFieldsAttachments:Oe.setMany,updateIssueTypeFieldsAttachment:Oe.updateOne,updateIssueTypeFieldsAttachments:Oe.updateMany,deleteIssueTypeFieldsAttachment:Oe.deleteOne,deleteIssueTypeFieldsAttachments:Oe.deleteMany}}),{initializeIssueTypeFieldsAttachments:oh,addIssueTypeFieldsAttachment:cg,addIssueTypeFieldsAttachments:lh,setIssueTypeFieldsAttachment:ng,setIssueTypeFieldsAttachments:rg,updateIssueTypeFieldsAttachment:dg,updateIssueTypeFieldsAttachments:hh,deleteIssueTypeFieldsAttachment:ug,deleteIssueTypeFieldsAttachments:mh}=Za.actions,ph=t=>t.issueTypeFieldsAttachmentReducer.instances,yh=d.createSelector([ph],t=>Object.values(t)),og=A(d.createSelector([yh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),lg=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],Ah=Za.reducer,Re=P(t=>t.uuid),fh=Re.getInitialState({}),Ja=d.createSlice({name:"issueTypeFieldValues",initialState:fh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,fh)),reducers:{initializeIssueTypeFieldValues:Re.initialize,addIssueTypeFieldValues:Re.addOne,addIssueTypeFieldValuesMany:Re.addMany,setIssueTypeFieldValues:Re.setOne,setIssueTypeFieldValuesMany:Re.setMany,updateIssueTypeFieldValues:Re.updateOne,updateIssueTypeFieldValuesMany:Re.updateMany,deleteIssueTypeFieldValues:Re.deleteOne,deleteIssueTypeFieldValuesMany:Re.deleteMany}}),{initializeIssueTypeFieldValues:Sh,addIssueTypeFieldValues:Xa,addIssueTypeFieldValuesMany:hg,setIssueTypeFieldValues:mg,setIssueTypeFieldValuesMany:pg,updateIssueTypeFieldValues:Tt,updateIssueTypeFieldValuesMany:yg,deleteIssueTypeFieldValues:Qa,deleteIssueTypeFieldValuesMany:Ag}=Ja.actions,Th=t=>t.issueTypeFieldValuesReducer.instances,xa=d.createSelector([Th],t=>Object.values(t)),fg=A(d.createSelector([xa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),ec=t=>e=>e.issueTypeFieldValuesReducer.instances[t],gh=Ja.reducer,ve=P(t=>t.uuid),Ih=ve.getInitialState({}),tc=d.createSlice({name:"issueTypeFields",initialState:Ih,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Ih)),reducers:{initializeIssueTypeFields:ve.initialize,addIssueTypeFields:ve.addOne,addIssueTypeFieldsMany:ve.addMany,setIssueTypeFields:ve.setOne,setIssueTypeFieldsMany:ve.setMany,updateIssueTypeFields:ve.updateOne,updateIssueTypeFieldsMany:ve.updateMany,deleteIssueTypeFields:ve.deleteOne,deleteIssueTypeFieldsMany:ve.deleteMany}}),{initializeIssueTypeFields:bh,addIssueTypeFields:Fh,addIssueTypeFieldsMany:Sg,setIssueTypeFields:Tg,setIssueTypeFieldsMany:gg,updateIssueTypeFields:Ph,updateIssueTypeFieldsMany:Ig,deleteIssueTypeFields:_h,deleteIssueTypeFieldsMany:bg}=tc.actions,Oh=t=>t.issueTypeFieldsReducer.instances,Kt=d.createSelector([Oh],t=>Object.values(t)),Fg=A(d.createSelector([Kt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),Pg=A(d.createSelector([Kt,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),_g=A(d.createSelector([Kt,xa,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.issue_type===i).map(c=>c.uuid));return T(e.filter(c=>a.has(c.fields_revision)))})),Og=t=>e=>e.issueTypeFieldsReducer.instances[t],Rh=tc.reducer,we=P(t=>t.uuid),vh=we.getInitialState({}),sc=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:vh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,vh)),reducers:{initializeIssueTypeFieldValuesAttachments:we.initialize,addIssueTypeFieldValuesAttachment:we.addOne,addIssueTypeFieldValuesAttachments:we.addMany,setIssueTypeFieldValuesAttachment:we.setOne,setIssueTypeFieldValuesAttachments:we.setMany,updateIssueTypeFieldValuesAttachment:we.updateOne,updateIssueTypeFieldValuesAttachments:we.updateMany,deleteIssueTypeFieldValuesAttachment:we.deleteOne,deleteIssueTypeFieldValuesAttachments:we.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:wh,addIssueTypeFieldValuesAttachment:Rg,addIssueTypeFieldValuesAttachments:Yt,setIssueTypeFieldValuesAttachment:vg,setIssueTypeFieldValuesAttachments:wg,updateIssueTypeFieldValuesAttachment:Mg,updateIssueTypeFieldValuesAttachments:Mh,deleteIssueTypeFieldValuesAttachment:Eg,deleteIssueTypeFieldValuesAttachments:Zt}=sc.actions,Eh=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ic=d.createSelector([Eh],t=>Object.values(t)),jg=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],jh=A(d.createSelector([ic,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Vh=A(d.createSelector([ic,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),qh=sc.reducer,Me=P(t=>t.uuid),zh=Me.getInitialState({}),ac=d.createSlice({name:"issueTypeIdentifiers",initialState:zh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,zh)),reducers:{initializeIssueTypeIdentifiers:Me.initialize,addIssueTypeIdentifier:Me.addOne,addIssueTypeIdentifiers:Me.addMany,setIssueTypeIdentifier:Me.setOne,setIssueTypeIdentifiers:Me.setMany,updateIssueTypeIdentifier:Me.updateOne,updateIssueTypeIdentifiers:Me.updateMany,deleteIssueTypeIdentifier:Me.deleteOne,deleteIssueTypeIdentifiers:Me.deleteMany}}),{initializeIssueTypeIdentifiers:Dh,addIssueTypeIdentifier:cc,addIssueTypeIdentifiers:Vg,setIssueTypeIdentifier:qg,setIssueTypeIdentifiers:zg,updateIssueTypeIdentifier:gt,updateIssueTypeIdentifiers:Dg,deleteIssueTypeIdentifier:nc,deleteIssueTypeIdentifiers:Ug}=ac.actions,Uh=t=>t.issueTypeIdentifierReducer.instances,Ch=d.createSelector([Uh],t=>Object.values(t)),rc=t=>e=>e.issueTypeIdentifierReducer.instances[t],Cg=A(d.createSelector([Ch,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),kh=ac.reducer,Ee=P(t=>t.uuid),Bh=Ee.getInitialState({}),dc=d.createSlice({name:"issueTypeIdentifierValues",initialState:Bh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Bh)),reducers:{initializeIssueTypeIdentifierValues:Ee.initialize,addIssueTypeIdentifierValue:Ee.addOne,addIssueTypeIdentifierValues:Ee.addMany,setIssueTypeIdentifierValue:Ee.setOne,setIssueTypeIdentifierValues:Ee.setMany,updateIssueTypeIdentifierValue:Ee.updateOne,updateIssueTypeIdentifierValues:Ee.updateMany,deleteIssueTypeIdentifierValue:Ee.deleteOne,deleteIssueTypeIdentifierValues:Ee.deleteMany}}),{initializeIssueTypeIdentifierValues:$h,addIssueTypeIdentifierValue:uc,addIssueTypeIdentifierValues:kg,setIssueTypeIdentifierValue:Bg,setIssueTypeIdentifierValues:$g,updateIssueTypeIdentifierValue:It,updateIssueTypeIdentifierValues:Gg,deleteIssueTypeIdentifierValue:oc,deleteIssueTypeIdentifierValues:Lg}=dc.actions,Gh=t=>t.issueTypeIdentifierValueReducer.instances,lc=d.createSelector([Gh],t=>Object.values(t)),hc=t=>e=>e.issueTypeIdentifierValueReducer.instances[t],Ng=A(d.createSelector([lc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Hg=A(d.createSelector([lc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type_identifier===e)))),Lh=dc.reducer,U=P(t=>t.uuid),Nh=U.getInitialState({}),mc=d.createSlice({name:"issueTypes",initialState:Nh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Nh)),reducers:{initializeIssueTypes:U.initialize,addIssueType:U.addOne,addIssueTypes:U.addMany,setIssueType:U.setOne,setIssueTypes:U.setMany,updateIssueType:U.updateOne,updateIssueTypes:U.updateMany,deleteIssueType:U.deleteOne,deleteIssueTypes:U.deleteMany,removeIssueType:U.deleteOne}}),{initializeIssueTypes:Hh,addIssueType:Wh,addIssueTypes:Wg,setIssueType:bt,setIssueTypes:Kg,updateIssueType:Kh,updateIssueTypes:Yg,deleteIssueType:Zg,deleteIssueTypes:Jg,removeIssueType:pc}=mc.actions,yc=t=>t.issueTypeReducer.instances,Yh=d.createSelector(yc,t=>Object.values(t)),Ac=t=>e=>e.issueTypeReducer.instances[t],Xg=A(d.createSelector([yc,(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})),Qg=A(d.createSelector([Yh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Zh=mc.reducer,je=P(t=>t.uuid),Jh=je.getInitialState({}),fc=d.createSlice({name:"issueUpdates",initialState:Jh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Jh)),reducers:{initializeIssueUpdates:je.initialize,addIssueUpdate:je.addOne,addIssueUpdates:je.addMany,setIssueUpdate:je.setOne,setIssueUpdates:je.setMany,updateIssueUpdate:je.updateOne,updateIssueUpdates:je.updateMany,deleteIssueUpdate:je.deleteOne,deleteIssueUpdates:je.deleteMany}}),{initializeIssueUpdates:Xh,addIssueUpdate:Qh,addIssueUpdates:xh,setIssueUpdate:xg,setIssueUpdates:eI,updateIssueUpdate:tI,updateIssueUpdates:sI,deleteIssueUpdate:em,deleteIssueUpdates:tm}=fc.actions,sm=t=>t.issueUpdateReducer.instances,im=d.createSelector([sm],t=>Object.values(t)),am=A(d.createSelector([im,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),cm=fc.reducer,Ve=P(t=>t.id),nm=Ve.getInitialState({currentUser:null}),Sc=d.createSlice({name:"users",initialState:nm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,nm)),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:rm,setUsers:iI,setUser:aI,addUsers:cI,addUser:dm,updateUsers:nI,updateUser:rI,deleteUser:um,deleteUsers:dI,setCurrentUser:uI,setProfilePicture:oI}=Sc.actions,om=Sc.reducer,lm=t=>t.userReducer.currentUser,Jt=t=>t.userReducer.instances,Tc=d.createSelector([Jt],t=>Object.values(t)),hm=t=>e=>e.userReducer.instances[t],lI=A(d.createSelector([Jt,(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 T(i)})),qe=P(t=>t.uuid),mm=qe.getInitialState({}),gc=d.createSlice({name:"organizationAccess",initialState:mm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,mm)),reducers:{initializeOrganizationAccesses:qe.initialize,addOrganizationAccess:qe.addOne,addOrganizationAccesses:qe.addMany,setOrganizationAccess:qe.setOne,setOrganizationAccesses:qe.setMany,updateOrganizationAccess:qe.updateOne,updateOrganizationAccesses:qe.updateMany,deleteOrganizationAccess:qe.deleteOne,deleteOrganizationAccesses:qe.deleteMany}}),{initializeOrganizationAccesses:pm,addOrganizationAccess:ym,addOrganizationAccesses:hI,setOrganizationAccess:mI,setOrganizationAccesses:pI,updateOrganizationAccess:Xt,updateOrganizationAccesses:yI,deleteOrganizationAccess:Am,deleteOrganizationAccesses:AI}=gc.actions,fm=gc.reducer,Ic=t=>t.organizationAccessReducer.instances,bc=t=>e=>e.organizationAccessReducer.instances[t],fI=d.createSelector([lm,Ic],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),Sm=d.createSelector([Ic],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return vt(e)}),SI=A(d.createSelector([Jt,Sm,(t,e)=>e],(t,e,i)=>T(Object.values(t).filter(a=>{const c=e[a.id];return!!c&&c.organization===i})))),ze=P(t=>t.uuid),Tm=ze.getInitialState({}),Fc=d.createSlice({name:"organizations",initialState:Tm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Tm)),reducers:{initializeOrganizations:ze.initialize,setOrganizations:ze.setMany,setOrganization:ze.setOne,addOrganizations:ze.addMany,addOrganization:ze.addOne,updateOrganizations:ze.updateMany,updateOrganization:ze.updateOne,deleteOrganization:ze.deleteOne,deleteOrganizations:ze.deleteMany}}),{initializeOrganizations:gm,setOrganizations:TI,setOrganization:gI,addOrganizations:II,addOrganization:Im,updateOrganizations:bI,updateOrganization:bm,deleteOrganization:FI,deleteOrganizations:PI}=Fc.actions,Fm=t=>t.organizationReducer.instances,_I=d.createSelector([Fm],t=>Object.values(t)),OI=t=>e=>e.organizationReducer.instances[t],Pm=Fc.reducer,_m=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Xe.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},Om={deletedRequests:[],latestRetryTime:0},Pc=d.createSlice({name:"outbox",initialState:Om,extraReducers:t=>t.addCase(g,e=>Object.assign(e,Om)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return _m(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}}}),RI=t=>t.outboxReducer.deletedRequests,vI=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Rm,markForDeletion:wI,markAsDeleted:vm,_setLatestRetryTime:wm}=Pc.actions,Mm=Pc.reducer,De=P(t=>t.uuid),Em=De.getInitialState({}),_c=d.createSlice({name:"projectAccess",initialState:Em,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Em)),reducers:{initializeProjectAccesses:De.initialize,addProjectAccess:De.addOne,addProjectAccesses:De.addMany,setProjectAccess:De.setOne,setProjectAccesses:De.setMany,updateProjectAccess:De.updateOne,updateProjectAccesses:De.updateMany,deleteProjectAccess:De.deleteOne,deleteProjectAccesses:De.deleteMany}}),{initializeProjectAccesses:jm,addProjectAccess:Oc,addProjectAccesses:Rc,setProjectAccess:MI,setProjectAccesses:EI,updateProjectAccess:Ft,updateProjectAccesses:Vm,deleteProjectAccess:vc,deleteProjectAccesses:wc}=_c.actions,qm=_c.reducer,Mc=t=>t.projectAccessReducer.instances,Qt=d.createSelector(Mc,t=>Object.values(t)),Ec=t=>e=>e.projectAccessReducer.instances[t],zm=A(d.createSelector([Mc,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.project===e)))),jI=A(d.createSelector([Qt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.project===e))i[a.user]=a;return i})),VI=A(d.createSelector([Tc,Qt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.project===i).map(c=>c.user));return T(t.filter(c=>a.has(c.id)))})),Ue=P(t=>t.uuid),Dm=Ue.getInitialState({}),jc=d.createSlice({name:"projectAttachments",initialState:Dm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Dm)),reducers:{initializeProjectAttachments:Ue.initialize,addProjectAttachment:Ue.addOne,addProjectAttachments:Ue.addMany,setProjectAttachment:Ue.setOne,setProjectAttachments:Ue.setMany,updateProjectAttachment:Ue.updateOne,updateProjectAttachments:Ue.updateMany,deleteProjectAttachment:Ue.deleteOne,deleteProjectAttachments:Ue.deleteMany}}),{initializeProjectAttachments:Vc,addProjectAttachment:qI,addProjectAttachments:Um,setProjectAttachment:Cm,setProjectAttachments:km,updateProjectAttachment:zI,updateProjectAttachments:Bm,deleteProjectAttachment:$m,deleteProjectAttachments:qc}=jc.actions,Gm=t=>t.projectAttachmentReducer.instances,Lm=d.createSelector([Gm],t=>Object.values(t)),Nm=t=>e=>e.projectAttachmentReducer.instances[t],Hm=A(d.createSelector([Lm,(t,e)=>e],(t,e)=>T(t.filter(({project:i})=>e===i)))),Wm=jc.reducer,Ce=P(t=>t.uuid),Km=Ce.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),zc=d.createSlice({name:"projectFiles",initialState:Km,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Km)),reducers:{initializeProjectFiles:Ce.initialize,setProjectFile:Ce.setOne,setProjectFiles:Ce.setMany,addProjectFile:Ce.addOne,addProjectFiles:Ce.addMany,updateProjectFile:Ce.updateOne,updateProjectFiles:Ce.updateMany,deleteProjectFile:Ce.deleteOne,deleteProjectFiles:Ce.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}}}),{initializeProjectFiles:Ym,setProjectFile:DI,setProjectFiles:UI,addProjectFile:CI,addProjectFiles:Zm,updateProjectFile:Dc,updateProjectFiles:kI,deleteProjectFile:Jm,deleteProjectFiles:Xm,setIsImportingProjectFile:Qm,setActiveProjectFileId:xm,saveActiveProjectFileBounds:ep}=zc.actions,tp=t=>t.projectFileReducer.instances,sp=d.createSelector([tp],t=>T(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),BI=t=>e=>e.projectFileReducer.instances[t],$I=t=>t.projectFileReducer.activeProjectFileId,GI=t=>t.projectFileReducer.isImportingProjectFile,ip=zc.reducer,ke=P(t=>t.uuid),ap=ke.getInitialState({}),Uc=d.createSlice({name:"projectFolders",initialState:ap,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,ap)),reducers:{initializeProjectFolders:ke.initialize,addProjectFolder:ke.addOne,addProjectFolders:ke.addMany,setProjectFolder:ke.setOne,setProjectFolders:ke.setMany,updateProjectFolder:ke.updateOne,updateProjectFolders:ke.updateMany,deleteProjectFolder:ke.deleteOne,deleteProjectFolders:ke.deleteMany}}),{initializeProjectFolders:cp,addProjectFolder:Cc,addProjectFolders:LI,setProjectFolder:NI,setProjectFolders:HI,updateProjectFolder:Pt,updateProjectFolders:WI,deleteProjectFolder:kc,deleteProjectFolders:KI}=Uc.actions,Bc=t=>t.projectFolderReducer.instances,np=d.createSelector([Bc],t=>Object.values(t)),$c=t=>e=>e.projectFolderReducer.instances[t],YI=A(d.createSelector([Bc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectProjectFoldersByIds: No project folder exists with the id",a)}return T(i)})),ZI=A(d.createSelector([np,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),rp=Uc.reducer,Be=P(t=>t.uuid),dp=Be.getInitialState({}),Gc=d.createSlice({name:"projects",initialState:dp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,dp)),reducers:{initializeProjects:Be.initialize,setProjects:Be.setMany,setProject:Be.setOne,addProjects:Be.addMany,addProject:Be.addOne,updateProjects:Be.updateMany,updateProject:Be.updateOne,deleteProject:Be.deleteOne,deleteProjects:Be.deleteMany}}),{initializeProjects:up,setProjects:JI,setProject:XI,addProjects:QI,addProject:Lc,updateProjects:xI,updateProject:op,deleteProject:Nc,deleteProjects:eb}=Gc.actions,lp=Gc.reducer,hp=t=>t.projectReducer.instances,Hc=d.createSelector([hp],t=>T(Object.values(t))),mp=t=>e=>e.projectReducer.instances[t],tb=A(d.createSelector([Hc,Qt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.user===i).map(c=>c.project));return T(t.filter(c=>a.has(c.uuid)))})),sb=A(d.createSelector([Hc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),ib={isRehydrated:!1},Wc=d.createSlice({name:"rehydrated",initialState:ib,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:ab}=Wc.actions,cb=t=>t.rehydratedReducer.isRehydrated,pp=Wc.reducer,$e=P(t=>t.uuid),yp=$e.getInitialState({}),Kc=d.createSlice({name:"teamMemberships",initialState:yp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,yp)),reducers:{initializeTeamMemberships:$e.initialize,addTeamMembership:$e.addOne,addTeamMemberships:$e.addMany,setTeamMembership:$e.setOne,setTeamMemberships:$e.setMany,updateTeamMembership:$e.updateOne,updateTeamMemberships:$e.updateMany,deleteTeamMembership:$e.deleteOne,deleteTeamMemberships:$e.deleteMany}}),{initializeTeamMemberships:Ap,addTeamMembership:fp,addTeamMemberships:Sp,setTeamMembership:Yc,setTeamMemberships:Tp,updateTeamMembership:nb,updateTeamMemberships:rb,deleteTeamMembership:Zc,deleteTeamMemberships:gp}=Kc.actions,Ip=Kc.reducer,bp=t=>t.teamMembershipReducer.instances,Jc=d.createSelector([bp],t=>Object.values(t)),Fp=t=>e=>e.teamMembershipReducer.instances[t],db=A(d.createSelector([Jc,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.team===e))i[a.user]=a;return i})),ub=A(d.createSelector([Tc,Jc,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.team===i).map(c=>c.user));return T(t.filter(c=>a.has(c.id)))})),Ge=P(t=>t.uuid),Pp=Ge.getInitialState({}),Xc=d.createSlice({name:"teams",initialState:Pp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Pp)),reducers:{initializeTeams:Ge.initialize,addTeam:Ge.addOne,addTeams:Ge.addMany,setTeam:Ge.setOne,setTeams:Ge.setMany,updateTeam:Ge.updateOne,updateTeams:Ge.updateMany,deleteTeam:Ge.deleteOne,deleteTeams:Ge.deleteMany}}),{initializeTeams:_p,addTeam:Op,addTeams:ob,setTeam:_t,setTeams:lb,updateTeam:Rp,updateTeams:hb,deleteTeam:Qc,deleteTeams:mb}=Xc.actions,xc=t=>t.teamReducer.instances,vp=d.createSelector([xc],t=>Object.values(t)),en=t=>e=>e.teamReducer.instances[t],pb=A(d.createSelector([xc,(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 T(i)})),yb=A(d.createSelector([vp,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),wp=Xc.reducer,Ab={version:0},Mp=d.createSlice({name:"versioning",initialState:Ab,reducers:{}}),Ep=Mp.reducer,tn={outboxReducer:Mm,fileReducer:Ao,authReducer:Du},fb=d.combineReducers(tn),jp={...tn,[it]:Ep,categoryReducer:Gu,assetReducer:Pd,assetAttachmentReducer:Ln,assetStageCompletionReducer:wd,assetStageReducer:zd,assetTypeReducer:Vu,assetTypeAttachmentReducer:Hd,issueReducer:Ql,issueAttachmentReducer:jl,issueTypeReducer:Zh,issueTypeAttachmentReducer:dh,organizationReducer:Pm,projectReducer:lp,projectAttachmentReducer:Wm,projectAccessReducer:qm,organizationAccessReducer:fm,projectFileReducer:ip,projectFolderReducer:rp,rehydratedReducer:pp,formReducer:Go,formRevisionReducer:ko,formRevisionAttachmentReducer:jo,formSubmissionAttachmentReducer:Qo,formSubmissionReducer:cl,formIdentifierReducer:Io,formIdentifierValueReducer:_o,userReducer:om,emailDomainsReducer:lo,documentsReducer:io,documentAttachmentReducer:Qu,teamReducer:wp,agentsReducer:qn,issueCommentReducer:Wl,issueCommentAttachmentReducer:Gl,issueUpdateReducer:cm,geoImageReducer:yl,issueAssociationReducer:Fl,issueTypeFieldsReducer:Rh,issueTypeFieldValuesReducer:gh,issueTypeFieldsAttachmentReducer:Ah,issueTypeFieldValuesAttachmentReducer:qh,issueTypeIdentifierReducer:kh,issueTypeIdentifierValueReducer:Lh,assetTypeFieldsReducer:nu,assetTypeFieldValuesReducer:gu,assetTypeFieldsAttachmentReducer:xd,assetTypeFieldValuesAttachmentReducer:mu,assetTypeIdentifierReducer:_u,assetTypeIdentifierValueReducer:wu,assetProcedureTypeReducer:Ur,assetProcedureReducer:Vr,assetProcedureTypeFieldsReducer:mr,assetProcedureFieldValuesReducer:Rr,assetProcedureTypeFieldsAttachmentReducer:cr,assetProcedureTypeFieldValuesAttachmentReducer:Sr,assetProcedureTypeAttachmentReducer:Jn,assetProcedureStepFieldsAttachmentReducer:Wr,assetProcedureStepFieldsReducer:Zr,assetProcedureStepFieldValuesAttachmentReducer:sd,assetProcedureStepFieldValuesReducer:ud,assetProcedureStepReducer:fd,teamMembershipReducer:Ip},Sb=d.combineReducers(jp);function Tb(t,e){return iy.useMemo(t,e)}class gb{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=>T(this.performOperations(e)))}}const Vp=1e4,Le=200,qp={};class zp{constructor(e){S(this,"client");S(this,"pageSize",Vp);qp[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 Dp=()=>kp.length-1,Up=t=>(t[it]={version:Dp()},t),Cp=()=>Up({}),Ib=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),bb=t=>e=>{var i;return e===void 0&&(e={}),((i=e[it])==null?void 0:i.version)===Dp()?e:t(e)},kp=[Up,Cp,Cp,Ib],Fb=Object.fromEntries(kp.map((t,e)=>[e,bb(t)])),Pb=t=>{if(t)throw t;const e=st();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Bp=(t,e,i)=>{const a=Ze();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},$p=(t,e,i)=>{const a=Ze();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 _b(t,e){if(!e.payload)throw new Error("Received empty payload");return xp(e)}const Ob={...on,effect:_b,discard:Lp,returnPromises:!0,persistCallback:Pb,retry:Eb,persistOptions:{storage:cy},queue:{...on.queue,enqueue:Bp,dequeue:$p,peek:(...t)=>Mb(...t)}},Rb=ny(Fb,it),vb=d.compose(ay.offline(Ob),Rb);function wb(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 sn(t,e,i){if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const c=qp[t.meta.offline.effect.serviceName];if(!c)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const n=c instanceof O;n&&t.payload.checkAuth!==!1&&await c.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},u=t.meta.offline.effect,{payload:m,headers:o,method:h,queryParams:p,attachmentHash:y,isExternalUrl:f,isAuthNeeded:I,isResponseBlob:b}={...r,...u.request},R=u.request;let w=R.url;const q=y?await e.files.fetchCache(y):void 0;if(y&&!q)throw new Error(`Cannot upload file ${y} because it's not cached.`);!f&&!w.startsWith("http")&&(!w.startsWith("/")&&!w.startsWith("blob:")&&(w="/"+w),w=t.meta.offline.effect.BASE_URL+w);const Ne=V=>{if(y){const He=R.s3url;if(!He)throw new Error(`No S3 URL for file ${y}`);if("warning"in He)throw new Error(`S3 URL warning for file ${y}`);if(!q)throw new Error(`No file for file ${y}`);const Ot=He.fields["x-amz-checksum-sha1"];if(!Ot)throw new Error(`No checksum for file ${y}`);return V.set("x-amz-checksum-sha1",Ot).field({...m,...He.fields}).attach("file",q)}return V.send(m)},XF={[l.GET]:()=>b?Je.get(w.toString()).responseType("blob"):Je.get(w.toString()),[l.POST]:()=>{const V=Je.post(w.toString());return Ne(V)},[l.PATCH]:()=>{const V=Je.patch(w.toString());return Ne(V)},[l.PUT]:()=>{const V=Je.put(w.toString());return Ne(V)},[l.DELETE]:()=>{const V=Je.delete(w.toString());return Ne(V)}}[h];let Ke=XF();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",R),Ke.abort()}),I&&n){const V=c.auth.getAuthHeader();Ke=Ke.set("Authorization",V)}o&&(Ke=Ke.set(o));try{return await Ke.query(p)}catch(V){const He=wb(V),Ot=He==null?void 0:He.status;if(n&&Ot===401)return await c.auth.handleUnauthorized(Ke,He),Ke.query(p);throw new D({response:He,innerError:V,discard:Gp.includes(Ot)})}}const Gp=[400,409,403,404,405,500];function Lp(t,e,i=0){var o;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
`):`${c}: ${JSON.stringify(n)}`).join(`
|
|
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>jb?et:i}class D extends Error{constructor(i){super(et);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:c}=i;this.message=i.message??Vb(a,c)??et,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class qb extends zp{constructor(e){super(e)}}class O extends zp{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class zb extends O{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(En(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(c=>{this.dispatch(Vn(c))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:l.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(jn(i))})}async rate(e,i){return this.enqueueRequest({description:"Rate agent response",method:l.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:l.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(Mn(a)),a}}class j extends O{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:c,documentAttachmentReducer:n,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:y,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(u.instances),Object.values(m.instances),Object.values(o.instances),Object.values(h.instances),Object.values(p.instances),Object.values(y.instances),Object.values(f.instances)).filter(b=>b.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:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return i}async getFilePayload(e){const i=await Qe(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 We extends j{constructor(){super(...arguments);S(this,"pageSize",Le)}async _bulkAdd(i){var h;const{store:a}=this.client,c=(h=a.getState().userReducer.currentUser)==null?void 0:h.id,n=new Date().toISOString(),r=[],u=[],m={};for(const p of i){const{modelUuid:y,file:f}=p,I=await this.getFilePayload(f);I.sha1 in m||(m[I.sha1]=I);const b=this.buildModel({file:f,file_sha1:I.sha1,submitted_at:n,created_by:c,modelUuid:y});r.push(b),u.push(this.buildPayload(b,I))}this.dispatch(this.addAttachments(r));const o=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:n,attachments:u,files:Object.values(m)},blocks:r.map(p=>this.getId(p)),blockers:r.map(p=>p.file_sha1)});return o.then(({attachments:p,presigned_urls:y})=>{this.dispatch(this.updateAttachments(p)),this.processPresignedUrls(y)}).catch(()=>{this.dispatch(this.removeAttachments(r.map(p=>this.getId(p))))}),[r,o.then(({attachments:p})=>p)]}async _delete(i){const{store:a}=this.client,c=this.selectAttachment(i)(a.getState());if(!c)throw new Error(`Attempting to delete attachment with uuid ${i} that does not exist in the store`);this.dispatch(this.removeAttachment(this.getId(c)));const n=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${i}/`,blockers:[i],blocks:[]});return n.then(()=>{this.getNumberOfAttachmentsWithSha1(c.file_sha1)===0&&this.client.files.removeCache(c.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(c))}),n}}class Db extends We{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",os);S(this,"addAttachments",ls);S(this,"updateAttachments",Un);S(this,"removeAttachments",hs);S(this,"removeAttachment",Cn);S(this,"setAttachment",Dn);S(this,"selectAttachment",$n)}getId(i){return i.uuid}buildModel(i){return F({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,asset:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset:i.asset}}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:l.GET,url:`${this.url}/`,queryParams:{limit:Le,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(os(n)),n}}class Ub extends We{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"initializeAttachments",ps);S(this,"addAttachments",Hn);S(this,"updateAttachments",Kn);S(this,"removeAttachments",Zn);S(this,"removeAttachment",Yn);S(this,"setAttachment",Wn);S(this,"selectAttachment",xn)}getId(i){return i.uuid}buildModel(i){return F({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,asset_procedure_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset_procedure_type:i.asset_procedure_type}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureTypeUuid,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:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(ps(c)),c}}class Cb extends j{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 o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(sr(n));const u=this.enqueueRequest({description:"Add asset procedure type fields attachments",method:l.POST,url:"/asset-procedure-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(ir(o.attachments))}).catch(()=>{this.dispatch(ar(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure type fields attachments",method:l.GET,url:"/asset-procedure-type-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(tr(a)),a}}class kb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(or(n));const r=this.enqueueRequest({description:"Add Asset Procedure Type Fields",method:l.POST,url:"/asset-procedure-type-fields/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(lr(m))}).catch(m=>{throw this.dispatch(hr(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Type Fields",method:l.GET,url:"/asset-procedure-type-fields/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ur(a)),a}}function Ye(t,e){const i=[];let a=0;const c=t.length;for(;a<c;)i.push(t.slice(a,a+=e));return i}class Bb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(wt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure type field values attachments",method:l.POST,url:"/asset-procedure-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(fr(p))}).catch(h=>{throw this.dispatch(Mt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=gr(e)(a);this.dispatch(Mt(e));try{await this.enqueueRequest({description:"Delete asset procedure type field values attachments",method:l.DELETE,url:"/asset-procedure-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(wt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:"/asset-procedure-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ar(c)),c}}class $b extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[c.uuid]});return this.dispatch(Is(c)),n.then(u=>(this.dispatch(at(u)),u)).catch(()=>{this.dispatch(bs(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Pr(c));const u=[];for(const o of r){const h=o.field_values.map(b=>b.asset),p=o.field_values.map(b=>b.fields_revision),y=o.field_values.map(b=>b.asset_procedure),f=o.field_values.map(b=>b.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/bulk/",payload:o,blockers:[...h,...p,...y],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(_r(o.flat()))}).catch(()=>{this.dispatch(Or(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=Ps(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(at(n));const r=this.enqueueRequest({description:"Update asset procedure type field values",method:l.PATCH,url:`/asset-procedure-type-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure],blocks:[n.uuid]});return r.then(u=>{this.dispatch(at(u))}).catch(()=>{this.dispatch(at(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ps(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Ir(e)(a);this.dispatch(bs(e)),this.dispatch(Mt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure type field values",method:l.DELETE,url:`/asset-procedure-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Is(c)),this.dispatch(wt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:"/asset-procedure-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fr(c)),c}}class Gb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Os(n));const r=this.enqueueRequest({description:"Create asset procedure",method:l.POST,url:"/asset-procedures/",payload:v(n),blockers:[e.asset_procedure_type,e.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ct(m))}).catch(()=>{this.dispatch(Rs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ms(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ct(c));const n=this.enqueueRequest({description:"Update asset procedure",method:l.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(ct(r))}).catch(()=>{this.dispatch(ct(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ms(e)(a);if(!c)throw new Error(`Expected asset procedure with uuid ${e} to exist`);return this.dispatch(Rs(e)),this.enqueueRequest({description:"Delete asset procedure",method:l.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(Os(c)),n})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedures",method:l.GET,url:"/asset-procedures/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedures",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Mr(c)),c}}class Lb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(js(n));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(nt(m))}).catch(()=>{this.dispatch(Vs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=zs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(nt(c));const n=this.enqueueRequest({description:"Update asset procedure type",method:l.PATCH,url:`/asset-procedure-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=zs(e)(a);if(!c)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const n=qr(e)(a);return this.dispatch(Vs(e)),this.dispatch(jr(n.map(({uuid:r})=>r))),this.enqueueRequest({description:"Delete asset procedure type",method:l.DELETE,url:`/asset-procedure-types/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(js(c)),this.dispatch(Er(n)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure types",method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Dr(a)),a}}class Nb extends j{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 o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch($r(n));const u=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:l.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Gr(o.attachments))}).catch(()=>{this.dispatch(Lr(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Br(a)),a}}class Hb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Cs(n));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(n),blockers:[n.asset_procedure_step],blocks:[n.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(m=>{throw this.dispatch(ks(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(rt(c));const n=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:l.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(rt(r))}).catch(r=>{throw this.dispatch(rt(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(ks(e));const c=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return c.catch(n=>{throw this.dispatch(Cs(a)),n}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Yr(a)),a}}class Wb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(Et(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:l.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(Qr(p))}).catch(h=>{throw this.dispatch(jt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=ed(e)(a);this.dispatch(jt(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:l.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(Et(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Xr(c)),c}}class Kb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...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:l.POST,url:"/asset-procedure-step-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[c.uuid]});return this.dispatch(Hs(c)),n.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Ws(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(cd(c));const u=[];for(const o of r){const h=o.field_values.map(b=>b.asset),p=o.field_values.map(b=>b.fields_revision),y=o.field_values.map(b=>b.asset_procedure),f=o.field_values.map(b=>b.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/bulk/",payload:o,blockers:[...h,...p,...y],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(nd(o.flat()))}).catch(()=>{this.dispatch(rd(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=Ks(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(dt(n));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:l.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure],blocks:[n.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ks(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=td(e)(a);this.dispatch(Ws(e)),this.dispatch(jt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:l.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Hs(c)),this.dispatch(Et(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ad(c)),c}}class Yb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(md(n));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(qt(m))}).catch(()=>{this.dispatch(yd(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Zs(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(qt(c));const n=this.enqueueRequest({description:"Update asset procedure step",method:l.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(qt(r))}).catch(()=>{this.dispatch(hd(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Zs(e)(a);if(!c)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const n=Td(e)(a);return this.dispatch(Ad([e,...Pn(n)])),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-procedure-steps/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(pd([c,...n])),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:l.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ld(a)),a}}class Zb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Xs(n));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ot(m))}).catch(()=>{this.dispatch(Qs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=si(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(ot(c));const n=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ot(r))}).catch(()=>{this.dispatch(ot(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=si(e)(a);if(!c)throw new Error(`No asset with uuid ${e} found in the store`);const n=Gn(e)(a),r=bl(e)(a);if(this.dispatch(Qs(e)),n.length>0){const u=n.map(({uuid:m})=>m);this.dispatch(hs(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(wa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Xs(c)),this.dispatch(ls(n)),this.dispatch(Ra(r)),u})}bulkAdd(e,i,a,c){const n=new Date().toISOString(),r=Xe.v4(),u=Ye(e,c).map(h=>{const p=h.map(y=>F(y));return{batchId:Xe.v4(),payload:{transaction_id:r,submitted_at:n,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:y}=h,f=y.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const b=f;b.push(p);const R=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:y,blockers:I,blocks:b});o=h.batchId,m.push(R)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(zt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Fd(e)(a);this.dispatch(xs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/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 assets",method:l.GET,url:"/assets/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get assets",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Id(c)),c}}class Jb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ai(n));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(n),blockers:[e.asset,e.asset_stage],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Rd(m))}).catch(()=>{this.dispatch(ni(n.uuid))}),[n,r]}delete(e){const{store:i}=this.client,a=Md(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ni(e));const c=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ai(a))}),c}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),c=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,n=e.map(h=>F(h)),r=n.map(h=>({...h,created_by:c,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ci(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:n},blockers:[...e.map(h=>h.asset_procedure),...e.map(h=>h.asset_stage),...e.map(h=>h.asset)],blocks:u});return m.then(h=>{this.dispatch(vd(h))}).catch(()=>{this.dispatch(ri(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Ed(e)(i.getState());this.dispatch(ri(e));const c=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return c.catch(()=>{this.dispatch(ci(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Od(c)),c}}class Xb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(oi(n));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Dt(m))}).catch(()=>{this.dispatch(li(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=hi(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(Dt(c));const n=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Dt(r))}).catch(()=>{this.dispatch(qd(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=hi(e)(a);if(!c)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(li(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(oi(c)),n})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Vd(a)),a}}class Qb extends We{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"initializeAttachments",pi);S(this,"addAttachments",yi);S(this,"updateAttachments",kd);S(this,"removeAttachments",Ai);S(this,"removeAttachment",Bd);S(this,"setAttachment",Cd);S(this,"selectAttachment",Ld)}getId(i){return i.uuid}buildModel(i){return F({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,asset_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset_type:i.asset_type}}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:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(pi(c)),c}}class xb extends j{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 o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(Yd(n));const u=this.enqueueRequest({description:"Add asset type fields attachments",method:l.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Zd(o.attachments))}).catch(()=>{this.dispatch(Jd(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Kd(a)),a}}class eF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(su(n));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(iu(m))}).catch(m=>{throw this.dispatch(au(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(tu(a)),a}}class tF extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(kt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset type field values attachments",method:l.POST,url:"/asset-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(uu(p))}).catch(h=>{throw this.dispatch(Bt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=lu(e)(a);this.dispatch(Bt(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:l.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(kt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(du(c)),c}}class sF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...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:l.POST,url:"/asset-type-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision],blocks:[c.uuid]});return this.dispatch(bi(c)),n.then(u=>(this.dispatch(lt(u)),u)).catch(()=>{this.dispatch(Fi(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Au(c));const u=[];for(const o of r){const h=o.field_values.map(I=>I.asset),p=o.field_values.map(I=>I.fields_revision),y=o.field_values.map(I=>I.uuid),f=this.enqueueRequest({description:"Bulk add asset type field values",method:l.POST,url:"/asset-type-field-values/bulk/",payload:o,blockers:[...h,...p],blocks:y});u.push(f)}return Promise.all(u).then(o=>{this.dispatch(fu(o.flat()))}).catch(()=>{this.dispatch(Su(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=_i(e.uuid)(a);if(!c)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(lt(n));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.asset],blocks:[n.uuid]});return r.then(u=>{this.dispatch(lt(u))}).catch(()=>{this.dispatch(lt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=_i(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=hu(e)(a);this.dispatch(Fi(e)),this.dispatch(Bt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:l.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(bi(c)),this.dispatch(kt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yu(c)),c}}class iF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ri(n));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(vi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=wi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ht(c));const n=this.enqueueRequest({description:"Update asset type identifier",method:l.PATCH,url:`/asset-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=wi(e)(a);if(!c)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(vi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Ri(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type identifiers",method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(bu(a)),a}}class aF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ei(n));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(n),blockers:[e.asset,e.asset_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(ji(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=qi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(mt(c));const n=this.enqueueRequest({description:"Update asset type identifier value",method:l.PATCH,url:`/asset-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=qi(e)(a);if(!c)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(ji(e));try{return await this.enqueueRequest({description:"Delete asset type identifier value",method:l.DELETE,url:`/asset-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Ei(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ru(c)),c}}class cF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Di(n));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(Ui(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ki(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(pt(c));const n=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ki(e)(a);if(!c)throw new Error(`Expected asset type with uuid ${e} to exist`);const n=ti(e)(a),r=Nd(e)(a);return this.dispatch(Ui(e)),this.dispatch(xs(n.map(u=>u.uuid))),this.dispatch(Ai(r.map(({uuid:u})=>u))),this.enqueueRequest({description:"Delete asset type",method:l.DELETE,url:`/asset-types/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Di(c)),this.dispatch(zt(n)),this.dispatch(yi(r)),u})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:l.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Eu(a)),a}}class nF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch($i(n));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(n),blockers:[e.project],blocks:[n.uuid]});return[n,r]}update(e){const i=this.client.store.getState(),a=Li(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(ku(c));const n=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[c,n]}remove(e){const{store:i}=this.client,a=Li(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Bu(e));const c=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch($i(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:l.GET,url:"/categories/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(Cu(a)),a}}class rF extends We{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"initializeAttachments",Hi);S(this,"addAttachments",Nu);S(this,"updateAttachments",Wu);S(this,"removeAttachments",Yu);S(this,"removeAttachment",Ku);S(this,"setAttachment",Hu);S(this,"selectAttachment",Xu)}getId(i){return i.uuid}buildModel(i){return F({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,document:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,document:i.document}}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=[],u=[],m={},o={};for(const y of i){const{documentUuid:f,file:I}=y,b=await this.getFilePayload(I);b.sha1 in m||(m[b.sha1]=b,o[b.sha1]=[]);const R=this.buildModel({file:I,file_sha1:b.sha1,submitted_at:n,created_by:c,modelUuid:f});r.push(R),u.push(this.buildPayload(R,b)),o[b.sha1].push(R.uuid)}this.dispatch(this.addAttachments(r));const h=this.enqueueRequest({description:"Attach files to document",method:l.POST,url:"/document-attachments/bulk/",payload:{submitted_at:n,attachments:u,files:Object.values(m)},blocks:r.map(y=>y.uuid),blockers:r.map(y=>y.file_sha1)});return h.then(({attachments:y,presigned_urls:f})=>{this.dispatch(this.updateAttachments(y));const I=this.processPresignedUrls(f);for(const[b,R]of Object.entries(I))R.then(()=>{const w=o[b];for(const q of w)this.makeReadable(q)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(y=>y.uuid)))}),[r,h.then(({attachments:y})=>y)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:l.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:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...c,...n];return this.dispatch(Hi(r)),r}}class dF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(to([n]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(n),queryParams:{parent_document:n.parent_document??void 0},blockers:n.parent_document?[n.parent_document]:[],blocks:[n.uuid]});return r.catch(()=>{this.dispatch(Ki([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(xe([c]));const n=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{xe([a])}),[c,n]}delete(e){const{store:i}=this.client,a=Gt(i.getState()),c=so(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(Ki([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(xe(u))}).catch(()=>{this.dispatch(xe([c])),n&&this.dispatch(xe([n]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:l.GET,url:"/documents/",queryParams:{project__organization:e},blockers:[],blocks:[]},i),c=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),n=[...await a,...await c];return this.dispatch(eo(n)),n}}class uF extends O{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:l.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(ro(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:l.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(no(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:l.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(co(a)),a}}class oF extends O{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:l.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:l.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const xt={},an=new Set;let es=0,cn=0,nn=0;const lF=20;class hF extends O{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",ry.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 ns(a,i),n=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Qe(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${c}`]});return"url"in n&&this.dispatch(po({sha1:i,...n})),n}async addCache(i,a){if(an.has(a))return;if(!i.type){const r=i.name.split("."),u=r[r.length-1];i=new File([i],i.name,{type:u})}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),es++):(await c.put("files",i,a),cn++),an.add(a),nn++,nn%lF===0&&console.debug(`File cache summary: ${es} hits and ${cn} misses, ${es/(es+cn)*100}% hit rate over ${nn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),an.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return yo(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 ns(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)];throw new Error(r.warning)}const u=r.url,m=this.enqueueRequest({url:u,description:"Upload file",method:l.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 h=await gn(i),p=new File([h],c??a,{type:h.type});return await this.addCache(p,a),p}let u=xt[n],m=!0;u?m=!1:(u=new Promise(h=>{this.enqueueRequest({description:"Download file",method:l.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const y=new File([p],c??a,{type:p.type});h(y)})}),xt[n]=u);let o;try{o=await u}catch(h){throw m&&h instanceof D&&delete xt[n],h}if(m){const h=await Qe(o);if(h!==a){const f=`The hash of the file returned from the server (${h}) does not match the
|
|
9
|
-
expected hash (${a}). This can happen if you're using a local development server and the
|
|
1
|
+
(function(i,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),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","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],L):(i=typeof globalThis<"u"?globalThis:i||self,L(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,L,l,St,dt,sb,ib,mc,nb,pc,cb,AR,IR,ab,rb,db){"use strict";var fR=Object.defineProperty;var SR=(i,L,l)=>L in i?fR(i,L,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[L]=l;var h=(i,L,l)=>SR(i,typeof L!="symbol"?L+"":L,l);var eb;const yc=Object.freeze([]),fc=Object.freeze({}),Sc=6e4,Ac=["created_at","updated_at","index","revision"];var Ic=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Ic||{}),o=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(o||{}),Tc=(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))(Tc||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),Oc=(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))(Oc||{}),Pc=(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))(Pc||{}),Fc=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t))(Fc||{}),bc=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(bc||{});function P(t){return{addOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},addMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},setOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},setMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},updateOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},updateMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},deleteOne:(m,f)=>{delete m.instances[f.payload]},deleteMany:(m,f)=>{for(const I of f.payload)delete m.instances[I]},initialize:(m,f)=>{m.instances={};const I=new Set;for(const R of f.payload){const b=t(R);I.add(b),m.instances[b]=R}I.size!==f.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function ub(t){return{initializeSelection:(d,p)=>{d[t]=Array.from(new Set(p.payload))},selectOne:(d,p)=>{console.debug(d,d[t]),!new Set(d[t]).has(p.payload)&&d[t].push(p.payload)},selectMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)||m.add(f);d[t]=Array.from(m)},unselectOne:(d,p)=>{const m=new Set(d[t]);m.has(p.payload)&&(m.delete(p.payload),d[t]=Array.from(m))},unselectMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)&&m.delete(f);d[t]=Array.from(m)},toggleOne:(d,p)=>{const m=new Set(d[t]);m.has(p.payload)?m.delete(p.payload):m.add(p.payload),d[t]=Array.from(m)},toggleMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)?m.delete(f):m.add(f);d[t]=Array.from(m)}}}const T=l.createAction("RESET"),V=l.createAction("RESET_PROJECT_STATE"),F=l.createAction("RESET_ORGANIZATION_STATE");function lb(t,s){return sb.useMemo(t,s)}eb=Symbol.toStringTag;class us{constructor(){h(this,eb,"Promise");h(this,"_promise");h(this,"_resolve");h(this,"_reject");h(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 ls=!1;["true","1"].includes("".toLowerCase())&&(ls=!0);function ob(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),c=e.length;if(c!==n.length)return!1;for(let r=0;r<c;r++){const a=e[r];if(!Object.prototype.hasOwnProperty.call(s,a)||t[a]!==s[a])return!1}return!0}function os(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ls&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ls&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function hb(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 S=t=>t.length===0?yc:t,hs=t=>Object.keys(t).length===0?fc:t,_c=os(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ms.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),mb=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),pb=1e3*86400,ms=new Date,yb=t=>new Date(t).toDateString()===ms.toDateString(),fb=os((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ms.getTime())/pb);return n<s||n>e?_c(t):mb.format(n,"days")});function Sb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function qt(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const c=n.result;if(!c){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",c).then(r=>{const a=Sb(r);s(a)})},n.readAsArrayBuffer(t)})}const Ab=(t,s)=>`${t}${s?`.${s}`:""}`;function Ib(t,s){return new File([t],s,{type:t.type})}function gc(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Mc=async t=>(await fetch(t)).blob(),Rc=async(t,s)=>{const e=await Mc(t);return new File([e],s,{type:e.type})};function wc(t){return typeof t=="string"&&t.startsWith("blob:")}function Tb(t){return t.type.startsWith("image/")}const vc={};function Ob(t,s,e,...n){const c=vc[t];let r=!1;c?c[s]||(c[s]=!0,r=!0):(vc[t]={[s]:!0},r=!0),r&&console[e](...n)}function O(t){return{...t,uuid:dt.v4()}}function Pb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function w(t){return t.map(({uuid:s})=>s)}function Ct(t,s){return t.localeCompare(s)}function ps(t,s){return Ct(t.uuid,s.uuid)}function Fb(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const r=t.split(".");r.length>1&&(s=r[r.length-1])}s&&!s.startsWith(".")&&(s="."+s);const c=s?s.length:0;return n.length+c>e&&(n=n.slice(0,e-c)+(s||"")),n}function bb(t){return t.toLowerCase().replace(" ","-")}function _b(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function gb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Mb=/^.+@.+\..+$/,Ec=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Bc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Vc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,zc=t=>ib(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Rb=t=>{const{roots:s}=zc(t);return s.map(e=>new mc.Tree(e))},Dc=(t,s)=>{const{nodes:e}=zc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new mc.Tree(n)},At=(t,s)=>t.submitted_at===s.submitted_at?0:t.submitted_at<s.submitted_at?-1:1;class wb{constructor(s){h(this,"operations",[]);h(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(c=>c[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(c=>c[s]!==e)),this}orderBy(s){return this.operations.push(e=>e.toSorted((n,c)=>n[s]<=c[s]?1:-1)),this}reverse(){return this.operations.push(s=>s.toReversed()),this}all(){return this.operations.push(s=>s),this}get(s,e){return l.createSelector([this.getData],n=>this.performOperations(n).find(c=>c[s]===e))}count(){return l.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return l.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return l.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return l.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return l.createSelector([this.getData],s=>S(this.performOperations(s)))}}const y=t=>(...s)=>e=>t(e,...s),H=P(t=>t.uuid),jc={instances:{}},ys=l.createSlice({name:"agents",initialState:jc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,jc)),reducers:{initializeConversations:H.initialize,addConversation:H.addOne,addConversations:H.addMany,setConversation:H.setOne,setConversations:H.setMany,updateConversation:H.updateOne,updateConversations:H.updateMany,deleteConversation:H.deleteOne,deleteConversations:H.deleteMany}}),{initializeConversations:qc,addConversation:Cc,addConversations:vb,setConversation:$c,setConversations:Eb,updateConversation:Uc,updateConversations:Bb,deleteConversation:Vb,deleteConversations:zb}=ys.actions,fs=t=>t.agentsReducer.instances,Db=l.createSelector([fs],t=>Object.values(t)),jb=y(l.createSelector([fs,(t,s)=>s],(t,s)=>t[s])),Lc=ys.reducer,W=P(t=>t.uuid),kc={instances:{}},Ss=l.createSlice({name:"assetAttachments",initialState:kc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,kc)),reducers:{initializeAssetAttachments:W.initialize,addAssetAttachment:W.addOne,addAssetAttachments:W.addMany,setAssetAttachment:W.setOne,setAssetAttachments:W.setMany,updateAssetAttachment:W.updateOne,updateAssetAttachments:W.updateMany,deleteAssetAttachment:W.deleteOne,deleteAssetAttachments:W.deleteMany}}),{initializeAssetAttachments:Nc,addAssetAttachment:Gc,addAssetAttachments:As,setAssetAttachment:Hc,setAssetAttachments:Wc,updateAssetAttachment:Kc,updateAssetAttachments:Yc,deleteAssetAttachment:Zc,deleteAssetAttachments:Is}=Ss.actions,Jc=t=>t.assetAttachmentReducer.instances,Ts=l.createSelector([Jc],t=>Object.values(t)),Xc=t=>s=>s.assetAttachmentReducer.instances[t],Qc=y(l.createSelector([Ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xc=y(l.createSelector([Ts,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>s===e)))),ea=Ss.reducer,K=P(t=>t.uuid),ta={instances:{}},Os=l.createSlice({name:"assetComments",initialState:ta,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ta)),reducers:{initializeAssetComments:K.initialize,addAssetComment:K.addOne,addAssetComments:K.addMany,setAssetComment:K.setOne,setAssetComments:K.setMany,updateAssetComment:K.updateOne,updateAssetComments:K.updateMany,deleteAssetComment:K.deleteOne,deleteAssetComments:K.deleteMany}}),{initializeAssetComments:sa,addAssetComment:ia,addAssetComments:$t,setAssetComment:na,setAssetComments:ca,updateAssetComment:aa,updateAssetComments:ra,deleteAssetComment:da,deleteAssetComments:Ut}=Os.actions,ua=t=>t.assetCommentReducer.instances,Lt=l.createSelector([ua],t=>S(Object.values(t).toSorted(At))),la=t=>s=>s.assetCommentReducer.instances[t],oa=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ha=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),ma=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.asset)))})),pa=Os.reducer,Y=P(t=>t.uuid),ya={instances:{}},Ps=l.createSlice({name:"assets",initialState:ya,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ya)),reducers:{initializeAssets:Y.initialize,addAsset:Y.addOne,addAssets:Y.addMany,setAsset:Y.setOne,setAssets:Y.setMany,updateAsset:Y.updateOne,updateAssets:Y.updateMany,deleteAsset:Y.deleteOne,deleteAssets:Y.deleteMany}}),{initializeAssets:fa,addAsset:Sa,addAssets:Fs,updateAsset:Aa,updateAssets:Ia,deleteAsset:Ta,deleteAssets:bs,setAsset:Oa,setAssets:Pa}=Ps.actions,Fa=t=>t.assetReducer.instances,kt=l.createSelector([Fa],t=>S(Object.values(t))),qb=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),ba=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),_a=t=>s=>s.assetReducer.instances[t],ga=y(l.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ma=Ps.reducer,Z=P(t=>t.uuid),Ra={instances:{}},_s=l.createSlice({name:"assetTypeAttachments",initialState:Ra,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ra)),reducers:{initializeAssetTypeAttachments:Z.initialize,addAssetTypeAttachment:Z.addOne,addAssetTypeAttachments:Z.addMany,setAssetTypeAttachment:Z.setOne,setAssetTypeAttachments:Z.setMany,updateAssetTypeAttachment:Z.updateOne,updateAssetTypeAttachments:Z.updateMany,deleteAssetTypeAttachment:Z.deleteOne,deleteAssetTypeAttachments:Z.deleteMany}}),{initializeAssetTypeAttachments:wa,addAssetTypeAttachment:va,addAssetTypeAttachments:gs,setAssetTypeAttachment:Ea,setAssetTypeAttachments:Ba,updateAssetTypeAttachment:Va,updateAssetTypeAttachments:za,deleteAssetTypeAttachment:Da,deleteAssetTypeAttachments:Ms}=_s.actions,ja=t=>t.assetTypeAttachmentReducer.instances,Rs=l.createSelector([ja],t=>Object.values(t)),qa=t=>s=>s.assetTypeAttachmentReducer.instances[t],Ca=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),$a=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>S(t.filter(({asset_type:e})=>s===e)))),Ua=_s.reducer,J=P(t=>t.uuid),La={instances:{}},ws=l.createSlice({name:"assetTypeFieldsAttachments",initialState:La,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,La)),reducers:{initializeAssetTypeFieldsAttachments:J.initialize,addAssetTypeFieldsAttachment:J.addOne,addAssetTypeFieldsAttachments:J.addMany,setAssetTypeFieldsAttachment:J.setOne,setAssetTypeFieldsAttachments:J.setMany,updateAssetTypeFieldsAttachment:J.updateOne,updateAssetTypeFieldsAttachments:J.updateMany,deleteAssetTypeFieldsAttachment:J.deleteOne,deleteAssetTypeFieldsAttachments:J.deleteMany}}),{initializeAssetTypeFieldsAttachments:ka,addAssetTypeFieldsAttachment:Na,addAssetTypeFieldsAttachments:Ga,setAssetTypeFieldsAttachment:Ha,setAssetTypeFieldsAttachments:Wa,updateAssetTypeFieldsAttachment:Ka,updateAssetTypeFieldsAttachments:Ya,deleteAssetTypeFieldsAttachment:Za,deleteAssetTypeFieldsAttachments:Ja}=ws.actions,Xa=t=>t.assetTypeFieldsAttachmentReducer.instances,vs=l.createSelector([Xa],t=>Object.values(t)),Cb=y(l.createSelector([vs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Qa=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],xa=y(l.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),er=ws.reducer,X=P(t=>t.uuid),tr={instances:{}},Es=l.createSlice({name:"assetTypeFields",initialState:tr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,tr)),reducers:{initializeAssetTypeFields:X.initialize,addAssetTypeFields:X.addOne,addAssetTypeFieldsMany:X.addMany,setAssetTypeFields:X.setOne,setAssetTypeFieldsMany:X.setMany,updateAssetTypeFields:X.updateOne,updateAssetTypeFieldsMany:X.updateMany,deleteAssetTypeFields:X.deleteOne,deleteAssetTypeFieldsMany:X.deleteMany}}),{initializeAssetTypeFields:sr,addAssetTypeFields:ir,addAssetTypeFieldsMany:nr,setAssetTypeFields:cr,setAssetTypeFieldsMany:ar,updateAssetTypeFields:rr,updateAssetTypeFieldsMany:dr,deleteAssetTypeFields:ur,deleteAssetTypeFieldsMany:lr}=Es.actions,or=t=>t.assetTypeFieldsReducer.instances,wt=l.createSelector([or],t=>Object.values(t)),$b=y(l.createSelector([wt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Ub=y(l.createSelector([wt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).toSorted(At).pop())),hr=t=>s=>s.assetTypeFieldsReducer.instances[t],mr=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),pr=Es.reducer,Q=P(t=>t.uuid),yr={instances:{}},Bs=l.createSlice({name:"assetTypeFieldValuesAttachments",initialState:yr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,yr)),reducers:{initializeAssetTypeFieldValuesAttachments:Q.initialize,addAssetTypeFieldValuesAttachment:Q.addOne,addAssetTypeFieldValuesAttachments:Q.addMany,setAssetTypeFieldValuesAttachment:Q.setOne,setAssetTypeFieldValuesAttachments:Q.setMany,updateAssetTypeFieldValuesAttachment:Q.updateOne,updateAssetTypeFieldValuesAttachments:Q.updateMany,deleteAssetTypeFieldValuesAttachment:Q.deleteOne,deleteAssetTypeFieldValuesAttachments:Q.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:fr,addAssetTypeFieldValuesAttachment:Sr,addAssetTypeFieldValuesAttachments:Vs,setAssetTypeFieldValuesAttachment:Ar,setAssetTypeFieldValuesAttachments:Ir,updateAssetTypeFieldValuesAttachment:Tr,updateAssetTypeFieldValuesAttachments:Or,deleteAssetTypeFieldValuesAttachment:Pr,deleteAssetTypeFieldValuesAttachments:zs}=Bs.actions,Fr=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Ds=l.createSelector([Fr],t=>Object.values(t)),br=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],_r=y(l.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),gr=y(l.createSelector([Ds,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),Mr=Bs.reducer,x=P(t=>t.uuid),Rr={instances:{}},js=l.createSlice({name:"assetTypeFieldValues",initialState:Rr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Rr)),reducers:{initializeAssetTypeFieldValues:x.initialize,addAssetTypeFieldValues:x.addOne,addAssetTypeFieldValuesMany:x.addMany,setAssetTypeFieldValues:x.setOne,setAssetTypeFieldValuesMany:x.setMany,updateAssetTypeFieldValues:x.updateOne,updateAssetTypeFieldValuesMany:x.updateMany,deleteAssetTypeFieldValues:x.deleteOne,deleteAssetTypeFieldValuesMany:x.deleteMany}}),{initializeAssetTypeFieldValues:wr,addAssetTypeFieldValues:vr,addAssetTypeFieldValuesMany:Er,setAssetTypeFieldValues:Br,setAssetTypeFieldValuesMany:Vr,updateAssetTypeFieldValues:zr,updateAssetTypeFieldValuesMany:Dr,deleteAssetTypeFieldValues:jr,deleteAssetTypeFieldValuesMany:qr}=js.actions,Cr=t=>t.assetTypeFieldValuesReducer.instances,Nt=l.createSelector([Cr],t=>Object.values(t)),Lb=y(l.createSelector([Nt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),kb=y(l.createSelector([wt,Nt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(c=>c.asset_type===e).map(c=>c.uuid));return S(s.filter(c=>n.has(c.fields_revision)))})),$r=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Ur=y(l.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Lr=js.reducer,ee=P(t=>t.uuid),kr={instances:{}},qs=l.createSlice({name:"assetTypeIdentifiers",initialState:kr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,kr)),reducers:{initializeAssetTypeIdentifiers:ee.initialize,addAssetTypeIdentifier:ee.addOne,addAssetTypeIdentifiers:ee.addMany,setAssetTypeIdentifier:ee.setOne,setAssetTypeIdentifiers:ee.setMany,updateAssetTypeIdentifier:ee.updateOne,updateAssetTypeIdentifiers:ee.updateMany,deleteAssetTypeIdentifier:ee.deleteOne,deleteAssetTypeIdentifiers:ee.deleteMany}}),{initializeAssetTypeIdentifiers:Nr,addAssetTypeIdentifier:Gr,addAssetTypeIdentifiers:Hr,setAssetTypeIdentifier:Wr,setAssetTypeIdentifiers:Kr,updateAssetTypeIdentifier:Yr,updateAssetTypeIdentifiers:Zr,deleteAssetTypeIdentifier:Jr,deleteAssetTypeIdentifiers:Xr}=qs.actions,Qr=t=>t.assetTypeIdentifierReducer.instances,Cs=l.createSelector([Qr],t=>Object.values(t)),xr=t=>s=>s.assetTypeIdentifierReducer.instances[t],ed=y(l.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nb=y(l.createSelector([Cs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),td=qs.reducer,te=P(t=>t.uuid),sd={instances:{}},$s=l.createSlice({name:"assetTypeIdentifierValues",initialState:sd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,sd)),reducers:{initializeAssetTypeIdentifierValues:te.initialize,addAssetTypeIdentifierValue:te.addOne,addAssetTypeIdentifierValues:te.addMany,setAssetTypeIdentifierValue:te.setOne,setAssetTypeIdentifierValues:te.setMany,updateAssetTypeIdentifierValue:te.updateOne,updateAssetTypeIdentifierValues:te.updateMany,deleteAssetTypeIdentifierValue:te.deleteOne,deleteAssetTypeIdentifierValues:te.deleteMany}}),{initializeAssetTypeIdentifierValues:id,addAssetTypeIdentifierValue:nd,addAssetTypeIdentifierValues:cd,setAssetTypeIdentifierValue:ad,setAssetTypeIdentifierValues:rd,updateAssetTypeIdentifierValue:dd,updateAssetTypeIdentifierValues:ud,deleteAssetTypeIdentifierValue:ld,deleteAssetTypeIdentifierValues:od}=$s.actions,hd=t=>t.assetTypeIdentifierValueReducer.instances,Gt=l.createSelector([hd],t=>Object.values(t)),md=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],pd=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Gb=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Hb=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type_identifier===s)))),yd=$s.reducer,se=P(t=>t.uuid),fd={instances:{}},Us=l.createSlice({name:"assetTypes",initialState:fd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,fd)),reducers:{initializeAssetTypes:se.initialize,setAssetType:se.setOne,setAssetTypes:se.setMany,addAssetType:se.addOne,addAssetTypes:se.addMany,updateAssetType:se.updateOne,updateAssetTypes:se.updateMany,deleteAssetType:se.deleteOne,deleteAssetTypes:se.deleteMany}}),{initializeAssetTypes:Sd,setAssetType:Ad,setAssetTypes:Id,addAssetType:Td,addAssetTypes:Od,updateAssetType:Pd,updateAssetTypes:Fd,deleteAssetType:bd,deleteAssetTypes:_d}=Us.actions,gd=t=>t.assetTypeReducer.instances,Ls=l.createSelector([gd],t=>Object.values(t)),Md=t=>s=>s.assetTypeReducer.instances[t],Rd=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Wb=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),wd=Us.reducer,ie=P(t=>t.uuid),vd={instances:{}},ks=l.createSlice({name:"assetTypeStatuses",initialState:vd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,vd)),reducers:{initializeAssetTypeStatuses:ie.initialize,addAssetTypeStatus:ie.addOne,addAssetTypeStatuses:ie.addMany,setAssetTypeStatus:ie.setOne,setAssetTypeStatuses:ie.setMany,updateAssetTypeStatus:ie.updateOne,updateAssetTypeStatuses:ie.updateMany,deleteAssetTypeStatus:ie.deleteOne,deleteAssetTypeStatuses:ie.deleteMany}}),{initializeAssetTypeStatuses:Ed,addAssetTypeStatus:Bd,addAssetTypeStatuses:Vd,setAssetTypeStatus:zd,setAssetTypeStatuses:Dd,updateAssetTypeStatus:jd,updateAssetTypeStatuses:qd,deleteAssetTypeStatus:Cd,deleteAssetTypeStatuses:$d}=ks.actions,Ud=t=>t.assetTypeStatusReducer.instances,Ns=l.createSelector([Ud],t=>S(Object.values(t).toSorted(Ec))),Ld=t=>s=>s.assetTypeStatusReducer.instances[t],kd=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Kb=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Nd=ks.reducer,Gd={accessToken:"",refreshToken:"",isLoggedIn:!1},Ht=l.createSlice({name:"auth",initialState:Gd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Gd)),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||Ht.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:Yb,clearTokens:Zb,setLoggedIn:Hd}=Ht.actions,Jb=t=>t.authReducer.accessToken,Xb=t=>t.authReducer.isLoggedIn,Wd=Ht.reducer,ne=P(t=>t.uuid),Kd={instances:{}},Gs=l.createSlice({name:"documentAttachments",initialState:Kd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Kd)),reducers:{initializeDocumentAttachments:ne.initialize,addDocumentAttachment:ne.addOne,addDocumentAttachments:ne.addMany,setDocumentAttachment:ne.setOne,setDocumentAttachments:ne.setMany,updateDocumentAttachment:ne.updateOne,updateDocumentAttachments:ne.updateMany,deleteDocumentAttachment:ne.deleteOne,deleteDocumentAttachments:ne.deleteMany}}),{initializeDocumentAttachments:Yd,addDocumentAttachment:Zd,addDocumentAttachments:Jd,setDocumentAttachment:Xd,setDocumentAttachments:Qd,updateDocumentAttachment:xd,updateDocumentAttachments:eu,deleteDocumentAttachment:tu,deleteDocumentAttachments:su}=Gs.actions,iu=t=>t.documentAttachmentReducer.instances,Hs=l.createSelector([iu],t=>Object.values(t)),nu=t=>s=>s.documentAttachmentReducer.instances[t],cu=y(l.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qb=y(l.createSelector([Hs,(t,s)=>s],(t,s)=>S(t.filter(({document:e})=>s===e)))),au=Gs.reducer,ce=P(({uuid:t})=>t),ru={instances:{}},Ws=l.createSlice({name:"documents",initialState:ru,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>{Object.assign(s,ru)}),reducers:{initializeDocuments:ce.initialize,addDocument:ce.addOne,addDocuments:ce.addMany,setDocument:ce.setOne,setDocuments:ce.setMany,updateDocument:ce.updateOne,updateDocuments:ce.updateMany,deleteDocument:ce.deleteOne,deleteDocuments:ce.deleteMany}}),{initializeDocuments:du,addDocument:uu,addDocuments:lu,setDocument:ou,setDocuments:hu,updateDocument:mu,updateDocuments:pu,deleteDocument:yu,deleteDocuments:fu}=Ws.actions,Su=Ws.reducer,Ks=t=>t.documentsReducer.instances,Wt=l.createSelector([Ks],t=>Object.values(t)),Au=t=>s=>s.documentsReducer.instances[t],Iu=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xb=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),e_=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Tu=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const c=Dc(s,Object.values(t)).all().map(({model:r})=>r);return S(c)})),ae=P(t=>t.uuid),Ou={instances:{}},Ys=l.createSlice({name:"emailDomains",initialState:Ou,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ou)),reducers:{initializeEmailDomains:ae.initialize,addEmailDomain:ae.addOne,addEmailDomains:ae.addMany,setEmailDomain:ae.setOne,setEmailDomains:ae.setMany,updateEmailDomain:ae.updateOne,updateEmailDomains:ae.updateMany,deleteEmailDomain:ae.deleteOne,deleteEmailDomains:ae.deleteMany}}),{initializeEmailDomains:Pu,addEmailDomain:Fu,addEmailDomains:bu,setEmailDomain:_u,setEmailDomains:gu,updateEmailDomain:Mu,updateEmailDomains:Ru,deleteEmailDomain:wu,deleteEmailDomains:vu}=Ys.actions,Eu=t=>t.emailDomainsReducer.instances,Zs=l.createSelector([Eu],t=>Object.values(t)),Bu=t=>s=>s.emailDomainsReducer.instances[t],Vu=y(l.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),t_=y(l.createSelector([Zs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),zu=Ys.reducer,Du={s3Urls:{}},ju=1e3*60*60,s_=ju*24*7,Js=l.createSlice({name:"file",initialState:Du,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Du)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:c}=s.payload,r=new Date,a=new Date(r.getTime()+s_);t.s3Urls[c]={url:e,fields:n,exp:a.getTime()}}}}),{setUploadUrl:i_}=Js.actions,n_=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<ju))return e},qu=Js.reducer,re=P(t=>t.uuid),Cu={instances:{}},Xs=l.createSlice({name:"formIdentifiers",initialState:Cu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Cu)),reducers:{initializeFormIdentifiers:re.initialize,addFormIdentifier:re.addOne,addFormIdentifiers:re.addMany,setFormIdentifier:re.setOne,setFormIdentifiers:re.setMany,updateFormIdentifier:re.updateOne,updateFormIdentifiers:re.updateMany,deleteFormIdentifier:re.deleteOne,deleteFormIdentifiers:re.deleteMany}}),{initializeFormIdentifiers:$u,addFormIdentifier:Uu,addFormIdentifiers:Lu,setFormIdentifier:ku,setFormIdentifiers:Nu,updateFormIdentifier:Gu,updateFormIdentifiers:Hu,deleteFormIdentifier:Wu,deleteFormIdentifiers:Ku}=Xs.actions,Yu=t=>t.formIdentifierReducer.instances,Qs=l.createSelector([Yu],t=>Object.values(t)),Zu=t=>s=>s.formIdentifierReducer.instances[t],Ju=y(l.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),c_=y(l.createSelector([Qs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Xu=Xs.reducer,de=P(t=>t.uuid),Qu={instances:{}},xs=l.createSlice({name:"formIdentifierValues",initialState:Qu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Qu)),reducers:{initializeFormIdentifierValues:de.initialize,addFormIdentifierValue:de.addOne,addFormIdentifierValues:de.addMany,setFormIdentifierValue:de.setOne,setFormIdentifierValues:de.setMany,updateFormIdentifierValue:de.updateOne,updateFormIdentifierValues:de.updateMany,deleteFormIdentifierValue:de.deleteOne,deleteFormIdentifierValues:de.deleteMany}}),{initializeFormIdentifierValues:xu,addFormIdentifierValue:el,addFormIdentifierValues:tl,setFormIdentifierValue:sl,setFormIdentifierValues:il,updateFormIdentifierValue:nl,updateFormIdentifierValues:cl,deleteFormIdentifierValue:al,deleteFormIdentifierValues:rl}=xs.actions,dl=t=>t.formIdentifierValueReducer.instances,Kt=l.createSelector([dl],t=>Object.values(t)),ul=t=>s=>s.formIdentifierValueReducer.instances[t],ll=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),a_=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),r_=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_identifier===s)))),ol=xs.reducer,ue=P(t=>t.uuid),hl={instances:{}},ei=l.createSlice({name:"formRevisionAttachments",initialState:hl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,hl)),reducers:{initializeFormRevisionAttachments:ue.initialize,addFormRevisionAttachment:ue.addOne,addFormRevisionAttachments:ue.addMany,setFormRevisionAttachment:ue.setOne,setFormRevisionAttachments:ue.setMany,updateFormRevisionAttachment:ue.updateOne,updateFormRevisionAttachments:ue.updateMany,deleteFormRevisionAttachment:ue.deleteOne,deleteFormRevisionAttachments:ue.deleteMany}}),{initializeFormRevisionAttachments:ml,addFormRevisionAttachment:pl,addFormRevisionAttachments:yl,setFormRevisionAttachment:fl,setFormRevisionAttachments:Sl,updateFormRevisionAttachment:Al,updateFormRevisionAttachments:Il,deleteFormRevisionAttachment:Tl,deleteFormRevisionAttachments:Ol}=ei.actions,Yt=t=>t.formRevisionAttachmentReducer.instances,Pl=l.createSelector([Yt],t=>Object.values(t)),Fl=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>t[s])),bl=y(l.createSelector([Pl,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),d_=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.form_revision===s)))),_l=ei.reducer,le=P(t=>t.uuid),gl={instances:{}},ti=l.createSlice({name:"formRevisions",initialState:gl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,gl)),reducers:{initializeFormRevisions:le.initialize,addFormRevision:le.addOne,addFormRevisions:le.addMany,setFormRevision:le.setOne,setFormRevisions:le.setMany,updateFormRevision:le.updateOne,updateFormRevisions:le.updateMany,deleteFormRevision:le.deleteOne,deleteFormRevisions:le.deleteMany}}),{initializeFormRevisions:Ml,addFormRevision:Rl,addFormRevisions:si,setFormRevision:wl,setFormRevisions:vl,updateFormRevision:El,updateFormRevisions:Bl,deleteFormRevision:Vl,deleteFormRevisions:ii}=ti.actions,zl=t=>t.formRevisionReducer.instances,Zt=l.createSelector([zl],t=>Object.values(t)),Dl=t=>s=>s.formRevisionReducer.instances[t],jl=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),u_=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).toSorted(At).pop())),ql=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Cl=ti.reducer,oe=P(t=>t.uuid),$l={instances:{}},ni=l.createSlice({name:"forms",initialState:$l,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,$l)),reducers:{initializeForms:oe.initialize,addForm:oe.addOne,addForms:oe.addMany,setForm:oe.setOne,setForms:oe.setMany,updateForm:oe.updateOne,updateForms:oe.updateMany,deleteForm:oe.deleteOne,deleteForms:oe.deleteMany}}),{initializeForms:Ul,addForm:Ll,addForms:kl,setForm:Nl,setForms:Gl,updateForm:Hl,updateForms:Wl,deleteForm:Kl,deleteForms:Yl}=ni.actions,Zl=ni.reducer,Jl=t=>t.formReducer.instances,ci=l.createSelector([Jl],t=>Object.values(t)),Xl=t=>s=>s.formReducer.instances[t],Ql=y(l.createSelector([ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),l_=y(l.createSelector([ci,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),he=P(t=>t.uuid),xl={instances:{}},ai=l.createSlice({name:"formSubmissionAttachments",initialState:xl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,xl)),reducers:{initializeFormSubmissionAttachments:he.initialize,addFormSubmissionAttachment:he.addOne,addFormSubmissionAttachments:he.addMany,setFormSubmissionAttachment:he.setOne,setFormSubmissionAttachments:he.setMany,updateFormSubmissionAttachment:he.updateOne,updateFormSubmissionAttachments:he.updateMany,deleteFormSubmissionAttachment:he.deleteOne,deleteFormSubmissionAttachments:he.deleteMany}}),{initializeFormSubmissionAttachments:eo,addFormSubmissionAttachment:to,addFormSubmissionAttachments:ri,setFormSubmissionAttachment:so,setFormSubmissionAttachments:io,updateFormSubmissionAttachment:no,updateFormSubmissionAttachments:co,deleteFormSubmissionAttachment:ao,deleteFormSubmissionAttachments:di}=ai.actions,ui=t=>t.formSubmissionAttachmentReducer.instances,li=l.createSelector([ui],t=>Object.values(t)),ro=y(l.createSelector([ui,(t,s)=>s],(t,s)=>t[s])),oi=y(l.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.uuid)))})),uo=oi,lo=y(l.createSelector([li,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),oo=ai.reducer,me=P(t=>t.uuid),ho={instances:{}},hi=l.createSlice({name:"formSubmissions",initialState:ho,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ho)),reducers:{initializeFormSubmissions:me.initialize,setFormSubmission:me.setOne,setFormSubmissions:me.setMany,addFormSubmission:me.addOne,addFormSubmissions:me.addMany,updateFormSubmission:me.updateOne,updateFormSubmissions:me.updateMany,deleteFormSubmission:me.deleteOne,deleteFormSubmissions:me.deleteMany}}),{initializeFormSubmissions:mo,setFormSubmission:po,setFormSubmissions:yo,addFormSubmission:fo,addFormSubmissions:ut,updateFormSubmission:So,updateFormSubmissions:Ao,deleteFormSubmission:Io,deleteFormSubmissions:lt}=hi.actions,To=t=>t.formSubmissionReducer.instances,k=l.createSelector([To],t=>Object.values(t)),Oo=t=>s=>s.formSubmissionReducer.instances[t],Po=y(l.createSelector([k,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Fo=y(l.createSelector([k,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),o_=y(l.createSelector([k,(t,s)=>s],(t,s)=>S(t.filter(({organization:e})=>e===s)))),h_=y(l.createSelector([k,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),m_=y(l.createSelector([k,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({project:n,form:c})=>n===s&&c===e)))),p_=y(l.createSelector([k,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({organization:n,form:c})=>n===s&&c===e)))),bo=y(l.createSelector([k,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),_o=y(l.createSelector([k,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>n&&e.has(n)))})),go=y(l.createSelector([k,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),Mo=y(l.createSelector([k,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>n&&e.has(n)))})),Ro=hi.reducer,pe=P(t=>t.uuid),wo={instances:{}},mi=l.createSlice({name:"geoImages",initialState:wo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,wo)),reducers:{initializeGeoImages:pe.initialize,setGeoImage:pe.setOne,setGeoImages:pe.setMany,addGeoImage:pe.addOne,addGeoImages:pe.addMany,updateGeoImage:pe.updateOne,updateGeoImages:pe.updateMany,deleteGeoImage:pe.deleteOne,deleteGeoImages:pe.deleteMany}}),{initializeGeoImages:vo,setGeoImage:Eo,setGeoImages:Bo,addGeoImage:Vo,addGeoImages:zo,updateGeoImage:Do,updateGeoImages:jo,deleteGeoImage:qo,deleteGeoImages:Co}=mi.actions,$o=t=>t.geoImageReducer.instances,pi=l.createSelector([$o],t=>Object.values(t)),Uo=t=>s=>s.geoImageReducer.instances[t],Lo=y(l.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),y_=y(l.createSelector([pi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),ko=mi.reducer,ye=P(t=>t.uuid),No={instances:{}},yi=l.createSlice({name:"issueAssociations",initialState:No,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,No)),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:Go,setIssueAssociations:Ho,setIssueAssociation:Wo,updateIssueAssociation:Ko,updateIssueAssociations:Yo,addIssueAssociation:Zo,addIssueAssociations:It,deleteIssueAssociation:Jo,deleteIssueAssociations:Tt}=yi.actions,Xo=t=>t.issueAssociationReducer.instances,Ot=l.createSelector([Xo],t=>Object.values(t)),Qo=t=>s=>s.issueAssociationReducer.instances[t],xo=y(l.createSelector([Ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),eh=y(l.createSelector([Ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>e.has(n)))})),th=y(l.createSelector([Ot,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),sh=y(l.createSelector([Ot,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),ih=y(l.createSelector([Ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),nh=yi.reducer,fe=P(t=>t.uuid),ch={instances:{}},fi=l.createSlice({name:"issueAttachments",initialState:ch,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ch)),reducers:{initializeIssueAttachments:fe.initialize,addIssueAttachment:fe.addOne,addIssueAttachments:fe.addMany,setIssueAttachment:fe.setOne,setIssueAttachments:fe.setMany,updateIssueAttachment:fe.updateOne,updateIssueAttachments:fe.updateMany,deleteIssueAttachment:fe.deleteOne,deleteIssueAttachments:fe.deleteMany}}),{initializeIssueAttachments:ah,addIssueAttachment:rh,addIssueAttachments:Si,setIssueAttachment:dh,setIssueAttachments:uh,updateIssueAttachment:lh,updateIssueAttachments:oh,deleteIssueAttachment:hh,deleteIssueAttachments:Ai}=fi.actions,mh=t=>t.issueAttachmentReducer.instances,Ii=l.createSelector([mh],t=>Object.values(t)),ph=y(l.createSelector([Ii,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>s===e)))),yh=t=>s=>s.issueAttachmentReducer.instances[t],fh=y(l.createSelector([Ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Sh=fi.reducer,Se=P(t=>t.uuid),Ah={instances:{}},Ti=l.createSlice({name:"issueCommentAttachments",initialState:Ah,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ah)),reducers:{initializeIssueCommentAttachments:Se.initialize,addIssueCommentAttachment:Se.addOne,addIssueCommentAttachments:Se.addMany,setIssueCommentAttachment:Se.setOne,setIssueCommentAttachments:Se.setMany,updateIssueCommentAttachment:Se.updateOne,updateIssueCommentAttachments:Se.updateMany,deleteIssueCommentAttachment:Se.deleteOne,deleteIssueCommentAttachments:Se.deleteMany}}),{initializeIssueCommentAttachments:Ih,addIssueCommentAttachment:Th,addIssueCommentAttachments:Oh,setIssueCommentAttachment:Ph,setIssueCommentAttachments:Fh,updateIssueCommentAttachment:bh,updateIssueCommentAttachments:_h,deleteIssueCommentAttachment:gh,deleteIssueCommentAttachments:Mh}=Ti.actions,Rh=t=>t.issueCommentAttachmentReducer.instances,Oi=l.createSelector([Rh],t=>Object.values(t)),wh=t=>s=>s.issueCommentAttachmentReducer.instances[t],vh=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),f_=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>S(t.filter(({issue_comment:e})=>s===e)))),Eh=Ti.reducer,Ae=P(t=>t.uuid),Bh={instances:{}},Pi=l.createSlice({name:"issueComments",initialState:Bh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Bh)),reducers:{initializeIssueComments:Ae.initialize,addIssueComment:Ae.addOne,addIssueComments:Ae.addMany,setIssueComment:Ae.setOne,setIssueComments:Ae.setMany,updateIssueComment:Ae.updateOne,updateIssueComments:Ae.updateMany,deleteIssueComment:Ae.deleteOne,deleteIssueComments:Ae.deleteMany}}),{initializeIssueComments:Vh,addIssueComment:zh,addIssueComments:Dh,setIssueComment:jh,setIssueComments:qh,updateIssueComment:Ch,updateIssueComments:$h,deleteIssueComment:Uh,deleteIssueComments:Lh}=Pi.actions,Fi=t=>t.issueCommentReducer.instances,kh=t=>s=>s.issueCommentReducer.instances[t],Nh=y(l.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),S_=y(l.createSelector([Fi,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.issue===s)))),Gh=Pi.reducer,Ie=P(t=>t.uuid),Hh={instances:{}},bi=l.createSlice({name:"issues",initialState:Hh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Hh)),reducers:{initializeIssues:Ie.initialize,addIssue:Ie.addOne,addIssues:Ie.addMany,setIssue:Ie.setOne,setIssues:Ie.setMany,updateIssue:Ie.updateOne,updateIssues:Ie.updateMany,deleteIssue:Ie.deleteOne,deleteIssues:Ie.deleteMany}}),{initializeIssues:Wh,addIssue:Kh,addIssues:_i,setIssue:Yh,setIssues:Zh,updateIssue:Jh,updateIssues:Xh,deleteIssue:Qh,deleteIssues:gi}=bi.actions,xh=t=>t.issueReducer.instances,Jt=l.createSelector([xh],t=>Object.values(t)),em=t=>s=>s.issueReducer.instances[t],tm=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),A_=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),sm=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),im=bi.reducer,Te=P(t=>t.uuid),nm={instances:{}},Mi=l.createSlice({name:"issueTypeAttachments",initialState:nm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,nm)),reducers:{initializeIssueTypeAttachments:Te.initialize,addIssueTypeAttachment:Te.addOne,addIssueTypeAttachments:Te.addMany,setIssueTypeAttachment:Te.setOne,setIssueTypeAttachments:Te.setMany,updateIssueTypeAttachment:Te.updateOne,updateIssueTypeAttachments:Te.updateMany,deleteIssueTypeAttachment:Te.deleteOne,deleteIssueTypeAttachments:Te.deleteMany}}),{initializeIssueTypeAttachments:cm,addIssueTypeAttachment:am,addIssueTypeAttachments:rm,setIssueTypeAttachment:dm,setIssueTypeAttachments:um,updateIssueTypeAttachment:lm,updateIssueTypeAttachments:om,deleteIssueTypeAttachment:hm,deleteIssueTypeAttachments:mm}=Mi.actions,pm=t=>t.issueTypeAttachmentReducer.instances,Ri=l.createSelector([pm],t=>Object.values(t)),ym=t=>s=>s.issueTypeAttachmentReducer.instances[t],fm=y(l.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),I_=y(l.createSelector([Ri,(t,s)=>s],(t,s)=>S(t.filter(({issue_type:e})=>s===e)))),Sm=Mi.reducer,Oe=P(t=>t.uuid),Am={instances:{}},wi=l.createSlice({name:"issueTypeFieldsAttachments",initialState:Am,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Am)),reducers:{initializeIssueTypeFieldsAttachments:Oe.initialize,addIssueTypeFieldsAttachment:Oe.addOne,addIssueTypeFieldsAttachments:Oe.addMany,setIssueTypeFieldsAttachment:Oe.setOne,setIssueTypeFieldsAttachments:Oe.setMany,updateIssueTypeFieldsAttachment:Oe.updateOne,updateIssueTypeFieldsAttachments:Oe.updateMany,deleteIssueTypeFieldsAttachment:Oe.deleteOne,deleteIssueTypeFieldsAttachments:Oe.deleteMany}}),{initializeIssueTypeFieldsAttachments:Im,addIssueTypeFieldsAttachment:Tm,addIssueTypeFieldsAttachments:Om,setIssueTypeFieldsAttachment:Pm,setIssueTypeFieldsAttachments:Fm,updateIssueTypeFieldsAttachment:bm,updateIssueTypeFieldsAttachments:_m,deleteIssueTypeFieldsAttachment:gm,deleteIssueTypeFieldsAttachments:Mm}=wi.actions,Rm=t=>t.issueTypeFieldsAttachmentReducer.instances,vi=l.createSelector([Rm],t=>Object.values(t)),T_=y(l.createSelector([vi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),wm=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],vm=y(l.createSelector([vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Em=wi.reducer,Pe=P(t=>t.uuid),Bm={instances:{}},Ei=l.createSlice({name:"issueTypeFieldValues",initialState:Bm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Bm)),reducers:{initializeIssueTypeFieldValues:Pe.initialize,addIssueTypeFieldValues:Pe.addOne,addIssueTypeFieldValuesMany:Pe.addMany,setIssueTypeFieldValues:Pe.setOne,setIssueTypeFieldValuesMany:Pe.setMany,updateIssueTypeFieldValues:Pe.updateOne,updateIssueTypeFieldValuesMany:Pe.updateMany,deleteIssueTypeFieldValues:Pe.deleteOne,deleteIssueTypeFieldValuesMany:Pe.deleteMany}}),{initializeIssueTypeFieldValues:Vm,addIssueTypeFieldValues:zm,addIssueTypeFieldValuesMany:Dm,setIssueTypeFieldValues:jm,setIssueTypeFieldValuesMany:qm,updateIssueTypeFieldValues:Cm,updateIssueTypeFieldValuesMany:$m,deleteIssueTypeFieldValues:Um,deleteIssueTypeFieldValuesMany:Lm}=Ei.actions,km=t=>t.issueTypeFieldValuesReducer.instances,Xt=l.createSelector([km],t=>Object.values(t)),O_=y(l.createSelector([Xt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Nm=t=>s=>s.issueTypeFieldValuesReducer.instances[t],Gm=y(l.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Hm=Ei.reducer,Fe=P(t=>t.uuid),Wm={instances:{}},Bi=l.createSlice({name:"issueTypeFields",initialState:Wm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Wm)),reducers:{initializeIssueTypeFields:Fe.initialize,addIssueTypeFields:Fe.addOne,addIssueTypeFieldsMany:Fe.addMany,setIssueTypeFields:Fe.setOne,setIssueTypeFieldsMany:Fe.setMany,updateIssueTypeFields:Fe.updateOne,updateIssueTypeFieldsMany:Fe.updateMany,deleteIssueTypeFields:Fe.deleteOne,deleteIssueTypeFieldsMany:Fe.deleteMany}}),{initializeIssueTypeFields:Km,addIssueTypeFields:Ym,addIssueTypeFieldsMany:Zm,setIssueTypeFields:Jm,setIssueTypeFieldsMany:Xm,updateIssueTypeFields:Qm,updateIssueTypeFieldsMany:xm,deleteIssueTypeFields:ep,deleteIssueTypeFieldsMany:tp}=Bi.actions,sp=t=>t.issueTypeFieldsReducer.instances,vt=l.createSelector([sp],t=>Object.values(t)),P_=y(l.createSelector([vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),F_=y(l.createSelector([vt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),b_=y(l.createSelector([vt,Xt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(c=>c.issue_type===e).map(c=>c.uuid));return S(s.filter(c=>n.has(c.fields_revision)))})),ip=t=>s=>s.issueTypeFieldsReducer.instances[t],np=y(l.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),cp=Bi.reducer,be=P(t=>t.uuid),ap={instances:{}},Vi=l.createSlice({name:"issueTypeFieldValuesAttachments",initialState:ap,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ap)),reducers:{initializeIssueTypeFieldValuesAttachments:be.initialize,addIssueTypeFieldValuesAttachment:be.addOne,addIssueTypeFieldValuesAttachments:be.addMany,setIssueTypeFieldValuesAttachment:be.setOne,setIssueTypeFieldValuesAttachments:be.setMany,updateIssueTypeFieldValuesAttachment:be.updateOne,updateIssueTypeFieldValuesAttachments:be.updateMany,deleteIssueTypeFieldValuesAttachment:be.deleteOne,deleteIssueTypeFieldValuesAttachments:be.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:rp,addIssueTypeFieldValuesAttachment:dp,addIssueTypeFieldValuesAttachments:zi,setIssueTypeFieldValuesAttachment:up,setIssueTypeFieldValuesAttachments:lp,updateIssueTypeFieldValuesAttachment:op,updateIssueTypeFieldValuesAttachments:hp,deleteIssueTypeFieldValuesAttachment:mp,deleteIssueTypeFieldValuesAttachments:Di}=Vi.actions,pp=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ji=l.createSelector([pp],t=>Object.values(t)),yp=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],fp=y(l.createSelector([ji,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Sp=y(l.createSelector([ji,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),Ap=Vi.reducer,_e=P(t=>t.uuid),Ip={instances:{}},qi=l.createSlice({name:"issueTypeIdentifiers",initialState:Ip,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ip)),reducers:{initializeIssueTypeIdentifiers:_e.initialize,addIssueTypeIdentifier:_e.addOne,addIssueTypeIdentifiers:_e.addMany,setIssueTypeIdentifier:_e.setOne,setIssueTypeIdentifiers:_e.setMany,updateIssueTypeIdentifier:_e.updateOne,updateIssueTypeIdentifiers:_e.updateMany,deleteIssueTypeIdentifier:_e.deleteOne,deleteIssueTypeIdentifiers:_e.deleteMany}}),{initializeIssueTypeIdentifiers:Tp,addIssueTypeIdentifier:Op,addIssueTypeIdentifiers:Pp,setIssueTypeIdentifier:Fp,setIssueTypeIdentifiers:bp,updateIssueTypeIdentifier:_p,updateIssueTypeIdentifiers:gp,deleteIssueTypeIdentifier:Mp,deleteIssueTypeIdentifiers:Rp}=qi.actions,wp=t=>t.issueTypeIdentifierReducer.instances,Ci=l.createSelector([wp],t=>Object.values(t)),vp=t=>s=>s.issueTypeIdentifierReducer.instances[t],Ep=y(l.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),__=y(l.createSelector([Ci,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),Bp=qi.reducer,ge=P(t=>t.uuid),Vp={instances:{}},$i=l.createSlice({name:"issueTypeIdentifierValues",initialState:Vp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Vp)),reducers:{initializeIssueTypeIdentifierValues:ge.initialize,addIssueTypeIdentifierValue:ge.addOne,addIssueTypeIdentifierValues:ge.addMany,setIssueTypeIdentifierValue:ge.setOne,setIssueTypeIdentifierValues:ge.setMany,updateIssueTypeIdentifierValue:ge.updateOne,updateIssueTypeIdentifierValues:ge.updateMany,deleteIssueTypeIdentifierValue:ge.deleteOne,deleteIssueTypeIdentifierValues:ge.deleteMany}}),{initializeIssueTypeIdentifierValues:zp,addIssueTypeIdentifierValue:Dp,addIssueTypeIdentifierValues:jp,setIssueTypeIdentifierValue:qp,setIssueTypeIdentifierValues:Cp,updateIssueTypeIdentifierValue:$p,updateIssueTypeIdentifierValues:Up,deleteIssueTypeIdentifierValue:Lp,deleteIssueTypeIdentifierValues:kp}=$i.actions,Np=t=>t.issueTypeIdentifierValueReducer.instances,Qt=l.createSelector([Np],t=>Object.values(t)),Gp=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Hp=y(l.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),g_=y(l.createSelector([Qt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),M_=y(l.createSelector([Qt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type_identifier===s)))),Wp=$i.reducer,Me=P(t=>t.uuid),Kp={instances:{}},Ui=l.createSlice({name:"issueTypePriorities",initialState:Kp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Kp)),reducers:{initializeIssueTypePriorities:Me.initialize,addIssueTypePriority:Me.addOne,addIssueTypePriorities:Me.addMany,setIssueTypePriority:Me.setOne,setIssueTypePriorities:Me.setMany,updateIssueTypePriority:Me.updateOne,updateIssueTypePriorities:Me.updateMany,deleteIssueTypePriority:Me.deleteOne,deleteIssueTypePriorities:Me.deleteMany}}),{initializeIssueTypePriorities:Yp,addIssueTypePriority:Zp,addIssueTypePriorities:Jp,setIssueTypePriority:Xp,setIssueTypePriorities:Qp,updateIssueTypePriority:xp,updateIssueTypePriorities:ey,deleteIssueTypePriority:ty,deleteIssueTypePriorities:sy}=Ui.actions,iy=t=>t.issueTypePriorityReducer.instances,Li=l.createSelector([iy],t=>S(Object.values(t).toSorted(Vc))),ki=t=>s=>s.issueTypePriorityReducer.instances[t],ny=y(l.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),R_=y(l.createSelector([Li,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),cy=Ui.reducer,Re=P(t=>t.uuid),ay={instances:{}},Ni=l.createSlice({name:"issueTypes",initialState:ay,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ay)),reducers:{initializeIssueTypes:Re.initialize,addIssueType:Re.addOne,addIssueTypes:Re.addMany,setIssueType:Re.setOne,setIssueTypes:Re.setMany,updateIssueType:Re.updateOne,updateIssueTypes:Re.updateMany,deleteIssueType:Re.deleteOne,deleteIssueTypes:Re.deleteMany}}),{initializeIssueTypes:ry,addIssueType:dy,addIssueTypes:uy,setIssueType:ly,setIssueTypes:oy,updateIssueType:hy,updateIssueTypes:my,deleteIssueType:py,deleteIssueTypes:yy}=Ni.actions,fy=t=>t.issueTypeReducer.instances,Gi=l.createSelector(fy,t=>Object.values(t)),Sy=t=>s=>s.issueTypeReducer.instances[t],Ay=y(l.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),w_=y(l.createSelector([Gi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Iy=Ni.reducer,we=P(t=>t.uuid),Ty={instances:{}},Hi=l.createSlice({name:"issueTypeStatuses",initialState:Ty,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ty)),reducers:{initializeIssueTypeStatuses:we.initialize,addIssueTypeStatus:we.addOne,addIssueTypeStatuses:we.addMany,setIssueTypeStatus:we.setOne,setIssueTypeStatuses:we.setMany,updateIssueTypeStatus:we.updateOne,updateIssueTypeStatuses:we.updateMany,deleteIssueTypeStatus:we.deleteOne,deleteIssueTypeStatuses:we.deleteMany}}),{initializeIssueTypeStatuses:Oy,addIssueTypeStatus:Py,addIssueTypeStatuses:Fy,setIssueTypeStatus:by,setIssueTypeStatuses:_y,updateIssueTypeStatus:gy,updateIssueTypeStatuses:My,deleteIssueTypeStatus:Ry,deleteIssueTypeStatuses:wy}=Hi.actions,vy=t=>t.issueTypeStatusReducer.instances,Wi=l.createSelector([vy],t=>S(Object.values(t).toSorted(Bc))),Ki=t=>s=>s.issueTypeStatusReducer.instances[t],Ey=y(l.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),v_=y(l.createSelector([Wi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),By=Hi.reducer,ve=P(t=>t.uuid),Vy={instances:{}},Yi=l.createSlice({name:"issueUpdates",initialState:Vy,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Vy)),reducers:{initializeIssueUpdates:ve.initialize,addIssueUpdate:ve.addOne,addIssueUpdates:ve.addMany,setIssueUpdate:ve.setOne,setIssueUpdates:ve.setMany,updateIssueUpdate:ve.updateOne,updateIssueUpdates:ve.updateMany,deleteIssueUpdate:ve.deleteOne,deleteIssueUpdates:ve.deleteMany}}),{initializeIssueUpdates:zy,addIssueUpdate:Zi,addIssueUpdates:Ji,setIssueUpdate:Dy,setIssueUpdates:jy,updateIssueUpdate:qy,updateIssueUpdates:Cy,deleteIssueUpdate:Xi,deleteIssueUpdates:Qi}=Yi.actions,xi=t=>t.issueUpdateReducer.instances,en=l.createSelector([xi],t=>Object.values(t)),$y=y(l.createSelector([xi,(t,s)=>s],(t,s)=>t[s])),Uy=y(l.createSelector([en,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ly=y(l.createSelector([en,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),ky=Yi.reducer,Ee=P(t=>t.id),Ny={instances:{},currentUser:null},tn=l.createSlice({name:"users",initialState:Ny,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ny)).addCase(F,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ee.initialize,setUsers:Ee.setMany,setUser:Ee.setOne,addUsers:Ee.addMany,addUser:Ee.addOne,updateUsers:Ee.updateMany,updateUser:Ee.updateOne,deleteUser:Ee.deleteOne,deleteUsers:Ee.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:Gy,setUsers:Hy,setUser:Wy,addUsers:Ky,addUser:sn,updateUsers:Yy,updateUser:Zy,deleteUser:nn,deleteUsers:Jy,setCurrentUser:E_,setCurrentUserProfile:B_}=tn.actions,Xy=tn.reducer,Qy=t=>t.userReducer.currentUser,cn=t=>t.userReducer.instances,xt=l.createSelector([cn],t=>Object.values(t)),es=t=>s=>s.userReducer.instances[t],xy=y(l.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({id:n})=>e.has(n)))})),Be=P(t=>t.uuid),ef={instances:{}},an=l.createSlice({name:"organizationAccess",initialState:ef,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ef)),reducers:{initializeOrganizationAccesses:Be.initialize,addOrganizationAccess:Be.addOne,addOrganizationAccesses:Be.addMany,setOrganizationAccess:Be.setOne,setOrganizationAccesses:Be.setMany,updateOrganizationAccess:Be.updateOne,updateOrganizationAccesses:Be.updateMany,deleteOrganizationAccess:Be.deleteOne,deleteOrganizationAccesses:Be.deleteMany}}),{initializeOrganizationAccesses:tf,addOrganizationAccess:sf,addOrganizationAccesses:nf,setOrganizationAccess:cf,setOrganizationAccesses:af,updateOrganizationAccess:rf,updateOrganizationAccesses:df,deleteOrganizationAccess:uf,deleteOrganizationAccesses:lf}=an.actions,of=an.reducer,ts=t=>t.organizationAccessReducer.instances,hf=t=>s=>s.organizationAccessReducer.instances[t],mf=y(l.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),V_=l.createSelector([Qy,ts],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),pf=l.createSelector([ts],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return hs(s)}),z_=y(l.createSelector([cn,pf,(t,s)=>s],(t,s,e)=>S(Object.values(t).filter(n=>{const c=s[n.id];return!!c&&c.organization===e})))),Ve=P(t=>t.uuid),yf={instances:{}},rn=l.createSlice({name:"organizations",initialState:yf,extraReducers:t=>t.addMatcher(l.isAnyOf(T),s=>Object.assign(s,yf)),reducers:{initializeOrganizations:Ve.initialize,setOrganizations:Ve.setMany,setOrganization:Ve.setOne,addOrganizations:Ve.addMany,addOrganization:Ve.addOne,updateOrganizations:Ve.updateMany,updateOrganization:Ve.updateOne,deleteOrganization:Ve.deleteOne,deleteOrganizations:Ve.deleteMany}}),{initializeOrganizations:ff,setOrganizations:Sf,setOrganization:Af,addOrganizations:If,addOrganization:Tf,updateOrganizations:Of,updateOrganization:Pf,deleteOrganization:Ff,deleteOrganizations:bf}=rn.actions,_f=t=>t.organizationReducer.instances,gf=l.createSelector([_f],t=>Object.values(t)),Mf=t=>s=>s.organizationReducer.instances[t],Rf=y(l.createSelector([gf,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wf=rn.reducer,vf=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:dt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Ef={deletedRequests:[],latestRetryTime:0},dn=l.createSlice({name:"outbox",initialState:Ef,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ef)),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 vf(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,j_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Bf,markForDeletion:q_,markAsDeleted:Vf,_setLatestRetryTime:zf}=dn.actions,Df=dn.reducer,ze=P(t=>t.uuid),jf={instances:{}},un=l.createSlice({name:"projectAccess",initialState:jf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,jf)),reducers:{initializeProjectAccesses:ze.initialize,addProjectAccess:ze.addOne,addProjectAccesses:ze.addMany,setProjectAccess:ze.setOne,setProjectAccesses:ze.setMany,updateProjectAccess:ze.updateOne,updateProjectAccesses:ze.updateMany,deleteProjectAccess:ze.deleteOne,deleteProjectAccesses:ze.deleteMany}}),{initializeProjectAccesses:qf,addProjectAccess:Cf,addProjectAccesses:$f,setProjectAccess:Uf,setProjectAccesses:Lf,updateProjectAccess:kf,updateProjectAccesses:Nf,deleteProjectAccess:Gf,deleteProjectAccesses:Hf}=un.actions,Wf=un.reducer,ln=t=>t.projectAccessReducer.instances,Et=l.createSelector(ln,t=>Object.values(t)),Kf=t=>s=>s.projectAccessReducer.instances[t],Yf=y(l.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),C_=y(l.createSelector([ln,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.project===s)))),$_=y(l.createSelector([Et,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.project===s))e[n.user]=n;return e})),U_=y(l.createSelector([xt,Et,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.project===e).map(c=>c.user));return S(t.filter(c=>n.has(c.id)))})),De=P(t=>t.uuid),Zf={instances:{}},on=l.createSlice({name:"projectAttachments",initialState:Zf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Zf)),reducers:{initializeProjectAttachments:De.initialize,addProjectAttachment:De.addOne,addProjectAttachments:De.addMany,setProjectAttachment:De.setOne,setProjectAttachments:De.setMany,updateProjectAttachment:De.updateOne,updateProjectAttachments:De.updateMany,deleteProjectAttachment:De.deleteOne,deleteProjectAttachments:De.deleteMany}}),{initializeProjectAttachments:Jf,addProjectAttachment:Xf,addProjectAttachments:Qf,setProjectAttachment:xf,setProjectAttachments:eS,updateProjectAttachment:tS,updateProjectAttachments:sS,deleteProjectAttachment:iS,deleteProjectAttachments:nS}=on.actions,cS=t=>t.projectAttachmentReducer.instances,hn=l.createSelector([cS],t=>Object.values(t)),aS=t=>s=>s.projectAttachmentReducer.instances[t],rS=y(l.createSelector([hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),L_=y(l.createSelector([hn,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>s===e)))),dS=on.reducer,je=P(t=>t.uuid),uS={instances:{}},mn=l.createSlice({name:"projectComments",initialState:uS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,uS)),reducers:{initializeProjectComments:je.initialize,addProjectComment:je.addOne,addProjectComments:je.addMany,setProjectComment:je.setOne,setProjectComments:je.setMany,updateProjectComment:je.updateOne,updateProjectComments:je.updateMany,deleteProjectComment:je.deleteOne,deleteProjectComments:je.deleteMany}}),{initializeProjectComments:lS,addProjectComment:oS,addProjectComments:hS,setProjectComment:mS,setProjectComments:pS,updateProjectComment:yS,updateProjectComments:fS,deleteProjectComment:SS,deleteProjectComments:AS}=mn.actions,IS=t=>t.projectCommentReducer.instances,ss=l.createSelector([IS],t=>S(Object.values(t).toSorted(At))),TS=t=>s=>s.projectCommentReducer.instances[t],OS=y(l.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),k_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),N_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.project)))})),PS=mn.reducer,qe=P(t=>t.uuid),FS={instances:{}},pn=l.createSlice({name:"projectFiles",initialState:FS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,FS)),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}}),{initializeProjectFiles:bS,setProjectFile:_S,setProjectFiles:gS,addProjectFile:MS,addProjectFiles:RS,updateProjectFile:wS,updateProjectFiles:vS,deleteProjectFile:ES,deleteProjectFiles:BS}=pn.actions,VS=t=>t.projectFileReducer.instances,zS=l.createSelector([VS],t=>S(Object.values(t).toSorted((s,e)=>s.z_index-e.z_index))),DS=t=>s=>s.projectFileReducer.instances[t],jS=y(l.createSelector([zS,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),qS=pn.reducer,Ce=P(t=>t.uuid),CS={instances:{}},yn=l.createSlice({name:"projects",initialState:CS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,CS)),reducers:{initializeProjects:Ce.initialize,setProjects:Ce.setMany,setProject:Ce.setOne,addProjects:Ce.addMany,addProject:Ce.addOne,updateProjects:Ce.updateMany,updateProject:Ce.updateOne,deleteProject:Ce.deleteOne,deleteProjects:Ce.deleteMany}}),{initializeProjects:$S,setProjects:US,setProject:LS,addProjects:kS,addProject:NS,updateProjects:GS,updateProject:HS,deleteProject:WS,deleteProjects:KS}=yn.actions,YS=yn.reducer,ZS=t=>t.projectReducer.instances,is=l.createSelector([ZS],t=>Object.values(t)),JS=t=>s=>s.projectReducer.instances[t],XS=y(l.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),G_=y(l.createSelector([is,Et,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.user===e).map(c=>c.project));return S(t.filter(c=>n.has(c.uuid)))})),H_=y(l.createSelector([is,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),$e=P(({uuid:t})=>t),QS={instances:{}},fn=l.createSlice({name:"procedureInitiatives",initialState:QS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,QS)),reducers:{initializeProcedureInitiatives:$e.initialize,addProcedureInitiative:$e.addOne,addProcedureInitiatives:$e.addMany,setProcedureInitiative:$e.setOne,setProcedureInitiatives:$e.setMany,updateProcedureInitiative:$e.updateOne,updateProcedureInitiatives:$e.updateMany,deleteProcedureInitiative:$e.deleteOne,deleteProcedureInitiatives:$e.deleteMany}}),{initializeProcedureInitiatives:xS,addProcedureInitiative:eA,addProcedureInitiatives:tA,setProcedureInitiative:sA,setProcedureInitiatives:iA,updateProcedureInitiative:nA,updateProcedureInitiatives:cA,deleteProcedureInitiative:aA,deleteProcedureInitiatives:rA}=fn.actions,dA=fn.reducer,uA=t=>t.procedureInitiativeReducer.instances,ns=l.createSelector([uA],t=>Object.values(t)),lA=t=>s=>s.procedureInitiativeReducer.instances[t],oA=y(l.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),W_=y(l.createSelector([ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),K_=y(l.createSelector([ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),Ue=P(({uuid:t})=>t),hA={instances:{}},Sn=l.createSlice({name:"procedures",initialState:hA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,hA)),reducers:{initializeProcedures:Ue.initialize,addProcedure:Ue.addOne,addProcedures:Ue.addMany,setProcedure:Ue.setOne,setProcedures:Ue.setMany,updateProcedure:Ue.updateOne,updateProcedures:Ue.updateMany,deleteProcedure:Ue.deleteOne,deleteProcedures:Ue.deleteMany}}),{initializeProcedures:mA,addProcedure:pA,addProcedures:Pt,setProcedure:yA,setProcedures:fA,updateProcedure:SA,updateProcedures:AA,deleteProcedure:IA,deleteProcedures:Ft}=Sn.actions,TA=Sn.reducer,OA=t=>t.procedureReducer.instances,ot=l.createSelector([OA],t=>Object.values(t)),PA=t=>s=>s.procedureReducer.instances[t],FA=y(l.createSelector([ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Y_=y(l.createSelector([ot,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),bA=y(l.createSelector([ot,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),_A=y(l.createSelector([ot,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),gA=y(l.createSelector([ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),MA=y(l.createSelector([ot,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_initiative===s)))),Le=P(t=>t.uuid),RA={instances:{}},An=l.createSlice({name:"procedureStepAssignees",initialState:RA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,RA)),reducers:{initializeProcedureStepAssignees:Le.initialize,addProcedureStepAssignee:Le.addOne,addProcedureStepAssignees:Le.addMany,setProcedureStepAssignee:Le.setOne,setProcedureStepAssignees:Le.setMany,updateProcedureStepAssignee:Le.updateOne,updateProcedureStepAssignees:Le.updateMany,deleteProcedureStepAssignee:Le.deleteOne,deleteProcedureStepAssignees:Le.deleteMany}}),{initializeProcedureStepAssignees:wA,addProcedureStepAssignee:vA,addProcedureStepAssignees:EA,setProcedureStepAssignee:BA,setProcedureStepAssignees:VA,updateProcedureStepAssignee:zA,updateProcedureStepAssignees:DA,deleteProcedureStepAssignee:jA,deleteProcedureStepAssignees:qA}=An.actions,CA=t=>t.procedureStepAssigneeReducer.instances,Bt=l.createSelector([CA],t=>Object.values(t)),$A=t=>s=>s.procedureStepAssigneeReducer.instances[t],UA=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Z_=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),J_=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),X_=y(l.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),LA=An.reducer,ke=P(t=>t.uuid),kA={instances:{}},In=l.createSlice({name:"procedureStepComments",initialState:kA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,kA)),reducers:{initializeProcedureStepComments:ke.initialize,addProcedureStepComment:ke.addOne,addProcedureStepComments:ke.addMany,setProcedureStepComment:ke.setOne,setProcedureStepComments:ke.setMany,updateProcedureStepComment:ke.updateOne,updateProcedureStepComments:ke.updateMany,deleteProcedureStepComment:ke.deleteOne,deleteProcedureStepComments:ke.deleteMany}}),{initializeProcedureStepComments:NA,addProcedureStepComment:GA,addProcedureStepComments:HA,setProcedureStepComment:WA,setProcedureStepComments:KA,updateProcedureStepComment:YA,updateProcedureStepComments:ZA,deleteProcedureStepComment:JA,deleteProcedureStepComments:XA}=In.actions,QA=t=>t.procedureStepCommentReducer.instances,Vt=l.createSelector([QA],t=>Object.values(t)),xA=t=>s=>s.procedureStepCommentReducer.instances[t],eI=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Q_=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),x_=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),eg=y(l.createSelector([Vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),tI=In.reducer,Ne=P(t=>t.uuid),sI={instances:{}},Tn=l.createSlice({name:"procedureStepDefaultAssignees",initialState:sI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,sI)),reducers:{initializeProcedureStepDefaultAssignees:Ne.initialize,addProcedureStepDefaultAssignee:Ne.addOne,addProcedureStepDefaultAssignees:Ne.addMany,setProcedureStepDefaultAssignee:Ne.setOne,setProcedureStepDefaultAssignees:Ne.setMany,updateProcedureStepDefaultAssignee:Ne.updateOne,updateProcedureStepDefaultAssignees:Ne.updateMany,deleteProcedureStepDefaultAssignee:Ne.deleteOne,deleteProcedureStepDefaultAssignees:Ne.deleteMany}}),{initializeProcedureStepDefaultAssignees:iI,addProcedureStepDefaultAssignee:nI,addProcedureStepDefaultAssignees:cI,setProcedureStepDefaultAssignee:aI,setProcedureStepDefaultAssignees:rI,updateProcedureStepDefaultAssignee:dI,updateProcedureStepDefaultAssignees:uI,deleteProcedureStepDefaultAssignee:lI,deleteProcedureStepDefaultAssignees:oI}=Tn.actions,hI=t=>t.procedureStepDefaultAssigneeReducer.instances,On=l.createSelector([hI],t=>Object.values(t)),mI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],pI=y(l.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tg=y(l.createSelector([On,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),yI=Tn.reducer,Ge=P(t=>t.uuid),fI={instances:{}},Pn=l.createSlice({name:"procedureStepDefaultReviewers",initialState:fI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,fI)),reducers:{initializeProcedureStepDefaultReviewers:Ge.initialize,addProcedureStepDefaultReviewer:Ge.addOne,addProcedureStepDefaultReviewers:Ge.addMany,setProcedureStepDefaultReviewer:Ge.setOne,setProcedureStepDefaultReviewers:Ge.setMany,updateProcedureStepDefaultReviewer:Ge.updateOne,updateProcedureStepDefaultReviewers:Ge.updateMany,deleteProcedureStepDefaultReviewer:Ge.deleteOne,deleteProcedureStepDefaultReviewers:Ge.deleteMany}}),{initializeProcedureStepDefaultReviewers:SI,addProcedureStepDefaultReviewer:AI,addProcedureStepDefaultReviewers:II,setProcedureStepDefaultReviewer:TI,setProcedureStepDefaultReviewers:OI,updateProcedureStepDefaultReviewer:PI,updateProcedureStepDefaultReviewers:FI,deleteProcedureStepDefaultReviewer:bI,deleteProcedureStepDefaultReviewers:_I}=Pn.actions,gI=t=>t.procedureStepDefaultReviewerReducer.instances,Fn=l.createSelector([gI],t=>Object.values(t)),MI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],RI=y(l.createSelector([Fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),sg=y(l.createSelector([Fn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),wI=Pn.reducer,He=P(t=>t.uuid),vI={instances:{}},bn=l.createSlice({name:"procedureStepEvents",initialState:vI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vI)),reducers:{initializeProcedureStepEvents:He.initialize,addProcedureStepEvent:He.addOne,addProcedureStepEvents:He.addMany,setProcedureStepEvent:He.setOne,setProcedureStepEvents:He.setMany,updateProcedureStepEvent:He.updateOne,updateProcedureStepEvents:He.updateMany,deleteProcedureStepEvent:He.deleteOne,deleteProcedureStepEvents:He.deleteMany}}),{initializeProcedureStepEvents:EI,addProcedureStepEvent:BI,addProcedureStepEvents:VI,setProcedureStepEvent:zI,setProcedureStepEvents:DI,updateProcedureStepEvent:jI,updateProcedureStepEvents:qI,deleteProcedureStepEvent:CI,deleteProcedureStepEvents:$I}=bn.actions,UI=t=>t.procedureStepEventReducer.instances,zt=l.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.procedureStepEventReducer.instances[t],kI=y(l.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ig=y(l.createSelector([zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),ng=y(l.createSelector([zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),cg=y(l.createSelector([zt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),NI=bn.reducer,We=P(t=>t.uuid),GI={instances:{}},_n=l.createSlice({name:"procedureStepFieldsAttachments",initialState:GI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,GI)),reducers:{initializeProcedureStepFieldsAttachments:We.initialize,addProcedureStepFieldsAttachment:We.addOne,addProcedureStepFieldsAttachments:We.addMany,setProcedureStepFieldsAttachment:We.setOne,setProcedureStepFieldsAttachments:We.setMany,updateProcedureStepFieldsAttachment:We.updateOne,updateProcedureStepFieldsAttachments:We.updateMany,deleteProcedureStepFieldsAttachment:We.deleteOne,deleteProcedureStepFieldsAttachments:We.deleteMany}}),{initializeProcedureStepFieldsAttachments:HI,addProcedureStepFieldsAttachment:WI,addProcedureStepFieldsAttachments:gn,setProcedureStepFieldsAttachment:KI,setProcedureStepFieldsAttachments:YI,updateProcedureStepFieldsAttachment:ZI,updateProcedureStepFieldsAttachments:JI,deleteProcedureStepFieldsAttachment:XI,deleteProcedureStepFieldsAttachments:Mn}=_n.actions,QI=t=>t.procedureStepFieldsAttachmentReducer.instances,Rn=l.createSelector([QI],t=>Object.values(t)),xI=y(l.createSelector([Rn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),eT=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],tT=y(l.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),sT=_n.reducer,Ke=P(t=>t.uuid),iT={instances:{}},wn=l.createSlice({name:"procedureStepFields",initialState:iT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,iT)),reducers:{initializeProcedureStepFields:Ke.initialize,addProcedureStepFields:Ke.addOne,addProcedureStepFieldsMany:Ke.addMany,setProcedureStepFields:Ke.setOne,setProcedureStepFieldsMany:Ke.setMany,updateProcedureStepFields:Ke.updateOne,updateProcedureStepFieldsMany:Ke.updateMany,deleteProcedureStepFields:Ke.deleteOne,deleteProcedureStepFieldsMany:Ke.deleteMany}}),{initializeProcedureStepFields:nT,addProcedureStepFields:cT,addProcedureStepFieldsMany:aT,setProcedureStepFields:rT,setProcedureStepFieldsMany:dT,updateProcedureStepFields:uT,updateProcedureStepFieldsMany:lT,deleteProcedureStepFields:oT,deleteProcedureStepFieldsMany:hT}=wn.actions,vn=t=>t.procedureStepFieldsReducer.instances,cs=l.createSelector([vn],t=>Object.values(t)),ag=y(l.createSelector([cs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),rg=y(l.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).toSorted(At).pop())),dg=l.createSelector([vn],t=>{const s={};for(const e of Object.values(t)){const n=s[e.procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.procedure_step]=e)}return s}),mT=t=>s=>s.procedureStepFieldsReducer.instances[t],pT=y(l.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yT=wn.reducer,Ye=P(t=>t.uuid),fT={instances:{}},En=l.createSlice({name:"procedureStepFieldValuesAttachments",initialState:fT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,fT)),reducers:{initializeProcedureStepFieldValuesAttachments:Ye.initialize,addProcedureStepFieldValuesAttachment:Ye.addOne,addProcedureStepFieldValuesAttachments:Ye.addMany,setProcedureStepFieldValuesAttachment:Ye.setOne,setProcedureStepFieldValuesAttachments:Ye.setMany,updateProcedureStepFieldValuesAttachment:Ye.updateOne,updateProcedureStepFieldValuesAttachments:Ye.updateMany,deleteProcedureStepFieldValuesAttachment:Ye.deleteOne,deleteProcedureStepFieldValuesAttachments:Ye.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:ST,addProcedureStepFieldValuesAttachment:AT,addProcedureStepFieldValuesAttachments:Bn,setProcedureStepFieldValuesAttachment:IT,setProcedureStepFieldValuesAttachments:TT,updateProcedureStepFieldValuesAttachment:OT,updateProcedureStepFieldValuesAttachments:PT,deleteProcedureStepFieldValuesAttachment:FT,deleteProcedureStepFieldValuesAttachments:Vn}=En.actions,bT=t=>t.procedureStepFieldValuesAttachmentReducer.instances,zn=l.createSelector([bT],t=>Object.values(t)),_T=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],gT=y(l.createSelector([zn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),MT=y(l.createSelector([zn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),RT=En.reducer,Ze=P(t=>t.uuid),wT={instances:{}},Dn=l.createSlice({name:"procedureStepFieldValues",initialState:wT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,wT)),reducers:{initializeProcedureStepFieldValues:Ze.initialize,addProcedureStepFieldValues:Ze.addOne,addProcedureStepFieldValuesMany:Ze.addMany,setProcedureStepFieldValues:Ze.setOne,setProcedureStepFieldValuesMany:Ze.setMany,updateProcedureStepFieldValues:Ze.updateOne,updateProcedureStepFieldValuesMany:Ze.updateMany,deleteProcedureStepFieldValues:Ze.deleteOne,deleteProcedureStepFieldValuesMany:Ze.deleteMany}}),{initializeProcedureStepFieldValues:vT,addProcedureStepFieldValues:ET,addProcedureStepFieldValuesMany:BT,setProcedureStepFieldValues:VT,setProcedureStepFieldValuesMany:zT,updateProcedureStepFieldValues:DT,updateProcedureStepFieldValuesMany:jT,deleteProcedureStepFieldValues:qT,deleteProcedureStepFieldValuesMany:CT}=Dn.actions,$T=Dn.reducer,UT=t=>t.procedureStepFieldValuesReducer.instances,ht=l.createSelector([UT],t=>Object.values(t)),ug=y(l.createSelector([ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),lg=y(l.createSelector([ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),LT=t=>s=>s.procedureStepFieldValuesReducer.instances[t],kT=y(l.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),og=y(l.createSelector([ht,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),Je=P(t=>t.uuid),NT={instances:{}},jn=l.createSlice({name:"procedureStepFieldValuesReviews",initialState:NT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,NT)),reducers:{initializeProcedureStepFieldValuesReviews:Je.initialize,addProcedureStepFieldValuesReview:Je.addOne,addProcedureStepFieldValuesReviews:Je.addMany,setProcedureStepFieldValuesReview:Je.setOne,setProcedureStepFieldValuesReviews:Je.setMany,updateProcedureStepFieldValuesReview:Je.updateOne,updateProcedureStepFieldValuesReviews:Je.updateMany,deleteProcedureStepFieldValuesReview:Je.deleteOne,deleteProcedureStepFieldValuesReviews:Je.deleteMany}}),{initializeProcedureStepFieldValuesReviews:GT,addProcedureStepFieldValuesReview:HT,addProcedureStepFieldValuesReviews:qn,setProcedureStepFieldValuesReview:WT,setProcedureStepFieldValuesReviews:KT,updateProcedureStepFieldValuesReview:YT,updateProcedureStepFieldValuesReviews:ZT,deleteProcedureStepFieldValuesReview:JT,deleteProcedureStepFieldValuesReviews:Cn}=jn.actions,XT=t=>t.procedureStepFieldValuesReviewReducer.instances,mt=l.createSelector([XT],t=>Object.values(t)),QT=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],xT=y(l.createSelector([mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),eO=y(l.createSelector([mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),hg=y(l.createSelector([mt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:c}=n;c===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),mg=y(l.createSelector([ht,mt,(t,s)=>s],(t,s,e)=>{const n=new Set(w(t.filter(({procedure:c})=>e===c)));return S(s.filter(({field_values:c})=>n.has(c)))})),pg=y(l.createSelector([ht,mt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const c=new Set(w(t.filter(({procedure_step:r,procedure:a})=>e===a&&r===n)));return S(s.filter(({field_values:r})=>c.has(r)))})),yg=l.createSelector([mt],t=>{const s={};for(const e of t){const{field_values:n}=e,c=s[n];(!c||c.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),tO=jn.reducer,Xe=P(t=>t.uuid),sO={instances:{}},$n=l.createSlice({name:"procedureStepReviewers",initialState:sO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,sO)),reducers:{initializeProcedureStepReviewers:Xe.initialize,addProcedureStepReviewer:Xe.addOne,addProcedureStepReviewers:Xe.addMany,setProcedureStepReviewer:Xe.setOne,setProcedureStepReviewers:Xe.setMany,updateProcedureStepReviewer:Xe.updateOne,updateProcedureStepReviewers:Xe.updateMany,deleteProcedureStepReviewer:Xe.deleteOne,deleteProcedureStepReviewers:Xe.deleteMany}}),{initializeProcedureStepReviewers:iO,addProcedureStepReviewer:nO,addProcedureStepReviewers:cO,setProcedureStepReviewer:aO,setProcedureStepReviewers:rO,updateProcedureStepReviewer:dO,updateProcedureStepReviewers:uO,deleteProcedureStepReviewer:lO,deleteProcedureStepReviewers:oO}=$n.actions,hO=t=>t.procedureStepReviewerReducer.instances,Dt=l.createSelector([hO],t=>Object.values(t)),mO=t=>s=>s.procedureStepReviewerReducer.instances[t],pO=y(l.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),fg=y(l.createSelector([Dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),Sg=y(l.createSelector([Dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),Ag=y(l.createSelector([Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),yO=$n.reducer,Qe=P(t=>t.uuid),fO={instances:{}},Un=l.createSlice({name:"procedureSteps",initialState:fO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,fO)),reducers:{initializeProcedureSteps:Qe.initialize,setProcedureStep:Qe.setOne,setProcedureSteps:Qe.setMany,addProcedureStep:Qe.addOne,addProcedureSteps:Qe.addMany,updateProcedureStep:Qe.updateOne,updateProcedureSteps:Qe.updateMany,deleteProcedureStep:Qe.deleteOne,deleteProcedureSteps:Qe.deleteMany}}),{initializeProcedureSteps:SO,setProcedureStep:AO,setProcedureSteps:IO,addProcedureStep:TO,addProcedureSteps:OO,updateProcedureStep:PO,updateProcedureSteps:FO,deleteProcedureStep:bO,deleteProcedureSteps:_O}=Un.actions,gO=Un.reducer,Ln=t=>t.procedureStepReducer.instances,MO=t=>s=>s.procedureStepReducer.instances[t],kn=l.createSelector([Ln],t=>Object.values(t).toSorted((s,e)=>s.order-e.order)),Ig=y(l.createSelector([Ln,(t,s)=>s],(t,s)=>{const e={};for(const[n,c]of Object.entries(t))c.procedure_type===s&&(e[n]=c);return hs(e)})),Tg=y(l.createSelector([kn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),RO=y(l.createSelector([kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xe=P(({uuid:t})=>t),wO={instances:{}},Nn=l.createSlice({name:"procedureTypeAttachments",initialState:wO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,wO)),reducers:{initializeProcedureTypeAttachments:xe.initialize,addProcedureTypeAttachment:xe.addOne,addProcedureTypeAttachments:xe.addMany,setProcedureTypeAttachment:xe.setOne,setProcedureTypeAttachments:xe.setMany,updateProcedureTypeAttachment:xe.updateOne,updateProcedureTypeAttachments:xe.updateMany,deleteProcedureTypeAttachment:xe.deleteOne,deleteProcedureTypeAttachments:xe.deleteMany}}),{initializeProcedureTypeAttachments:vO,addProcedureTypeAttachment:EO,addProcedureTypeAttachments:BO,setProcedureTypeAttachment:VO,setProcedureTypeAttachments:zO,updateProcedureTypeAttachment:DO,updateProcedureTypeAttachments:jO,deleteProcedureTypeAttachment:qO,deleteProcedureTypeAttachments:CO}=Nn.actions,$O=Nn.reducer,UO=t=>t.procedureTypeAttachmentReducer.instances,Gn=l.createSelector([UO],t=>Object.values(t)),LO=t=>s=>s.procedureTypeAttachmentReducer.instances[t],kO=y(l.createSelector([Gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Og=y(l.createSelector([Gn,(t,s)=>s],(t,s)=>S(t.filter(({procedure_type:e})=>s===e)))),et=P(({uuid:t})=>t),NO={instances:{}},Hn=l.createSlice({name:"procedureTypeFieldsAttachments",initialState:NO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,NO)),reducers:{initializeProcedureTypeFieldsAttachments:et.initialize,addProcedureTypeFieldsAttachment:et.addOne,addProcedureTypeFieldsAttachments:et.addMany,setProcedureTypeFieldsAttachment:et.setOne,setProcedureTypeFieldsAttachments:et.setMany,updateProcedureTypeFieldsAttachment:et.updateOne,updateProcedureTypeFieldsAttachments:et.updateMany,deleteProcedureTypeFieldsAttachment:et.deleteOne,deleteProcedureTypeFieldsAttachments:et.deleteMany}}),{initializeProcedureTypeFieldsAttachments:GO,addProcedureTypeFieldsAttachment:HO,addProcedureTypeFieldsAttachments:WO,setProcedureTypeFieldsAttachment:KO,setProcedureTypeFieldsAttachments:YO,updateProcedureTypeFieldsAttachment:ZO,updateProcedureTypeFieldsAttachments:JO,deleteProcedureTypeFieldsAttachment:XO,deleteProcedureTypeFieldsAttachments:QO}=Hn.actions,xO=Hn.reducer,eP=t=>t.procedureTypeFieldsAttachmentReducer.instances,Wn=l.createSelector([eP],t=>Object.values(t)),Pg=y(l.createSelector([Wn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),tP=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],sP=y(l.createSelector([Wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tt=P(({uuid:t})=>t),iP={instances:{}},Kn=l.createSlice({name:"procedureTypeFields",initialState:iP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,iP)),reducers:{initializeProcedureTypeFields:tt.initialize,addProcedureTypeFields:tt.addOne,addProcedureTypeFieldsMany:tt.addMany,setProcedureTypeFields:tt.setOne,setProcedureTypeFieldsMany:tt.setMany,updateProcedureTypeFields:tt.updateOne,updateProcedureTypeFieldsMany:tt.updateMany,deleteProcedureTypeFields:tt.deleteOne,deleteProcedureTypeFieldsMany:tt.deleteMany}}),{initializeProcedureTypeFields:nP,addProcedureTypeFields:cP,addProcedureTypeFieldsMany:aP,setProcedureTypeFields:rP,setProcedureTypeFieldsMany:dP,updateProcedureTypeFields:uP,updateProcedureTypeFieldsMany:lP,deleteProcedureTypeFields:oP,deleteProcedureTypeFieldsMany:hP}=Kn.actions,mP=Kn.reducer,pP=t=>t.procedureTypeFieldsReducer.instances,as=l.createSelector([pP],t=>Object.values(t)),Fg=y(l.createSelector([as,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),bg=y(l.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),yP=t=>s=>s.procedureTypeFieldsReducer.instances[t],fP=y(l.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),st=P(({uuid:t})=>t),SP={instances:{}},Yn=l.createSlice({name:"procedureFieldValuesAttachments",initialState:SP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,SP)),reducers:{initializeProcedureFieldValuesAttachments:st.initialize,addProcedureFieldValuesAttachment:st.addOne,addProcedureFieldValuesAttachments:st.addMany,setProcedureFieldValuesAttachment:st.setOne,setProcedureFieldValuesAttachments:st.setMany,updateProcedureFieldValuesAttachment:st.updateOne,updateProcedureFieldValuesAttachments:st.updateMany,deleteProcedureFieldValuesAttachment:st.deleteOne,deleteProcedureFieldValuesAttachments:st.deleteMany}}),{initializeProcedureFieldValuesAttachments:AP,addProcedureFieldValuesAttachment:IP,addProcedureFieldValuesAttachments:Zn,setProcedureFieldValuesAttachment:TP,setProcedureFieldValuesAttachments:OP,updateProcedureFieldValuesAttachment:PP,updateProcedureFieldValuesAttachments:FP,deleteProcedureFieldValuesAttachment:bP,deleteProcedureFieldValuesAttachments:Jn}=Yn.actions,_P=Yn.reducer,gP=t=>t.procedureFieldValuesAttachmentReducer.instances,Xn=l.createSelector([gP],t=>Object.values(t)),MP=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],RP=y(l.createSelector([Xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wP=y(l.createSelector([Xn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),it=P(({uuid:t})=>t),vP={instances:{}},Qn=l.createSlice({name:"procedureFieldValues",initialState:vP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vP)),reducers:{initializeProcedureFieldValues:it.initialize,addProcedureFieldValues:it.addOne,addProcedureFieldValuesMany:it.addMany,setProcedureFieldValues:it.setOne,setProcedureFieldValuesMany:it.setMany,updateProcedureFieldValues:it.updateOne,updateProcedureFieldValuesMany:it.updateMany,deleteProcedureFieldValues:it.deleteOne,deleteProcedureFieldValuesMany:it.deleteMany}}),{initializeProcedureFieldValues:EP,addProcedureFieldValues:BP,addProcedureFieldValuesMany:VP,setProcedureFieldValues:zP,setProcedureFieldValuesMany:DP,updateProcedureFieldValues:jP,updateProcedureFieldValuesMany:qP,deleteProcedureFieldValues:CP,deleteProcedureFieldValuesMany:$P}=Qn.actions,UP=Qn.reducer,LP=t=>t.procedureFieldValuesReducer.instances,xn=l.createSelector([LP],t=>Object.values(t)),_g=y(l.createSelector([xn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),kP=t=>s=>s.procedureFieldValuesReducer.instances[t],NP=y(l.createSelector([xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),nt=P(t=>t.uuid),GP={instances:{}},ec=l.createSlice({name:"procedureTypes",initialState:GP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,GP)),reducers:{initializeProcedureTypes:nt.initialize,addProcedureType:nt.addOne,addProcedureTypes:nt.addMany,setProcedureType:nt.setOne,setProcedureTypes:nt.setMany,updateProcedureType:nt.updateOne,updateProcedureTypes:nt.updateMany,deleteProcedureType:nt.deleteOne,deleteProcedureTypes:nt.deleteMany}}),{initializeProcedureTypes:HP,addProcedureType:WP,addProcedureTypes:KP,setProcedureType:YP,setProcedureTypes:ZP,updateProcedureType:JP,updateProcedureTypes:XP,deleteProcedureType:QP,deleteProcedureTypes:xP}=ec.actions,eF=ec.reducer,tF=t=>t.procedureTypeReducer.instances,tc=l.createSelector([tF],t=>Object.values(t)),sF=t=>s=>s.procedureTypeReducer.instances[t],iF=y(l.createSelector([tc,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),gg=y(l.createSelector([tc,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Mg={isRehydrated:!1},sc=l.createSlice({name:"rehydrated",initialState:Mg,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Rg}=sc.actions,wg=t=>t.rehydratedReducer.isRehydrated,nF=sc.reducer,ct=P(t=>t.uuid),cF={instances:{}},ic=l.createSlice({name:"teamMemberships",initialState:cF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,cF)),reducers:{initializeTeamMemberships:ct.initialize,addTeamMembership:ct.addOne,addTeamMemberships:ct.addMany,setTeamMembership:ct.setOne,setTeamMemberships:ct.setMany,updateTeamMembership:ct.updateOne,updateTeamMemberships:ct.updateMany,deleteTeamMembership:ct.deleteOne,deleteTeamMemberships:ct.deleteMany}}),{initializeTeamMemberships:aF,addTeamMembership:rF,addTeamMemberships:dF,setTeamMembership:uF,setTeamMemberships:lF,updateTeamMembership:oF,updateTeamMemberships:hF,deleteTeamMembership:mF,deleteTeamMemberships:pF}=ic.actions,yF=ic.reducer,fF=t=>t.teamMembershipReducer.instances,rs=l.createSelector([fF],t=>Object.values(t)),SF=t=>s=>s.teamMembershipReducer.instances[t],AF=y(l.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),vg=y(l.createSelector([rs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.team===s))e[n.user]=n;return e})),Eg=y(l.createSelector([xt,rs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.team===e).map(c=>c.user));return S(t.filter(c=>n.has(c.id)))})),at=P(t=>t.uuid),IF={instances:{}},nc=l.createSlice({name:"teams",initialState:IF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,IF)),reducers:{initializeTeams:at.initialize,addTeam:at.addOne,addTeams:at.addMany,setTeam:at.setOne,setTeams:at.setMany,updateTeam:at.updateOne,updateTeams:at.updateMany,deleteTeam:at.deleteOne,deleteTeams:at.deleteMany}}),{initializeTeams:TF,addTeam:OF,addTeams:PF,setTeam:FF,setTeams:bF,updateTeam:_F,updateTeams:gF,deleteTeam:MF,deleteTeams:RF}=nc.actions,wF=t=>t.teamReducer.instances,cc=l.createSelector([wF],t=>Object.values(t)),vF=t=>s=>s.teamReducer.instances[t],EF=y(l.createSelector([cc,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Bg=y(l.createSelector([cc,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),BF=nc.reducer,ac={outboxReducer:Df,fileReducer:qu,authReducer:Wd},Vg=l.combineReducers(ac),VF={...ac,assetReducer:Ma,assetAttachmentReducer:ea,assetCommentReducer:pa,assetTypeReducer:wd,assetTypeAttachmentReducer:Ua,issueReducer:im,issueAttachmentReducer:Sh,issueTypeReducer:Iy,issueTypeAttachmentReducer:Sm,organizationReducer:wf,projectReducer:YS,projectAttachmentReducer:dS,projectCommentReducer:PS,projectAccessReducer:Wf,organizationAccessReducer:of,projectFileReducer:qS,procedureTypeReducer:eF,procedureInitiativeReducer:dA,procedureReducer:TA,procedureTypeFieldsReducer:mP,procedureFieldValuesReducer:UP,procedureTypeAttachmentReducer:$O,procedureTypeFieldsAttachmentReducer:xO,procedureFieldValuesAttachmentReducer:_P,procedureStepFieldsAttachmentReducer:sT,procedureStepFieldsReducer:yT,procedureStepFieldValuesAttachmentReducer:RT,procedureStepFieldValuesReducer:$T,procedureStepFieldValuesReviewReducer:tO,procedureStepAssigneeReducer:LA,procedureStepCommentReducer:tI,procedureStepDefaultAssigneeReducer:yI,procedureStepDefaultReviewerReducer:wI,procedureStepEventReducer:NI,procedureStepReviewerReducer:yO,procedureStepReducer:gO,rehydratedReducer:nF,formReducer:Zl,formRevisionReducer:Cl,formRevisionAttachmentReducer:_l,formSubmissionAttachmentReducer:oo,formSubmissionReducer:Ro,formIdentifierReducer:Xu,formIdentifierValueReducer:ol,userReducer:Xy,emailDomainsReducer:zu,documentsReducer:Su,documentAttachmentReducer:au,teamReducer:BF,agentsReducer:Lc,issueCommentReducer:Gh,issueCommentAttachmentReducer:Eh,issueUpdateReducer:ky,geoImageReducer:ko,issueAssociationReducer:nh,issueTypeFieldsReducer:cp,issueTypeFieldValuesReducer:Hm,issueTypeFieldsAttachmentReducer:Em,issueTypeFieldValuesAttachmentReducer:Ap,issueTypeIdentifierReducer:Bp,issueTypeIdentifierValueReducer:Wp,issueTypePriorityReducer:cy,issueTypeStatusReducer:By,assetTypeFieldsReducer:pr,assetTypeFieldValuesReducer:Lr,assetTypeFieldsAttachmentReducer:er,assetTypeFieldValuesAttachmentReducer:Mr,assetTypeIdentifierReducer:td,assetTypeIdentifierValueReducer:yd,assetTypeStatusReducer:Nd,teamMembershipReducer:yF},zg=l.combineReducers(VF),zF=1e4,DF=200,rc=[400,409,403,404,405,500],N=1e4,jF={};class qF{constructor(s){h(this,"client");h(this,"pageSize",zF);jF[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)}select(s){return s(this.client.store.getState())}}const Dg=t=>{if(t)throw t;const s=gt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},CF=(t,s,e)=>{const n=ft();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},$F=(t,s,e)=>{const n=ft();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const r=s.meta.offlineAction.payload.uuid;return n.remove(r),n.getQueue()};async function jg(t,s){if(!s.payload)throw new Error("Received empty payload");return QF(s)}const qg={...pc,effect:jg,discard:LF,returnPromises:!0,persistCallback:Dg,retry:Ug,persistOptions:{storage:cb},queue:{...pc.queue,enqueue:CF,dequeue:$F,peek:(...t)=>$g(...t)}},Cg=nb.offline(qg);async function UF(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const c=jF[t.meta.offline.effect.serviceName];if(!c)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return uc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,c,e)}function LF(t,s,e=0){var p;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
2
|
+
Url:`,s.payload.url,`
|
|
3
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=gt(),r=n.getState().outboxReducer.deletedRequests,a=s.payload.uuid;function u(){n.dispatch(Vf(a));const m=ft();if(!m)throw new Error("Outbox coordinator not set");m.remove(s.payload.uuid);const f=s.meta.offline.rollback;throw f&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(f)),t}if(t instanceof U&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),u()),r.includes(a)&&(console.debug("Discarding request due to deletion:",s.payload.url),u()),t instanceof U){const m=t.status||((p=t.response)==null?void 0:p.status);if(m||console.warn("Error has no status code:",t),m!==void 0&&rc.includes(m)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const f=ft();if(!f)throw new Error("Outbox coordinator not set");f.remove(s.payload.uuid),t.options.discard=!0,u()}}console.debug("Registering a retry for request:",s.payload.uuid);const d=ft();if(!d)throw new Error("Outbox coordinator not set");return d.registerRetry(s.payload.uuid),!1}function $g(t,s,e){var n;return(n=ft())==null?void 0:n.peek()}function Ug(t,s){return gt().dispatch(zf(new Date().getTime())),Sc}const bt="An unknown error occurred",Lg=500,kF=["non_field_errors","detail"];function kg(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(([c,r])=>typeof r=="string"?kF.includes(c)?r:`${c}: ${r}`:Array.isArray(r)?kF.includes(c)?r.join(`
|
|
5
|
+
`):r.map(a=>`${c}: ${a}`).join(`
|
|
6
|
+
`):`${c}: ${JSON.stringify(r)}`).join(`
|
|
7
|
+
`)}catch(c){console.error("Failed to extract error message from response body",c)}}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>Lg?bt:e}class U extends Error{constructor(e){super(bt);h(this,"status");h(this,"response");h(this,"message");h(this,"options");const{response:n,innerError:c}=e;this.message=e.message??kg(n,c)??bt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function NF(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(c=>c 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 Ng extends qF{constructor(s){super(s)}}class pt extends qF{constructor(e,n){super(e);h(this,"auth");this.auth=n}}class Gg extends pt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:o.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(Cc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:o.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(c=>{this.dispatch(Uc(c))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:o.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch($c(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:o.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:o.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(qc(n)),n}}function rt(t,s){const e=[];let n=0;const c=t.length;for(;n<c;)e.push(t.slice(n,n+=s));return e}function A(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case o.GET:return`Get ${n}`;case o.POST:return`Create ${n}`;case o.PATCH:return`Update ${n}`;case o.PUT:return`Update ${n}`;case o.DELETE:return`Delete ${n}`}}function M(t){const s={...t};for(const e of[...Ac,"created_by"])e in s&&delete s[e];return s}class E extends pt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:o.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:o.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:o.GET,...s},e)}}class j extends E{constructor(){super(...arguments);h(this,"pageSize",DF)}async add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions;let a,u=null,d=null;if("file"in e){const{file:b,...g}=e;u=await this.client.files.getFilePayload(b),d=URL.createObjectURL(b),a={...g,file_sha1:u.sha1,file_type:u.file_type,file_name:b.name,file_extension:u.extension,file_url:d}}else a=e;const p=this.buildModel(a),m=this.buildPayload(p);this.dispatch(n(p));const f=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:{...m,...u?{file:u}:{}},blockers:this.getBlockers(p),blocks:this.getBlocks(p)});f.then(({instance:b})=>{this.dispatch(c(b))}).catch(b=>{throw this.dispatch(r(this.getId(p))),b}).finally(()=>{d&&URL.revokeObjectURL(d)});const I=f.then(({instance:b})=>b),R=f.then(async({instance:b,presigned_url:g})=>{try{return g&&await this.client.files.processPresignedUrl(b.file_sha1,g),b.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[p,I,R]}async bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=[],p=new Set,m=rt(e,Math.min(n??e.length,N)),f=[];for(const g of m){const _=[],v={},B=[],C=[];for(const z of g){let Mt;if("file"in z){const{file:hc,...yR}=z,Rt=await this.client.files.getFilePayload(hc);Rt.sha1 in v||(v[Rt.sha1]=Rt);const tb=URL.createObjectURL(hc);p.add(tb),Mt={...yR,file_sha1:Rt.sha1,file_type:Rt.file_type,file_name:hc.name,file_extension:Rt.extension,file_url:tb}}else Mt=z;const q=this.buildModel(Mt);d.push(q);const G=this.buildBulkPayload(q);_.push(G);const ds=this.getBlockers(q);B.push(...ds);const pR=this.getBlocks(q);C.push(...pR)}const D={payloads:_,submittedAt:u,files:Object.values(v),blockers:B,blocks:C};f.push(D)}this.dispatch(c(d));const I=f.map(g=>{const{submittedAt:_,files:v,payloads:B,blocks:C,blockers:D}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:B},blockers:D,blocks:C})});Promise.all(I).then(g=>{const _=g.flatMap(v=>v.instances);this.dispatch(r(_))}).catch(g=>{throw this.dispatch(a(d.map(_=>this.getId(_)))),console.error(g),g}).finally(()=>{for(const g of p)URL.revokeObjectURL(g)});const R=Promise.all(I).then(g=>g.flatMap(({instances:_})=>_)),b=Promise.all(I).then(async g=>{const _=[];for(const{presigned_urls:v}of g){const B=this.client.files.processPresignedUrls(v);for(const[C,D]of Object.entries(B))try{await D,_.push(C)}catch(z){throw console.error("Upload to s3 using presigned url failed.",z),z}}return _});return[d,R,b]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}}class Hg extends j{constructor(){super(...arguments);h(this,"name","Asset attachment");h(this,"url","/asset-attachments");h(this,"actions",{addOne:Gc,addMany:As,setOne:Hc,setMany:Wc,updateOne:Kc,updateMany:Yc,deleteOne:Zc,deleteMany:Is,initialize:Nc});h(this,"selectors",{selectById:Xc,selectByIds:Qc})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(c(a)),a}}class Wg extends E{constructor(){super(...arguments);h(this,"name","Asset Comment");h(this,"url","/asset-comments");h(this,"actions",{addOne:ia,addMany:$t,setOne:na,setMany:ca,updateOne:aa,updateMany:ra,deleteOne:da,deleteMany:Ut,initialize:sa});h(this,"selectors",{selectById:la,selectByIds:oa})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.asset],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Asset comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Asset comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(c(a)),a}}class Kg extends E{constructor(){super(...arguments);h(this,"url","/assets");h(this,"name","Asset");h(this,"actions",{addOne:Sa,addMany:Fs,setOne:Oa,setMany:Pa,updateOne:Aa,updateMany:Ia,deleteOne:Ta,deleteMany:bs,initialize:fa});h(this,"selectors",{selectById:_a,selectByIds:ga})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No asset with uuid ${e} found in the store`);const u=this.select(xc(e)),d=this.select(ha(e)),p=this.select(sh(e)),m=this.select(_A(e)),f=this.select(go(e));this.dispatch(c(e)),this.dispatch(Is(w(u))),this.dispatch(Ut(w(d))),this.dispatch(Tt(w(p))),this.dispatch(Ft(w(m))),this.dispatch(lt(w(f)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(I){throw this.dispatch(n(a)),this.dispatch(As(u)),this.dispatch($t(d)),this.dispatch(It(p)),this.dispatch(Pt(m)),this.dispatch(ut(f)),I}}bulkAdd(e,n){const{addMany:c}=this.actions,r=new Date().toISOString(),a=rt(e,Math.min(n??e.length,N)).map(p=>{const m=p.map(f=>O(f));return{batchId:dt.v4(),payload:{submitted_at:r,assets:m}}}),u=[];let d=null;for(const p of a){const{batchId:m,payload:f}=p,I=f.assets.map(({uuid:v})=>v),R=f.assets.map(({asset_type:v})=>v),b=f.assets.map(({project:v})=>v),g=f.assets.map(({status:v})=>v),_=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:f,blockers:(d?[d]:[]).concat(R).concat(b).concat(g),blocks:[m].concat(I)});d=p.batchId,u.push(_)}return Promise.all(u).then(p=>{const m=p.flat();this.dispatch(c(m))}),u}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=w(e).toSorted(Ct);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(ps);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} assets that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=rt(e,Math.min(n??e.length,N)),m=[];let f=null;for(const I of p){const R=dt.v4(),b=w(I),g=I.map(({status:v})=>v).filter(Boolean),_=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(f?[f]:[]).concat(b).concat(g),blocks:[R].concat(b)});m.push(_),f=R}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(ma(e)),d=this.select(ih(e)),p=this.select(gA(e)),m=this.select(Mo(e));this.dispatch(c(e)),this.dispatch(Ut(w(u))),this.dispatch(Tt(w(d))),this.dispatch(Ft(w(p))),this.dispatch(lt(w(m)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(f){throw this.dispatch(n(a)),this.dispatch($t(u)),this.dispatch(It(d)),this.dispatch(Pt(p)),this.dispatch(ut(m)),f}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class Yg extends j{constructor(){super(...arguments);h(this,"name","Asset Type Attachment");h(this,"url","/asset-type-attachments");h(this,"actions",{addOne:va,addMany:gs,setOne:Ea,setMany:Ba,updateOne:Va,updateMany:za,deleteOne:Da,deleteMany:Ms,initialize:wa});h(this,"selectors",{selectById:qa,selectByIds:Ca})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class Zg extends j{constructor(){super(...arguments);h(this,"name","Asset Type Fields Attachment");h(this,"url","/asset-type-fields-attachments");h(this,"actions",{addOne:Na,addMany:Ga,setOne:Ha,setMany:Wa,updateOne:Ka,updateMany:Ya,deleteOne:Za,deleteMany:Ja,initialize:ka});h(this,"selectors",{selectById:Qa,selectByIds:xa})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class Jg extends E{constructor(){super(...arguments);h(this,"name","Asset Type Fields");h(this,"url","/asset-type-fields");h(this,"actions",{addOne:ir,addMany:nr,setOne:cr,setMany:ar,updateOne:rr,updateMany:dr,deleteOne:ur,deleteMany:lr,initialize:sr});h(this,"selectors",{selectById:hr,selectByIds:mr})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class Xg extends j{constructor(){super(...arguments);h(this,"name","Asset Type Field Values Attachment");h(this,"url","/asset-type-field-values-attachments");h(this,"actions",{addOne:Sr,addMany:Vs,setOne:Ar,setMany:Ir,updateOne:Tr,updateMany:Or,deleteOne:Pr,deleteMany:zs,initialize:fr});h(this,"selectors",{selectById:br,selectByIds:_r})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class Qg extends E{constructor(){super(...arguments);h(this,"name","Asset Type Field Values");h(this,"url","/asset-type-field-values");h(this,"actions",{addOne:vr,addMany:Er,setOne:Br,setMany:Vr,updateOne:zr,updateMany:Dr,deleteOne:jr,deleteMany:qr,initialize:wr});h(this,"selectors",{selectById:$r,selectByIds:Ur})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{payloads:c,values:r}=e,{addMany:a,setMany:u,deleteMany:d}=this.actions,p=new Date().toISOString(),m=[],f=rt(c,Math.min(n??c.length,N)),I=[];for(const b of f){const g=[];for(const _ of b){const v=O({..._,values:_.values,created_by:this.select(B=>{var C;return((C=B.userReducer.currentUser)==null?void 0:C.id)??null}),submitted_at:p});m.push(v),g.push({uuid:v.uuid,asset:_.asset,fields_revision:_.fields_revision,published_at:_.published_at,values:v.values})}I.push({submitted_at:p,values:r,field_values:g})}this.dispatch(a(m));const R=[];for(const b of I){const{field_values:g}=b,_=g.map(({asset:D})=>D),v=g.map(({fields_revision:D})=>D),B=g.map(({uuid:D})=>D),C=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_.concat(v),blocks:B});R.push(C)}return Promise.all(R).then(b=>{this.dispatch(u(b.flat()))}).catch(()=>{this.dispatch(d(w(m)))}),[m,R]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.asset],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(gr(e));this.dispatch(n(e)),this.dispatch(zs(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Vs(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class xg extends E{constructor(){super(...arguments);h(this,"name","Asset Type Identifier");h(this,"url","/asset-type-identifiers");h(this,"actions",{addOne:Gr,addMany:Hr,setOne:Wr,setMany:Kr,updateOne:Yr,updateMany:Zr,deleteOne:Jr,deleteMany:Xr,initialize:Nr});h(this,"selectors",{selectById:xr,selectByIds:ed})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class eM extends E{constructor(){super(...arguments);h(this,"name","Asset Type Identifier Value");h(this,"url","/asset-type-identifier-values");h(this,"actions",{addOne:nd,addMany:cd,setOne:ad,setMany:rd,updateOne:dd,updateMany:ud,deleteOne:ld,deleteMany:od,initialize:id});h(this,"selectors",{selectById:md,selectByIds:pd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset,e.asset_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(b=>{var g;return((g=b.userReducer.currentUser)==null?void 0:g.id)??null}),p=rt(e,Math.min(n??e.length,N)),m=[],f=[];for(const b of p){const g=[],_=[],v=[];for(const C of b){const D=O({...C,submitted_at:u,created_by:d});f.push(D);const z={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};g.push(z),_.push(D.asset),_.push(D.asset_type_identifier),v.push(D.uuid)}const B={payloads:g,submitted_at:u,blockers:_,blocks:v};m.push(B)}this.dispatch(c(f));const I=m.map(b=>{const{payloads:g,submitted_at:_,blockers:v,blocks:B}=b;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,payloads:g},blockers:v,blocks:B})});Promise.all(I).then(b=>{this.dispatch(r(b.flat()))}).catch(b=>{throw this.dispatch(a(w(f))),b});const R=Promise.all(I).then(b=>b.flat());return[f,R]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class tM extends E{constructor(){super(...arguments);h(this,"name","Asset Type");h(this,"url","/asset-types");h(this,"actions",{addOne:Td,addMany:Od,setOne:Ad,setMany:Id,updateOne:Pd,updateMany:Fd,deleteOne:bd,deleteMany:_d,initialize:Sd});h(this,"selectors",{selectById:Md,selectByIds:Rd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=this.select(ba(e)),d=this.select($a(e));this.dispatch(n(e)),this.dispatch(bs(w(u))),this.dispatch(Ms(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Fs(u)),this.dispatch(gs(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class sM extends E{constructor(){super(...arguments);h(this,"name","Asset Type Status");h(this,"url","/asset-type-statuses");h(this,"actions",{addOne:Bd,addMany:Vd,setOne:zd,setMany:Dd,updateOne:jd,updateMany:qd,deleteOne:Cd,deleteMany:$d,initialize:Ed});h(this,"selectors",{selectById:Ld,selectByIds:kd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class iM extends j{constructor(){super(...arguments);h(this,"name","Document Attachment");h(this,"url","/document-attachments");h(this,"actions",{addOne:Zd,addMany:Jd,setOne:Xd,setMany:Qd,updateOne:xd,updateMany:eu,deleteOne:tu,deleteMany:su,initialize:Yd});h(this,"selectors",{selectById:nu,selectByIds:cu})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[c,r,a]=await super.bulkAdd(e,n),u={};for(const{file_sha1:d,uuid:p}of c)d in u||(u[d]=[]),u[d].push(p);return a.then(d=>{const p=d.flatMap(m=>u[m]??[]);for(const m of p)this.makeReadable(m)}),[c,r,a]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:o.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:c}=this.actions,r=this.list({queryParams:{document__project__organization:e}},n),a=this.list({queryParams:{document__organization:e}},n),d=(await Promise.all([r,a])).flat();return this.dispatch(c(d)),d}}class nM extends E{constructor(){super(...arguments);h(this,"name","Document");h(this,"url","/documents");h(this,"actions",{addOne:uu,addMany:lu,setOne:ou,setMany:hu,updateOne:mu,updateMany:pu,deleteOne:yu,deleteMany:fu,initialize:du});h(this,"selectors",{selectById:Au,selectByIds:Iu})}add(e){const{addOne:n,deleteOne:c,updateOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:d.parent_document?[d.parent_document]:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(d.uuid))}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c,addMany:r,deleteMany:a}=this.actions,{selectById:u}=this.selectors,d=this.select(u(e));if(!d)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const p=this.select(Tu(e));this.dispatch(n(e)),this.dispatch(a(w(p)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(d)),this.dispatch(r(p)),m}}async refreshStore(e,n){const{initialize:c}=this.actions,r=this.list({queryParams:{project__organization:e}},n),a=this.list({queryParams:{organization:e}},n),d=(await Promise.all([r,a])).flat();return this.dispatch(c(d)),d}}class yt extends pt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:o.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:o.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:o.GET,...s},e)}}class cM extends yt{constructor(){super(...arguments);h(this,"name","Email Domains");h(this,"url","/organization-email-domains");h(this,"actions",{addOne:Fu,addMany:bu,setOne:_u,setMany:gu,updateOne:Mu,updateMany:Ru,deleteOne:wu,deleteMany:vu,initialize:Pu});h(this,"selectors",{selectById:Bu,selectByIds:Vu})}async add(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:c}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(r){throw this.dispatch(c(e)),r}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class aM extends pt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:o.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:o.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const jt={},dc=new Set;class rM extends pt{constructor(){super(...arguments);h(this,"host");h(this,"dbPromise",ab.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await qt(e);if(dc.has(n))return;const c=await this.getDB();!!await c.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await c.put("files",e,n),dc.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),dc.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,c=n){const r=e.split("?")[0]??e,a=await this.fetchCache(n);if(a)return a;let u;r in jt?u=jt[r]:wc(e)?(u=Rc(e,c),jt[r]=u):(u=new Promise(m=>{this.performRequest({method:o.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(f=>{const I=new File([f],c,{type:f.type});m(I)})}),jt[r]=u);let d;try{d=await u}catch(m){throw m instanceof U&&delete jt[r],m}const p=await qt(d);if(p!==n){const m=`The hash of the file returned from the server (${p}) does not match the
|
|
8
|
+
expected hash (${n}). This can happen if you're using a local development server and the
|
|
10
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
11
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
12
|
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=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const y=c??h+"."+p;if(o=Tn(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),xt[n]=new Promise(f=>{f(o)})}return o}}class mF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Qi(n));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(n),blockers:[n.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(yt(m))}).catch(()=>{this.dispatch(xi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ea(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(yt(c));const n=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(yt(r))}).catch(()=>{this.dispatch(yt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ea(e)(a);if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(xi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Qi(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(So(a)),a}}class pF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(sa(n));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(n),blockers:[e.form_submission,e.form_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(At(m))}).catch(()=>{this.dispatch(ia(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ca(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(At(c));const n=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(At(r))}).catch(()=>{this.dispatch(At(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ca(e)(a);if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(ia(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(sa(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fo(c)),c}}class yF extends j{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 o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:h};r.push(b)}this.dispatch(vo(n));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wo(o.attachments))}).catch(()=>{this.dispatch(Mo(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Ro(a)),a}}class AF extends j{add(e){var u;const{store:i}=this.client,c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=F({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(da(n));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Do(m))}).catch(()=>{this.dispatch(ua(n.uuid))}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(qo(a)),a}}class fF extends j{add(e,i){var o;const{store:a}=this.client,c=new Date().toISOString(),n=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=F({...e,submitted_at:c,created_by:n}),u=F({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(ma(r)),this.dispatch(da(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(pa(r.uuid)),this.dispatch(ua(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ho(e)(a);if(!c)throw new Error("Expected form to exist");const n=al(e)(a);n.length>0&&this.dispatch(il(n.map(({uuid:u})=>u)));const r=Co(e)(a);r.length>0&&this.dispatch(Uo(r.map(({uuid:u})=>u))),this.dispatch(pa(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(ma(c)),r.length>0&&this.dispatch(zo(r)),n.length>0&&this.dispatch(tl(n)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch($o(a)),a}}class SF extends j{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 o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:h};r.push(b)}this.dispatch(Lt(n));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_submission),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Yo(o.attachments))}).catch(o=>{throw this.dispatch(Nt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Jo(e)(a);this.dispatch(Nt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(Lt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:Le,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ko(c)),c}}class TF extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...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:l.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision],blocks:[c.uuid]});return this.dispatch(Sa(c)),n.then(u=>(this.dispatch(Ht(u)),u)).catch(()=>{this.dispatch(Ta(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ia(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(sl(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(u=>{this.dispatch(Ht(u))}).catch(()=>{this.dispatch(Ht(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ia(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Xo(e)(a);this.dispatch(Ta(e)),this.dispatch(Nt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Sa(c)),this.dispatch(Lt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(el(c)),c}}class gF extends j{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,u=c.project,m=await this.getFilePayload(a),o=F({...c,file_name:a.name,file_sha1:m.sha1,file_type:a.type,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch(ul(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:n,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(ft(y.geo_image))}).catch(()=>{this.dispatch(Fa(o.uuid))}),[o,h.then(y=>y.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=[],u=[],m=[],o={};for(const y of e){const{file:f,...I}=y,b=await this.getFilePayload(f);b.sha1 in o||(o[b.sha1]=b);const R=F({...I,file_name:f.name,file_sha1:b.sha1,file_type:f.type,file:URL.createObjectURL(f),submitted_at:c,created_by:n,project:i});r.push(R),u.push(R.uuid),m.push({uuid:R.uuid,sha1:R.file_sha1,file_name:R.file_name,title:R.title,description:R.description,geo_marker:R.geo_marker,canvas_marker:R.canvas_marker,direction:R.direction,original_date:R.original_date})}this.dispatch(ol(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(dl(y.geo_images))}).catch(()=>{this.dispatch(hl(u))}),[r,h.then(y=>y.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Pa(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(ll(n));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Pa(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Fa(e));const n=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(ft(c))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(rl(a)),a}}class IF extends O{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=F({...e,submitted_at:a,created_by:c});this.dispatch(Oa(n));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Sl(m))}).catch(()=>{this.dispatch(va(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=Tl(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(va(e));const c=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Oa(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:this.pageSize,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(fl(c)),c}}class bF extends We{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Ea);S(this,"addAttachments",ja);S(this,"updateAttachments",Ol);S(this,"removeAttachments",Va);S(this,"removeAttachment",Rl);S(this,"setAttachment",_l);S(this,"selectAttachment",El)}getId(i){return i.uuid}buildModel(i){return F({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,issue:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue:i.issue}}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:l.GET,url:`${this.url}/`,queryParams:{limit:Le,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ea(n)),n}}class FF extends We{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",za);S(this,"addAttachments",ql);S(this,"updateAttachments",Dl);S(this,"removeAttachments",Cl);S(this,"removeAttachment",Ul);S(this,"setAttachment",zl);S(this,"selectAttachment",$l)}getId(i){return i.uuid}buildModel(i){return F({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,issue_comment:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_comment:i.issue_comment}}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:l.GET,url:`${this.url}/`,queryParams:{limit:Le,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(za(n)),n}}class PF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(Ua(a));const c=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(ka(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=Ba(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(Ca(c));const n=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(Ca(a))}),[c,n]}remove(e){const{store:i}=this.client,a=Ba(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(ka(e));const c=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ua(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(Nl(a)),a}}class _F extends O{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=F({...e,submitted_at:c,created_by:n});this.dispatch(Ga(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Wt(o))}).catch(o=>{throw this.dispatch(La(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=Wa(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(Wt(c));const n={};for(const o of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case E.PRIORITY:case E.STATUS:{const h=e[o];n[o]=h!==void 0?Number(h):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:n[o]=e[o]??null;break;case E.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case E.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=F({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(Qh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Wt(a)),this.dispatch(em(r.uuid))}),[c,u]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Wa(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=Ml(e)(a),r=am(e)(a),u={};for(const o of gl(e)(a))u[o.uuid]=o;for(const o of Il(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(La(e)),n.length>0&&this.dispatch(Va(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(tm(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(wa(m.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(Ga(c)),this.dispatch(ja(n)),this.dispatch(xh(r)),this.dispatch(Ra(m)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Yl(c)),c}}class OF extends We{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ya);S(this,"addAttachments",eh);S(this,"updateAttachments",sh);S(this,"removeAttachments",ah);S(this,"removeAttachment",ih);S(this,"setAttachment",th);S(this,"selectAttachment",rh)}getId(i){return i.uuid}buildModel(i){return F({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,issue_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_type:i.issue_type}}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:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ya(c)),c}}class RF extends j{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 o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(lh(n));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(hh(o.attachments))}).catch(()=>{this.dispatch(mh(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(oh(a)),a}}class vF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Fh(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Ph(m))}).catch(m=>{throw this.dispatch(_h(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(bh(a)),a}}class wF extends j{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 o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:h};r.push(b)}this.dispatch(Yt(n));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.field_values),blocks:n.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(Mh(h))}).catch(o=>{throw this.dispatch(Zt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=jh(e)(a);this.dispatch(Zt(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(Yt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wh(c)),c}}class MF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...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:l.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(Xa(c)),n.then(u=>(this.dispatch(Tt(u)),u)).catch(()=>{this.dispatch(Qa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=ec(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Tt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(u=>{this.dispatch(Tt(u))}).catch(()=>{this.dispatch(Tt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ec(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Vh(e)(a);this.dispatch(Qa(e)),this.dispatch(Zt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Xa(c)),this.dispatch(Yt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Sh(c)),c}}class EF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(cc(n));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(gt(m))}).catch(()=>{this.dispatch(nc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=rc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(gt(c));const n=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=rc(e)(a);if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(nc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(cc(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Dh(a)),a}}class jF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(uc(n));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(n),blockers:[e.issue,e.issue_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(It(m))}).catch(()=>{this.dispatch(oc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=hc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(It(c));const n=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.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=hc(e)(a);if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(oc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(uc(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch($h(c)),c}}class VF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Wh(c));const n=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(u=>{this.dispatch(bt(u))}).catch(()=>{this.dispatch(pc(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ac(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(Kh(n));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(bt(u))}).catch(()=>{this.dispatch(bt(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=Ac(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Xl(e)(a);this.dispatch(pc(e)),this.dispatch(Jl(n.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(bt(c)),this.dispatch(Zl(n))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hh(a)),a}}class qF extends O{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Xh(c)),c}}const zF=1800;function DF(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 UF extends qb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.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(zu(!1)),this.clearTokens(),this.dispatch(g()),this.dispatch(g())}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=dy(i).exp??a}catch{c=a}return c-a<zF}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??et).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=Xe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(DF(c))})}}class CF extends O{update(e){const{store:i}=this.client,a=bc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Xt(c));const n=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Xt(r))}).catch(r=>{throw this.dispatch(Xt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=bc(e)(a),n=hm(c.user)(a);this.dispatch(Am(c.uuid)),this.dispatch(um(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(ym(c)),this.dispatch(dm(n)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(pm(a)),a}}class kF extends O{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(Im(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(bm(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(gm(i)),i}}class BF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Oc(a));const c=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(vc(a.uuid)),r}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Rc(c));const n=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:c.map(u=>v(u))},blockers:c.flatMap(u=>[u.project,u.organization_access]),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Vm(u))}).catch(u=>{throw this.dispatch(wc(c.map(m=>m.uuid))),u}),[c,n]}update(e){const{store:i}=this.client,a=Ec(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Ft(c));const n=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(Ft(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=Ec(e)(i.getState());this.dispatch(vc(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Oc(a)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(jm(a)),a}}class $F extends We{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"initializeAttachments",Vc);S(this,"addAttachments",Um);S(this,"updateAttachments",Bm);S(this,"removeAttachments",qc);S(this,"removeAttachment",$m);S(this,"setAttachment",Cm);S(this,"selectAttachment",Nm)}getId(i){return i.uuid}buildModel(i){return F({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,project:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,project:i.project}}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:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(Vc(c)),c}}class GF extends O{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:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(c=>{this.dispatch(Dc(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:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,o)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...c,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(n).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(Dc(m))}),this.dispatch(ep),this.dispatch(xm(null)),this.dispatch(Qm(!1)),[c,u]}delete(e){return this.dispatch(Jm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ym(c)),c}}class LF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Cc(n));const r=this.enqueueRequest({description:"Create project folder",method:l.POST,url:"/project-folders/",payload:v(n),blockers:[e.project],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Pt(m))}).catch(m=>{throw this.dispatch(kc(n.uuid)),m}),[n,r]}update(e){const i=this.client.store.getState(),a=$c(e.uuid)(i);if(!a)throw new Error(`Expected an existing project folder with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(Pt(c));const n=this.enqueueRequest({description:"Edit project folder",method:l.PATCH,url:`/project-folders/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Pt(a))}),[c,n]}remove(e){const{store:i}=this.client,a=$c(e)(i.getState());if(!a)throw new Error(`No project folder with uuid ${e} found in the store`);this.dispatch(kc(e));const c=this.enqueueRequest({description:"Delete project folder",method:l.DELETE,url:`/project-folders/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch(Cc(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project folders",method:l.GET,url:"/project-folders/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(cp(a)),a}}class NF extends O{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(Lc(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(op(e)),await this.enqueueRequest({description:"Update project",method:l.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=mp(e)(a);if(!c)throw new Error("Expected project to exist");const n=sp(a).filter(m=>m.project===e);this.dispatch(Xm(n.map(({uuid:m})=>m)));const r=Hm(c.uuid)(a);this.dispatch(qc(r.map(({uuid:m})=>m)));const u=zm(e)(a);this.dispatch(wc(u.map(({uuid:m})=>m))),this.dispatch(Nc(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Nc(c.uuid))}catch(m){throw this.dispatch(Lc(c)),this.dispatch(Rc(Object.values(u))),this.dispatch(Zm(n)),this.dispatch(km(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(up(a)),a}}class HF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(fp(a));const c=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Yc(r))}).catch(()=>{this.dispatch(Zc(a.uuid))}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Sp(c));const n=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:c.map(u=>v(u))},blockers:c.map(u=>u.team),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Tp(u))}).catch(()=>{this.dispatch(gp(c.map(u=>u.uuid)))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Fp(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Zc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Yc(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Ap(a)),a}}class WF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Op(a));const c=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(_t(r))}).catch(()=>{this.dispatch(Qc(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=en(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Rp(c));const n=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(_t(r))}).catch(()=>{this.dispatch(_t(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=en(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Qc(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(_t(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(_p(a)),a}}class KF extends O{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(rm(a)),a}}class YF{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 fn,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Xe.v4()},m={payload:u,meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};sn(m,this,c).then(o=>{n.resolve(o.body)}).catch(o=>{o instanceof Error?n.reject(o):n.reject(new Error((o??et).toString()))})}else{const u=this.store.dispatch(Rm(r)),m=h=>{if(h)n.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});n.reject(p)}},o=h=>{h instanceof D?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
15
|
-
Converting error to APIError and discarding.`),h=new D({message:"An error occurred while processing the request.",innerError:h,discard:!0})),n.reject(h)};u.then(m,o)}return n}}class tt{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new uy.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new tt;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(u=>c.payload.blockers.includes(u))&&tt._addDependency(c.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){tt._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}}let Hp;function Wp(t){Hp=t}function st(){return Hp}let Kp;function Yp(t){Kp=t}function Zp(){return Kp}let rn=null;function Ze(){const t=st();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(rn)return rn;const e=t.getState().offline.outbox,i=tt._fromOutbox(e);return rn=i,i}const ZF=(t,e)=>{const i=new e(t);return Yp(i),Wp(t),i};class JF{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 dn{constructor(){S(this,"next");this.next=null}then(e){return new JF(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!st())throw new Error("Client store not set");const a=Zp();if(!a)throw new Error("Client SDK not set");return sn(e,a)}}}class Jp extends dn{async run(e){return super.run(e)}}class Xp extends dn{async run(e){return super.run(e)}}const Qp=new Jp().then(new Xp).compile();function xp(t){var e;return(e=Qp[0])==null?void 0:e.run(t)}var ey=(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))(ey||{});s.ALL_MIDDLEWARE=Qp,s.APIError=D,s.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=Le,s.AgentService=zb,s.AssetAttachmentService=Db,s.AssetProcedureService=Gb,s.AssetProcedureStepFieldValuesAttachmentService=Wb,s.AssetProcedureStepFieldValuesService=Kb,s.AssetProcedureStepFieldsAttachmentService=Nb,s.AssetProcedureStepFieldsService=Hb,s.AssetProcedureStepService=Yb,s.AssetProcedureTypeAttachmentService=Ub,s.AssetProcedureTypeFieldValuesAttachmentService=Bb,s.AssetProcedureTypeFieldValuesService=$b,s.AssetProcedureTypeFieldsAttachmentService=Cb,s.AssetProcedureTypeFieldsService=kb,s.AssetProcedureTypeService=Lb,s.AssetService=Zb,s.AssetStageCompletionService=Jb,s.AssetStageService=Xb,s.AssetTypeAttachmentService=Qb,s.AssetTypeFieldValuesAttachmentService=tF,s.AssetTypeFieldValuesService=sF,s.AssetTypeFieldsAttachmentService=xb,s.AssetTypeFieldsService=eF,s.AssetTypeIdentifierService=iF,s.AssetTypeIdentifierValueService=aF,s.AssetTypeService=cF,s.AttachmentModel=yn,s.BaseApiService=O,s.BaseSDK=YF,s.COMMON_AUTO_FIELDS=bn,s.CategoryService=nF,s.DEFAULT_ISSUE_PRIORITY=ly,s.DEFAULT_ISSUE_STATUS=oy,s.DEFAULT_PAGE_SIZE=Vp,s.DeferredPromise=fn,s.DocumentAttachmentService=rF,s.DocumentService=dF,s.EMPTY_ARRAY=ln,s.EMPTY_OBJECT=hn,s.EMPTY_SET=mn,s.EmailDomainsService=uF,s.EmailVerificationService=oF,s.FileService=hF,s.FormIdentifierService=mF,s.FormIdentifierValueService=pF,s.FormRevisionAttachmentService=yF,s.FormRevisionService=AF,s.FormService=fF,s.FormSubmissionAttachmentService=SF,s.FormSubmissionService=TF,s.GeoImageService=gF,s.HttpMethod=l,s.IssueAssociationService=IF,s.IssueAttachmentService=bF,s.IssueCommentAttachmentService=FF,s.IssueCommentService=PF,s.IssuePriority=ts,s.IssueService=_F,s.IssueStatus=ss,s.IssueTypeAttachmentService=OF,s.IssueTypeFieldValuesAttachmentService=wF,s.IssueTypeFieldValuesService=MF,s.IssueTypeFieldsAttachmentService=RF,s.IssueTypeFieldsService=vF,s.IssueTypeIdentifierService=EF,s.IssueTypeIdentifierValueService=jF,s.IssueTypeService=VF,s.IssueUpdateChange=E,s.IssueUpdateService=qF,s.JWTService=UF,s.OUTBOX_RETRY_DELAY=An,s.OfflineAnalyticsMiddleware=Jp,s.OfflineMiddleware=dn,s.OrganizationAccessLevel=pn,s.OrganizationAccessService=CF,s.OrganizationService=kF,s.OutboxCoordinator=tt,s.ProjectAccessService=BF,s.ProjectAttachmentService=$F,s.ProjectFileService=GF,s.ProjectFolderService=LF,s.ProjectService=NF,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.RateLimitingMiddleware=Xp,s.SelectorBuilder=gb,s.TeamMembershipService=HF,s.TeamService=WF,s.UNKNOWN_ERROR_MESSAGE=et,s.UserService=KF,s.VERSION_REDUCER_KEY=it,s.VerificationCodeType=ey,s._setLatestRetryTime=wm,s.addAsset=Xs,s.addAssetAttachment=Ly,s.addAssetAttachments=ls,s.addAssetProcedure=Os,s.addAssetProcedureStep=md,s.addAssetProcedureStepFieldValues=Hs,s.addAssetProcedureStepFieldValuesAttachment=ZA,s.addAssetProcedureStepFieldValuesAttachments=Et,s.addAssetProcedureStepFieldValuesMany=cd,s.addAssetProcedureStepFields=Cs,s.addAssetProcedureStepFieldsAttachment=VA,s.addAssetProcedureStepFieldsAttachments=$r,s.addAssetProcedureStepFieldsMany=BA,s.addAssetProcedureSteps=pd,s.addAssetProcedureType=js,s.addAssetProcedureTypeAttachment=Wy,s.addAssetProcedureTypeAttachments=Hn,s.addAssetProcedureTypeFieldValues=Is,s.addAssetProcedureTypeFieldValuesAttachment=lA,s.addAssetProcedureTypeFieldValuesAttachments=wt,s.addAssetProcedureTypeFieldValuesMany=Pr,s.addAssetProcedureTypeFields=or,s.addAssetProcedureTypeFieldsAttachment=Jy,s.addAssetProcedureTypeFieldsAttachments=sr,s.addAssetProcedureTypeFieldsMany=iA,s.addAssetProcedureTypes=OA,s.addAssetProcedures=Er,s.addAssetStage=oi,s.addAssetStageCompletion=ai,s.addAssetStageCompletions=ci,s.addAssetStages=gf,s.addAssetType=Di,s.addAssetTypeAttachment=Of,s.addAssetTypeAttachments=yi,s.addAssetTypeFieldValues=bi,s.addAssetTypeFieldValuesAttachment=Nf,s.addAssetTypeFieldValuesAttachments=kt,s.addAssetTypeFieldValuesMany=Au,s.addAssetTypeFields=su,s.addAssetTypeFieldsAttachment=wf,s.addAssetTypeFieldsAttachments=Yd,s.addAssetTypeFieldsMany=Df,s.addAssetTypeIdentifier=Ri,s.addAssetTypeIdentifierValue=Ei,s.addAssetTypeIdentifierValues=nS,s.addAssetTypeIdentifiers=eS,s.addAssetTypes=yS,s.addAssets=zt,s.addCategories=PS,s.addCategory=$i,s.addConversation=En,s.addConversations=Dy,s.addDocumentAttachment=ES,s.addDocumentAttachments=Nu,s.addDocuments=to,s.addEmailDomain=no,s.addEmailDomains=CS,s.addForm=ma,s.addFormIdentifier=Qi,s.addFormIdentifierValue=sa,s.addFormIdentifierValues=QS,s.addFormIdentifiers=WS,s.addFormRevision=da,s.addFormRevisionAttachment=cT,s.addFormRevisionAttachments=vo,s.addFormRevisions=zo,s.addFormSubmission=Sa,s.addFormSubmissionAttachment=FT,s.addFormSubmissionAttachments=Lt,s.addFormSubmissions=tl,s.addForms=AT,s.addGeoImage=ul,s.addGeoImages=ol,s.addIssue=Ga,s.addIssueAssociation=Oa,s.addIssueAssociations=Ra,s.addIssueAttachment=UT,s.addIssueAttachments=ja,s.addIssueComment=Ua,s.addIssueCommentAttachment=BT,s.addIssueCommentAttachments=ql,s.addIssueComments=HT,s.addIssueType=Wh,s.addIssueTypeAttachment=tg,s.addIssueTypeAttachments=eh,s.addIssueTypeFieldValues=Xa,s.addIssueTypeFieldValuesAttachment=Rg,s.addIssueTypeFieldValuesAttachments=Yt,s.addIssueTypeFieldValuesMany=hg,s.addIssueTypeFields=Fh,s.addIssueTypeFieldsAttachment=cg,s.addIssueTypeFieldsAttachments=lh,s.addIssueTypeFieldsMany=Sg,s.addIssueTypeIdentifier=cc,s.addIssueTypeIdentifierValue=uc,s.addIssueTypeIdentifierValues=kg,s.addIssueTypeIdentifiers=Vg,s.addIssueTypes=Wg,s.addIssueUpdate=Qh,s.addIssueUpdates=xh,s.addIssues=Zl,s.addOrganization=Im,s.addOrganizationAccess=ym,s.addOrganizationAccesses=hI,s.addOrganizations=II,s.addProject=Lc,s.addProjectAccess=Oc,s.addProjectAccesses=Rc,s.addProjectAttachment=qI,s.addProjectAttachments=Um,s.addProjectFile=CI,s.addProjectFiles=Zm,s.addProjectFolder=Cc,s.addProjectFolders=LI,s.addProjects=QI,s.addTeam=Op,s.addTeamMembership=fp,s.addTeamMemberships=Sp,s.addTeams=ob,s.addUser=dm,s.addUsers=cI,s.agentsReducer=qn,s.agentsSlice=rs,s.areArraysEqual=py,s.assetAttachmentReducer=Ln,s.assetAttachmentSlice=us,s.assetProcedureReducer=Vr,s.assetProcedureSlice=_s,s.assetProcedureStepFieldValuesAttachmentReducer=sd,s.assetProcedureStepFieldValuesAttachmentSlice=Gs,s.assetProcedureStepFieldValuesReducer=ud,s.assetProcedureStepFieldValuesSlice=Ns,s.assetProcedureStepFieldsAttachmentReducer=Wr,s.assetProcedureStepFieldsAttachmentSlice=Ds,s.assetProcedureStepFieldsReducer=Zr,s.assetProcedureStepFieldsSlice=Us,s.assetProcedureStepReducer=fd,s.assetProcedureStepSlice=Ys,s.assetProcedureTypeAttachmentReducer=Jn,s.assetProcedureTypeAttachmentSlice=ms,s.assetProcedureTypeFieldValuesAttachmentReducer=Sr,s.assetProcedureTypeFieldValuesAttachmentSlice=Ss,s.assetProcedureTypeFieldValuesReducer=Rr,s.assetProcedureTypeFieldValuesSlice=gs,s.assetProcedureTypeFieldsAttachmentReducer=cr,s.assetProcedureTypeFieldsAttachmentSlice=ys,s.assetProcedureTypeFieldsReducer=mr,s.assetProcedureTypeFieldsSlice=As,s.assetProcedureTypeReducer=Ur,s.assetProcedureTypeSlice=Es,s.assetReducer=Pd,s.assetSlice=Js,s.assetStageCompletionReducer=wd,s.assetStageCompletionSlice=ii,s.assetStageReducer=zd,s.assetStageSlice=ui,s.assetTypeAttachmentReducer=Hd,s.assetTypeAttachmentSlice=mi,s.assetTypeFieldValuesAttachmentReducer=mu,s.assetTypeFieldValuesAttachmentSlice=Ti,s.assetTypeFieldValuesReducer=gu,s.assetTypeFieldValuesSlice=Ii,s.assetTypeFieldsAttachmentReducer=xd,s.assetTypeFieldsAttachmentSlice=fi,s.assetTypeFieldsReducer=nu,s.assetTypeFieldsSlice=Si,s.assetTypeIdentifierReducer=_u,s.assetTypeIdentifierSlice=Oi,s.assetTypeIdentifierValueReducer=wu,s.assetTypeIdentifierValueSlice=Mi,s.assetTypeReducer=Vu,s.assetTypeSlice=zi,s.authReducer=Du,s.authSlice=$t,s.baseReducer=fb,s.baseReducers=tn,s.blobToBase64=Py,s.categoryReducer=Gu,s.categorySlice=Bi,s.clearTokens=IS,s.constructUploadedFilePayloads=Fy,s.createModelAdapter=P,s.createOfflineAction=_m,s.createPayload=v,s.createSelectionAdapter=hy,s.deleteAsset=Qs,s.deleteAssetAttachment=Cn,s.deleteAssetAttachments=hs,s.deleteAssetProcedure=Rs,s.deleteAssetProcedureStep=yd,s.deleteAssetProcedureStepFieldValues=Ws,s.deleteAssetProcedureStepFieldValuesAttachment=xA,s.deleteAssetProcedureStepFieldValuesAttachments=jt,s.deleteAssetProcedureStepFieldValuesMany=rd,s.deleteAssetProcedureStepFields=ks,s.deleteAssetProcedureStepFieldsAttachment=UA,s.deleteAssetProcedureStepFieldsAttachments=Lr,s.deleteAssetProcedureStepFieldsMany=NA,s.deleteAssetProcedureSteps=Ad,s.deleteAssetProcedureType=Vs,s.deleteAssetProcedureTypeAttachment=Yn,s.deleteAssetProcedureTypeAttachments=Zn,s.deleteAssetProcedureTypeFieldValues=bs,s.deleteAssetProcedureTypeFieldValuesAttachment=yA,s.deleteAssetProcedureTypeFieldValuesAttachments=Mt,s.deleteAssetProcedureTypeFieldValuesMany=Or,s.deleteAssetProcedureTypeFields=hr,s.deleteAssetProcedureTypeFieldsAttachment=eA,s.deleteAssetProcedureTypeFieldsAttachments=ar,s.deleteAssetProcedureTypeFieldsMany=rA,s.deleteAssetProcedureTypes=vA,s.deleteAssetProcedures=jr,s.deleteAssetStage=li,s.deleteAssetStageCompletion=ni,s.deleteAssetStageCompletions=ri,s.deleteAssetStages=bf,s.deleteAssetType=Ui,s.deleteAssetTypeAttachment=Bd,s.deleteAssetTypeAttachments=Ai,s.deleteAssetTypeFieldValues=Fi,s.deleteAssetTypeFieldValuesAttachment=Yf,s.deleteAssetTypeFieldValuesAttachments=Bt,s.deleteAssetTypeFieldValuesMany=Su,s.deleteAssetTypeFields=au,s.deleteAssetTypeFieldsAttachment=Vf,s.deleteAssetTypeFieldsAttachments=Jd,s.deleteAssetTypeFieldsMany=Bf,s.deleteAssetTypeIdentifier=vi,s.deleteAssetTypeIdentifierValue=ji,s.deleteAssetTypeIdentifierValues=oS,s.deleteAssetTypeIdentifiers=aS,s.deleteAssetTypes=fS,s.deleteAssets=xs,s.deleteCategories=vS,s.deleteCategory=Bu,s.deleteConversation=ky,s.deleteConversations=By,s.deleteDocumentAttachment=Ku,s.deleteDocumentAttachments=Yu,s.deleteEmailDomain=ro,s.deleteEmailDomains=LS,s.deleteForm=pa,s.deleteFormIdentifier=xi,s.deleteFormIdentifierValue=ia,s.deleteFormIdentifierValues=sT,s.deleteFormIdentifiers=JS,s.deleteFormRevision=ua,s.deleteFormRevisionAttachment=uT,s.deleteFormRevisionAttachments=Mo,s.deleteFormRevisions=Uo,s.deleteFormSubmission=Ta,s.deleteFormSubmissionAttachment=RT,s.deleteFormSubmissionAttachments=Nt,s.deleteFormSubmissions=il,s.deleteForms=IT,s.deleteGeoImage=Fa,s.deleteGeoImages=hl,s.deleteIssue=La,s.deleteIssueAssociation=va,s.deleteIssueAssociations=wa,s.deleteIssueAttachment=Rl,s.deleteIssueAttachments=Va,s.deleteIssueComment=ka,s.deleteIssueCommentAttachment=Ul,s.deleteIssueCommentAttachments=Cl,s.deleteIssueComments=YT,s.deleteIssueType=Zg,s.deleteIssueTypeAttachment=ih,s.deleteIssueTypeAttachments=ah,s.deleteIssueTypeFieldValues=Qa,s.deleteIssueTypeFieldValuesAttachment=Eg,s.deleteIssueTypeFieldValuesAttachments=Zt,s.deleteIssueTypeFieldValuesMany=Ag,s.deleteIssueTypeFields=_h,s.deleteIssueTypeFieldsAttachment=ug,s.deleteIssueTypeFieldsAttachments=mh,s.deleteIssueTypeFieldsMany=bg,s.deleteIssueTypeIdentifier=nc,s.deleteIssueTypeIdentifierValue=oc,s.deleteIssueTypeIdentifierValues=Lg,s.deleteIssueTypeIdentifiers=Ug,s.deleteIssueTypes=Jg,s.deleteIssueUpdate=em,s.deleteIssueUpdates=tm,s.deleteIssues=Jl,s.deleteOrganization=FI,s.deleteOrganizationAccess=Am,s.deleteOrganizationAccesses=AI,s.deleteOrganizations=PI,s.deleteProject=Nc,s.deleteProjectAccess=vc,s.deleteProjectAccesses=wc,s.deleteProjectAttachment=$m,s.deleteProjectAttachments=qc,s.deleteProjectFile=Jm,s.deleteProjectFiles=Xm,s.deleteProjectFolder=kc,s.deleteProjectFolders=KI,s.deleteProjects=eb,s.deleteTeam=Qc,s.deleteTeamMembership=Zc,s.deleteTeamMemberships=gp,s.deleteTeams=mb,s.deleteUser=um,s.deleteUsers=dI,s.dequeue=$p,s.discard=Lp,s.documentAttachmentReducer=Qu,s.documentAttachmentSlice=Ni,s.documentSlice=Wi,s.documentsReducer=io,s.downloadFile=_y,s.downloadInMemoryFile=by,s.emailDomainsReducer=lo,s.emailDomainsSlice=Zi,s.emailRegex=jy,s.enqueue=Bp,s.enqueueRequest=Rm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=vt,s.fallbackToEmptySet=yy,s.fileReducer=Ao,s.fileSlice=Ji,s.fileToBlob=gn,s.formIdentifierReducer=Io,s.formIdentifierSlice=Xi,s.formIdentifierValueReducer=_o,s.formIdentifierValueSlice=ta,s.formReducer=Go,s.formRevisionAttachmentReducer=jo,s.formRevisionAttachmentSlice=na,s.formRevisionReducer=ko,s.formRevisionsSlice=ra,s.formSlice=ha,s.formSubmissionAttachmentReducer=Qo,s.formSubmissionAttachmentSlice=ya,s.formSubmissionReducer=cl,s.formSubmissionSlice=fa,s.geoImageReducer=yl,s.geoImageSlice=ba,s.getAssetProcedureStepSubTree=Rn,s.getAssetProcedureStepTrees=Vy,s.getClientSDK=Zp,s.getClientStore=st,s.getFileIdentifier=Iy,s.getFileS3Key=ns,s.getLocalDateString=Sn,s.getLocalRelativeDateString=Ty,s.getOutboxCoordinator=Ze,s.getProjectFolderSubTree=zy,s.getProjectFolderTrees=qy,s.getRenamedFile=Tn,s.hashFile=Qe,s.initSDK=ZF,s.initializeAssetAttachments=os,s.initializeAssetProcedureStepFieldValues=ad,s.initializeAssetProcedureStepFieldValuesAttachments=Xr,s.initializeAssetProcedureStepFields=Yr,s.initializeAssetProcedureStepFieldsAttachments=Br,s.initializeAssetProcedureSteps=ld,s.initializeAssetProcedureTypeAttachments=ps,s.initializeAssetProcedureTypeFieldValues=Fr,s.initializeAssetProcedureTypeFieldValuesAttachments=Ar,s.initializeAssetProcedureTypeFields=ur,s.initializeAssetProcedureTypeFieldsAttachments=tr,s.initializeAssetProcedureTypes=Dr,s.initializeAssetProcedures=Mr,s.initializeAssetStageCompletions=Od,s.initializeAssetStages=Vd,s.initializeAssetTypeAttachments=pi,s.initializeAssetTypeFieldValues=yu,s.initializeAssetTypeFieldValuesAttachments=du,s.initializeAssetTypeFields=tu,s.initializeAssetTypeFieldsAttachments=Kd,s.initializeAssetTypeIdentifierValues=Ru,s.initializeAssetTypeIdentifiers=bu,s.initializeAssetTypes=Eu,s.initializeAssets=Id,s.initializeCategories=Cu,s.initializeConversations=Mn,s.initializeDocumentAttachments=Hi,s.initializeEmailDomains=co,s.initializeFormIdentifierValues=Fo,s.initializeFormIdentifiers=So,s.initializeFormRevisionAttachments=Ro,s.initializeFormRevisions=qo,s.initializeFormSubmissionAttachments=Ko,s.initializeFormSubmissions=el,s.initializeForms=$o,s.initializeGeoImages=rl,s.initializeIssueAssociations=fl,s.initializeIssueAttachments=Ea,s.initializeIssueCommentAttachments=za,s.initializeIssueComments=NT,s.initializeIssueTypeAttachments=Ya,s.initializeIssueTypeFieldValues=Sh,s.initializeIssueTypeFieldValuesAttachments=wh,s.initializeIssueTypeFields=bh,s.initializeIssueTypeFieldsAttachments=oh,s.initializeIssueTypeIdentifierValues=$h,s.initializeIssueTypeIdentifiers=Dh,s.initializeIssueTypes=Hh,s.initializeIssueUpdates=Xh,s.initializeIssues=Yl,s.initializeOrganizationAccesses=pm,s.initializeOrganizations=gm,s.initializeProjectAccesses=jm,s.initializeProjectAttachments=Vc,s.initializeProjectFiles=Ym,s.initializeProjectFolders=cp,s.initializeProjects=up,s.initializeTeamMemberships=Ap,s.initializeTeams=_p,s.initializeUsers=rm,s.isToday=Sy,s.issueAssociationReducer=Fl,s.issueAssociationSlice=_a,s.issueAttachmentReducer=jl,s.issueAttachmentSlice=Ma,s.issueCommentAttachmentReducer=Gl,s.issueCommentAttachmentSlice=qa,s.issueCommentReducer=Wl,s.issueCommentSlice=Da,s.issueReducer=Ql,s.issueSlice=$a,s.issueTypeAttachmentReducer=dh,s.issueTypeAttachmentSlice=Ka,s.issueTypeFieldValuesAttachmentReducer=qh,s.issueTypeFieldValuesAttachmentSlice=sc,s.issueTypeFieldValuesReducer=gh,s.issueTypeFieldValuesSlice=Ja,s.issueTypeFieldsAttachmentReducer=Ah,s.issueTypeFieldsAttachmentSlice=Za,s.issueTypeFieldsReducer=Rh,s.issueTypeFieldsSlice=tc,s.issueTypeIdentifierReducer=kh,s.issueTypeIdentifierSlice=ac,s.issueTypeIdentifierValueReducer=Lh,s.issueTypeIdentifierValueSlice=dc,s.issueTypeReducer=Zh,s.issueTypeSlice=mc,s.issueUpdateReducer=cm,s.issueUpdateSlice=fc,s.logOnlyOnce=Oy,s.markAsDeleted=vm,s.markForDeletion=wI,s.memoize=as,s.onlyUniqueHashes=Ey,s.onlyUniqueOfflineIds=_n,s.organizationAccessReducer=fm,s.organizationAccessSlice=gc,s.organizationReducer=Pm,s.organizationSlice=Fc,s.outboxReducer=Mm,s.outboxSlice=Pc,s.overmapEnhancer=vb,s.overmapReducer=Sb,s.overmapReducers=jp,s.performRequest=sn,s.projectAccessReducer=qm,s.projectAccessSlice=_c,s.projectAttachmentReducer=Wm,s.projectAttachmentSlice=jc,s.projectFileReducer=ip,s.projectFileSlice=zc,s.projectFolderReducer=rp,s.projectFolderSlice=Uc,s.projectReducer=lp,s.projectSlice=Gc,s.rehydratedReducer=pp,s.rehydratedSlice=Wc,s.removeDocuments=Ki,s.removeIssueType=pc,s.restructureCreateSelectorWithArgs=A,s.runMiddleware=xp,s.saveActiveProjectFileBounds=ep,s.selectAccessToken=bS,s.selectAccessesByUserOfProject=jI,s.selectAccessibleProjects=tb,s.selectActiveOrganizationAccess=fI,s.selectActiveProjectFileId=$I,s.selectAllDocumentAttachments=Ju,s.selectAllProjectAttachments=Lm,s.selectAssetAttachmentById=$n,s.selectAssetAttachmentMapping=kn,s.selectAssetAttachments=Bn,s.selectAssetById=si,s.selectAssetProcedureById=Ms,s.selectAssetProcedureStepById=Zs,s.selectAssetProcedureStepFieldValues=Vt,s.selectAssetProcedureStepFieldValuesAttachmentById=ef,s.selectAssetProcedureStepFieldValuesAttachments=xr,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=ed,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Ls,s.selectAssetProcedureStepFieldValuesById=Ks,s.selectAssetProcedureStepFieldValuesMapping=dd,s.selectAssetProcedureStepFieldValuesOfAsset=af,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=cf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=nf,s.selectAssetProcedureStepFields=$s,s.selectAssetProcedureStepFieldsAttachmentById=kA,s.selectAssetProcedureStepFieldsAttachments=Hr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Nr,s.selectAssetProcedureStepFieldsById=YA,s.selectAssetProcedureStepFieldsMapping=Bs,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=HA,s.selectAssetProcedureStepMapping=ut,s.selectAssetProcedureSteps=Sd,s.selectAssetProcedureStepsByIds=lf,s.selectAssetProcedureStepsMappingOfAssetProcedureType=uf,s.selectAssetProcedureStepsOfAssetProcedureType=of,s.selectAssetProcedureTypeAttachmentById=xn,s.selectAssetProcedureTypeAttachmentMapping=Xn,s.selectAssetProcedureTypeAttachments=Qn,s.selectAssetProcedureTypeById=zs,s.selectAssetProcedureTypeFieldValues=Fs,s.selectAssetProcedureTypeFieldValuesAttachmentById=AA,s.selectAssetProcedureTypeFieldValuesAttachments=Tr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=gr,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ts,s.selectAssetProcedureTypeFieldValuesById=Ps,s.selectAssetProcedureTypeFieldValuesMapping=vr,s.selectAssetProcedureTypeFieldValuesOfAsset=TA,s.selectAssetProcedureTypeFields=fs,s.selectAssetProcedureTypeFieldsAttachmentById=sA,s.selectAssetProcedureTypeFieldsAttachments=rr,s.selectAssetProcedureTypeFieldsAttachmentsMapping=nr,s.selectAssetProcedureTypeFieldsById=oA,s.selectAssetProcedureTypeFieldsMapping=pr,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=dA,s.selectAssetProcedureTypes=Cr,s.selectAssetProcedureTypesByIds=EA,s.selectAssetProcedureTypesMapping=qs,s.selectAssetProcedureTypesOfOrganization=jA,s.selectAssetProcedures=ws,s.selectAssetProceduresByIds=_A,s.selectAssetProceduresMapping=vs,s.selectAssetProceduresOfAssetProcedureType=qr,s.selectAssetProceduresOfAssetType=PA,s.selectAssetStageById=hi,s.selectAssetStageCompletionById=Md,s.selectAssetStageCompletionMapping=di,s.selectAssetStageCompletions=Sf,s.selectAssetStageCompletionsByIds=Ed,s.selectAssetStages=Dd,s.selectAssetStagesByIds=_f,s.selectAssetStagesMappingOfAssetProcedureType=Ff,s.selectAssetStagesOfAssetProcedureType=Pf,s.selectAssetTypeAttachmentById=Ld,s.selectAssetTypeAttachmentMapping=$d,s.selectAssetTypeAttachments=Gd,s.selectAssetTypeById=ki,s.selectAssetTypeFieldValues=Pi,s.selectAssetTypeFieldValuesAttachmentById=Zf,s.selectAssetTypeFieldValuesAttachments=ou,s.selectAssetTypeFieldValuesAttachmentsByIds=lu,s.selectAssetTypeFieldValuesAttachmentsMapping=gi,s.selectAssetTypeFieldValuesById=_i,s.selectAssetTypeFieldValuesMapping=Tu,s.selectAssetTypeFieldValuesOfAsset=Qf,s.selectAssetTypeFields=Ct,s.selectAssetTypeFieldsAttachmentById=zf,s.selectAssetTypeFieldsAttachments=Qd,s.selectAssetTypeFieldsAttachmentsMapping=Xd,s.selectAssetTypeFieldsById=Lf,s.selectAssetTypeFieldsMapping=cu,s.selectAssetTypeFieldsOfAssetType=$f,s.selectAssetTypeIdentifierById=wi,s.selectAssetTypeIdentifierMapping=Fu,s.selectAssetTypeIdentifierValueById=qi,s.selectAssetTypeIdentifierValueMapping=vu,s.selectAssetTypeIdentifierValues=Vi,s.selectAssetTypeIdentifierValuesOfAsset=lS,s.selectAssetTypeIdentifierValuesOfIdentifier=hS,s.selectAssetTypeIdentifiers=Pu,s.selectAssetTypeIdentifiersOfAssetType=cS,s.selectAssetTypeValuesOfAssetType=xf,s.selectAssetTypes=ju,s.selectAssetTypesByIds=SS,s.selectAssetTypesMapping=Ci,s.selectAssetTypesOfOrganization=TS,s.selectAssets=bd,s.selectAssetsByIds=Fd,s.selectAssetsMapping=ei,s.selectAssetsOfAssetType=ti,s.selectAttachmentsOfAsset=Gn,s.selectAttachmentsOfAssetProcedureStepFieldValues=td,s.selectAttachmentsOfAssetProcedureStepFields=CA,s.selectAttachmentsOfAssetProcedureType=Zy,s.selectAttachmentsOfAssetProcedureTypeFieldValues=Ir,s.selectAttachmentsOfAssetProcedureTypeFields=tA,s.selectAttachmentsOfAssetType=Nd,s.selectAttachmentsOfAssetTypeFieldValues=hu,s.selectAttachmentsOfAssetTypeFields=qf,s.selectAttachmentsOfDocument=qS,s.selectAttachmentsOfFormRevision=oT,s.selectAttachmentsOfFormSubmission=Xo,s.selectAttachmentsOfIssue=Ml,s.selectAttachmentsOfIssueComment=LT,s.selectAttachmentsOfIssueType=ag,s.selectAttachmentsOfIssueTypeFieldValues=Vh,s.selectAttachmentsOfIssueTypeFields=og,s.selectAttachmentsOfProject=Hm,s.selectCategories=$u,s.selectCategoriesByIds=wS,s.selectCategoriesOfProject=MS,s.selectCategoryById=Li,s.selectCategoryMapping=Gi,s.selectCommentsOfIssue=ZT,s.selectConversation=Gy,s.selectConversationMapping=ds,s.selectConversations=$y,s.selectCurrentUser=lm,s.selectDeletedRequests=RI,s.selectDescendantsOfAssetProcedureStep=Td,s.selectDocumentAttachmentById=Xu,s.selectDocumentAttachmentMapping=Zu,s.selectDocumentById=so,s.selectDocuments=Yi,s.selectDocumentsByIds=zS,s.selectDocumentsMapping=Gt,s.selectEmailDomains=oo,s.selectEmailDomainsAsMapping=uo,s.selectEmailDomainsOfOrganization=NS,s.selectFieldValuesOfAssetProcedure=gA,s.selectFormById=Ho,s.selectFormIdentifierById=ea,s.selectFormIdentifierMapping=To,s.selectFormIdentifierValueById=ca,s.selectFormIdentifierValueMapping=Po,s.selectFormIdentifierValues=aa,s.selectFormIdentifierValuesOfFormSubmission=iT,s.selectFormIdentifierValuesOfIdentifier=aT,s.selectFormIdentifiers=go,s.selectFormIdentifiersOfForm=XS,s.selectFormMapping=Lo,s.selectFormRevisionAttachmentsMapping=Eo,s.selectFormRevisionById=pT,s.selectFormRevisionMapping=oa,s.selectFormRevisions=la,s.selectFormRevisionsOfForm=Co,s.selectFormSubmissionAttachemntsByIds=Jo,s.selectFormSubmissionAttachments=Aa,s.selectFormSubmissionAttachmentsMapping=Zo,s.selectFormSubmissionById=Ia,s.selectFormSubmissions=MT,s.selectFormSubmissionsMapping=ga,s.selectFormSubmissionsOfForm=al,s.selectForms=No,s.selectFormsOfOrganization=bT,s.selectGeoImageById=Pa,s.selectGeoImageMapping=ml,s.selectGeoImages=pl,s.selectGeoImagesOfProject=jT,s.selectIsImportingProjectFile=GI,s.selectIsLoggedIn=FS,s.selectIssueAssociationById=Tl,s.selectIssueAssociationMapping=St,s.selectIssueAssociations=DT,s.selectIssueAssociationsOfAsset=bl,s.selectIssueAssociationsOfIssue=Il,s.selectIssueAssociationsToIssue=gl,s.selectIssueAttachmentById=El,s.selectIssueAttachmentMapping=vl,s.selectIssueAttachments=wl,s.selectIssueById=Wa,s.selectIssueCommentAttachmentById=$l,s.selectIssueCommentAttachmentMapping=kl,s.selectIssueCommentAttachments=Bl,s.selectIssueCommentById=Ba,s.selectIssueCommentMapping=Hl,s.selectIssueMapping=Na,s.selectIssueTypeAttachmentById=rh,s.selectIssueTypeAttachmentMapping=ch,s.selectIssueTypeAttachments=nh,s.selectIssueTypeById=Ac,s.selectIssueTypeFieldValues=xa,s.selectIssueTypeFieldValuesAttachmentById=jg,s.selectIssueTypeFieldValuesAttachments=ic,s.selectIssueTypeFieldValuesAttachmentsByIds=jh,s.selectIssueTypeFieldValuesAttachmentsMapping=Eh,s.selectIssueTypeFieldValuesById=ec,s.selectIssueTypeFieldValuesMapping=Th,s.selectIssueTypeFieldValuesOfIssue=fg,s.selectIssueTypeFields=Kt,s.selectIssueTypeFieldsAttachmentById=lg,s.selectIssueTypeFieldsAttachments=yh,s.selectIssueTypeFieldsAttachmentsMapping=ph,s.selectIssueTypeFieldsById=Og,s.selectIssueTypeFieldsMapping=Oh,s.selectIssueTypeFieldsOfIssueType=Fg,s.selectIssueTypeIdentifierById=rc,s.selectIssueTypeIdentifierMapping=Uh,s.selectIssueTypeIdentifierValueById=hc,s.selectIssueTypeIdentifierValueMapping=Gh,s.selectIssueTypeIdentifierValues=lc,s.selectIssueTypeIdentifierValuesOfIdentifier=Hg,s.selectIssueTypeIdentifierValuesOfIssue=Ng,s.selectIssueTypeIdentifiers=Ch,s.selectIssueTypeIdentifiersOfIssueType=Cg,s.selectIssueTypeMapping=yc,s.selectIssueTypeValuesOfIssueType=_g,s.selectIssueTypes=Yh,s.selectIssueTypesByIds=Xg,s.selectIssueTypesOfOrganization=Qg,s.selectIssueUpdateMapping=sm,s.selectIssueUpdates=im,s.selectIssueUpdatesOfIssue=am,s.selectIssues=Ha,s.selectIssuesByIds=xT,s.selectIssuesOfIssueType=Xl,s.selectIssuesOfProject=eg,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=WA,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=uA,s.selectLatestAssetTypeFieldsOfAssetType=Gf,s.selectLatestFieldsByAssetProcedureStep=KA,s.selectLatestFormRevisionOfForm=yT,s.selectLatestIssueTypeFieldsOfIssueType=Pg,s.selectLatestRetryTime=vI,s.selectMembershipsByUserOfTeam=db,s.selectNumberOfAssetsOfAssetType=yf,s.selectOrganizationAccessById=bc,s.selectOrganizationAccessMapping=Ic,s.selectOrganizationAccessUserMapping=Sm,s.selectOrganizationById=OI,s.selectOrganizationDocuments=US,s.selectOrganizations=_I,s.selectOrganizationsMapping=Fm,s.selectProjectAccessById=Ec,s.selectProjectAccessMapping=Mc,s.selectProjectAccesses=Qt,s.selectProjectAccessesOfProject=zm,s.selectProjectAttachmentById=Nm,s.selectProjectAttachmentMapping=Gm,s.selectProjectById=mp,s.selectProjectDocuments=DS,s.selectProjectFileById=BI,s.selectProjectFileMapping=tp,s.selectProjectFiles=sp,s.selectProjectFolderById=$c,s.selectProjectFolderMapping=Bc,s.selectProjectFolders=np,s.selectProjectFoldersByIds=YI,s.selectProjectFoldersOfProject=ZI,s.selectProjectMapping=hp,s.selectProjects=Hc,s.selectProjectsOfOrganization=sb,s.selectRehydrated=cb,s.selectStageMapping=Ut,s.selectTeamById=en,s.selectTeamMembershipById=Fp,s.selectTeamMemberships=Jc,s.selectTeamMembershipsMapping=bp,s.selectTeams=vp,s.selectTeamsByIds=pb,s.selectTeamsMapping=xc,s.selectTeamsOfOrganization=yb,s.selectUploadUrl=yo,s.selectUserById=hm,s.selectUsers=Tc,s.selectUsersByIds=lI,s.selectUsersMapping=Jt,s.selectUsersOfOrganization=SI,s.selectUsersOfProject=VI,s.selectUsersOfTeam=ub,s.setActiveProjectFileId=xm,s.setAsset=mf,s.setAssetAttachment=Dn,s.setAssetAttachments=Ny,s.setAssetProcedure=bA,s.setAssetProcedureStep=hd,s.setAssetProcedureStepFieldValues=tf,s.setAssetProcedureStepFieldValuesAttachment=JA,s.setAssetProcedureStepFieldValuesAttachments=XA,s.setAssetProcedureStepFieldValuesMany=sf,s.setAssetProcedureStepFields=$A,s.setAssetProcedureStepFieldsAttachment=qA,s.setAssetProcedureStepFieldsAttachments=zA,s.setAssetProcedureStepFieldsMany=GA,s.setAssetProcedureSteps=rf,s.setAssetProcedureType=wA,s.setAssetProcedureTypeAttachment=Wn,s.setAssetProcedureTypeAttachments=Ky,s.setAssetProcedureTypeFieldValues=fA,s.setAssetProcedureTypeFieldValuesAttachment=hA,s.setAssetProcedureTypeFieldValuesAttachments=mA,s.setAssetProcedureTypeFieldValuesMany=SA,s.setAssetProcedureTypeFields=aA,s.setAssetProcedureTypeFieldsAttachment=Xy,s.setAssetProcedureTypeFieldsAttachments=Qy,s.setAssetProcedureTypeFieldsMany=cA,s.setAssetProcedureTypes=MA,s.setAssetProcedures=FA,s.setAssetStage=qd,s.setAssetStageCompletion=Af,s.setAssetStageCompletions=ff,s.setAssetStages=Tf,s.setAssetType=mS,s.setAssetTypeAttachment=Cd,s.setAssetTypeAttachments=Rf,s.setAssetTypeFieldValues=Jf,s.setAssetTypeFieldValuesAttachment=Hf,s.setAssetTypeFieldValuesAttachments=Wf,s.setAssetTypeFieldValuesMany=Xf,s.setAssetTypeFields=Uf,s.setAssetTypeFieldsAttachment=Mf,s.setAssetTypeFieldsAttachments=Ef,s.setAssetTypeFieldsMany=Cf,s.setAssetTypeIdentifier=tS,s.setAssetTypeIdentifierValue=rS,s.setAssetTypeIdentifierValues=dS,s.setAssetTypeIdentifiers=sS,s.setAssetTypes=pS,s.setAssets=pf,s.setCategories=OS,s.setCategory=_S,s.setClientSDK=Yp,s.setClientStore=Wp,s.setConversation=jn,s.setConversations=Uy,s.setCurrentUser=uI,s.setDocumentAttachment=Hu,s.setDocumentAttachments=jS,s.setDocuments=eo,s.setEmailDomain=kS,s.setEmailDomains=BS,s.setForm=fT,s.setFormIdentifier=KS,s.setFormIdentifierValue=xS,s.setFormIdentifierValues=eT,s.setFormIdentifiers=YS,s.setFormRevision=Do,s.setFormRevisionAttachment=nT,s.setFormRevisionAttachments=rT,s.setFormRevisions=lT,s.setFormSubmission=Ht,s.setFormSubmissionAttachment=PT,s.setFormSubmissionAttachments=_T,s.setFormSubmissions=vT,s.setForms=ST,s.setGeoImage=ft,s.setGeoImages=dl,s.setIsImportingProjectFile=Qm,s.setIssue=JT,s.setIssueAssociation=qT,s.setIssueAssociations=VT,s.setIssueAttachment=_l,s.setIssueAttachments=CT,s.setIssueComment=Ca,s.setIssueCommentAttachment=zl,s.setIssueCommentAttachments=$T,s.setIssueComments=Nl,s.setIssueType=bt,s.setIssueTypeAttachment=th,s.setIssueTypeAttachments=sg,s.setIssueTypeFieldValues=mg,s.setIssueTypeFieldValuesAttachment=vg,s.setIssueTypeFieldValuesAttachments=wg,s.setIssueTypeFieldValuesMany=pg,s.setIssueTypeFields=Tg,s.setIssueTypeFieldsAttachment=ng,s.setIssueTypeFieldsAttachments=rg,s.setIssueTypeFieldsMany=gg,s.setIssueTypeIdentifier=qg,s.setIssueTypeIdentifierValue=Bg,s.setIssueTypeIdentifierValues=$g,s.setIssueTypeIdentifiers=zg,s.setIssueTypes=Kg,s.setIssueUpdate=xg,s.setIssueUpdates=eI,s.setIssues=XT,s.setLoggedIn=zu,s.setOrganization=gI,s.setOrganizationAccess=mI,s.setOrganizationAccesses=pI,s.setOrganizations=TI,s.setProfilePicture=oI,s.setProject=XI,s.setProjectAccess=MI,s.setProjectAccesses=EI,s.setProjectAttachment=Cm,s.setProjectAttachments=km,s.setProjectFile=DI,s.setProjectFiles=UI,s.setProjectFolder=NI,s.setProjectFolders=HI,s.setProjects=JI,s.setRehydrated=ab,s.setTeam=_t,s.setTeamMembership=Yc,s.setTeamMemberships=Tp,s.setTeams=lb,s.setTokens=gS,s.setUploadUrl=po,s.setUser=aI,s.setUsers=iI,s.shallowEqual=my,s.slugify=wy,s.spacesToDashesLower=vy,s.teamMembershipReducer=Ip,s.teamMembershipSlice=Kc,s.teamReducer=wp,s.teamSlice=Xc,s.toFileNameSafeString=Ry,s.toUuidArray=Pn,s.toUuidIdRecord=Fn,s.truncate=My,s.updateAsset=ot,s.updateAssetAttachment=Hy,s.updateAssetAttachments=Un,s.updateAssetProcedure=ct,s.updateAssetProcedureStep=qt,s.updateAssetProcedureStepFieldValues=dt,s.updateAssetProcedureStepFieldValuesAttachment=QA,s.updateAssetProcedureStepFieldValuesAttachments=Qr,s.updateAssetProcedureStepFieldValuesMany=nd,s.updateAssetProcedureStepFields=rt,s.updateAssetProcedureStepFieldsAttachment=DA,s.updateAssetProcedureStepFieldsAttachments=Gr,s.updateAssetProcedureStepFieldsMany=LA,s.updateAssetProcedureSteps=df,s.updateAssetProcedureType=nt,s.updateAssetProcedureTypeAttachment=Yy,s.updateAssetProcedureTypeAttachments=Kn,s.updateAssetProcedureTypeFieldValues=at,s.updateAssetProcedureTypeFieldValuesAttachment=pA,s.updateAssetProcedureTypeFieldValuesAttachments=fr,s.updateAssetProcedureTypeFieldValuesMany=_r,s.updateAssetProcedureTypeFields=lr,s.updateAssetProcedureTypeFieldsAttachment=xy,s.updateAssetProcedureTypeFieldsAttachments=ir,s.updateAssetProcedureTypeFieldsMany=nA,s.updateAssetProcedureTypes=RA,s.updateAssetProcedures=IA,s.updateAssetStage=Dt,s.updateAssetStageCompletion=Rd,s.updateAssetStageCompletions=vd,s.updateAssetStages=If,s.updateAssetType=pt,s.updateAssetTypeAttachment=vf,s.updateAssetTypeAttachments=kd,s.updateAssetTypeFieldValues=lt,s.updateAssetTypeFieldValuesAttachment=Kf,s.updateAssetTypeFieldValuesAttachments=uu,s.updateAssetTypeFieldValuesMany=fu,s.updateAssetTypeFields=iu,s.updateAssetTypeFieldsAttachment=jf,s.updateAssetTypeFieldsAttachments=Zd,s.updateAssetTypeFieldsMany=kf,s.updateAssetTypeIdentifier=ht,s.updateAssetTypeIdentifierValue=mt,s.updateAssetTypeIdentifierValues=uS,s.updateAssetTypeIdentifiers=iS,s.updateAssetTypes=AS,s.updateAssets=hf,s.updateCategories=RS,s.updateCategory=ku,s.updateConversation=Vn,s.updateConversations=Cy,s.updateDocumentAttachment=VS,s.updateDocumentAttachments=Wu,s.updateDocuments=xe,s.updateEmailDomain=$S,s.updateEmailDomains=GS,s.updateForm=TT,s.updateFormIdentifier=yt,s.updateFormIdentifierValue=At,s.updateFormIdentifierValues=tT,s.updateFormIdentifiers=ZS,s.updateFormRevision=hT,s.updateFormRevisionAttachment=dT,s.updateFormRevisionAttachments=wo,s.updateFormRevisions=mT,s.updateFormSubmission=sl,s.updateFormSubmissionAttachment=OT,s.updateFormSubmissionAttachments=Yo,s.updateFormSubmissions=wT,s.updateForms=gT,s.updateGeoImage=ll,s.updateGeoImages=ET,s.updateIssue=Wt,s.updateIssueAssociation=Sl,s.updateIssueAssociations=zT,s.updateIssueAttachment=kT,s.updateIssueAttachments=Ol,s.updateIssueComment=WT,s.updateIssueCommentAttachment=GT,s.updateIssueCommentAttachments=Dl,s.updateIssueComments=KT,s.updateIssueType=Kh,s.updateIssueTypeAttachment=ig,s.updateIssueTypeAttachments=sh,s.updateIssueTypeFieldValues=Tt,s.updateIssueTypeFieldValuesAttachment=Mg,s.updateIssueTypeFieldValuesAttachments=Mh,s.updateIssueTypeFieldValuesMany=yg,s.updateIssueTypeFields=Ph,s.updateIssueTypeFieldsAttachment=dg,s.updateIssueTypeFieldsAttachments=hh,s.updateIssueTypeFieldsMany=Ig,s.updateIssueTypeIdentifier=gt,s.updateIssueTypeIdentifierValue=It,s.updateIssueTypeIdentifierValues=Gg,s.updateIssueTypeIdentifiers=Dg,s.updateIssueTypes=Yg,s.updateIssueUpdate=tI,s.updateIssueUpdates=sI,s.updateIssues=QT,s.updateOrganization=bm,s.updateOrganizationAccess=Xt,s.updateOrganizationAccesses=yI,s.updateOrganizations=bI,s.updateProject=op,s.updateProjectAccess=Ft,s.updateProjectAccesses=Vm,s.updateProjectAttachment=zI,s.updateProjectAttachments=Bm,s.updateProjectFile=Dc,s.updateProjectFiles=kI,s.updateProjectFolder=Pt,s.updateProjectFolders=WI,s.updateProjects=xI,s.updateTeam=Rp,s.updateTeamMembership=nb,s.updateTeamMemberships=rb,s.updateTeams=hb,s.updateUser=rI,s.updateUsers=nI,s.useSelectorBuilder=Tb,s.userReducer=om,s.userSlice=Sc,s.uuidObj=F,s.versioningReducer=Ep,s.versioningSlice=Mp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(m)}return await this.addCache(d),d}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[c,r]of Object.entries(e))n[c]=this.processPresignedUrl(c,r);return n}async getFilePayload(e){const c={sha1:await qt(e),file_type:e.type,extension:gc(e),size:e.size};return await this.client.files.addCache(e),c}}class dM extends E{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:Uu,addMany:Lu,setOne:ku,setMany:Nu,updateOne:Gu,updateMany:Hu,deleteOne:Wu,deleteMany:Ku,initialize:$u});h(this,"selectors",{selectById:Zu,selectByIds:Ju})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class uM extends E{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:el,addMany:tl,setOne:sl,setMany:il,updateOne:nl,updateMany:cl,deleteOne:al,deleteMany:rl,initialize:xu});h(this,"selectors",{selectById:ul,selectByIds:ll})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class lM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:pl,addMany:yl,setOne:fl,setMany:Sl,updateOne:Al,updateMany:Il,deleteOne:Tl,deleteMany:Ol,initialize:ml});h(this,"selectors",{selectById:Fl,selectByIds:bl})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(c(r)),r}}class oM extends E{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:Rl,addMany:si,setOne:wl,setMany:vl,updateOne:El,updateMany:Bl,deleteOne:Vl,deleteMany:ii,initialize:Ml});h(this,"selectors",{selectById:Dl,selectByIds:jl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class hM extends E{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Ll,addMany:kl,setOne:Nl,setMany:Gl,updateOne:Hl,updateMany:Wl,deleteOne:Kl,deleteMany:Yl,initialize:Ul});h(this,"selectors",{selectById:Xl,selectByIds:Ql})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error("Expected form to exist");const u=this.select(Fo(e)),d=this.select(ql(e));this.dispatch(n(e)),this.dispatch(lt(w(u))),this.dispatch(ii(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(si(d)),this.dispatch(ut(u)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class mM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:to,addMany:ri,setOne:so,setMany:io,updateOne:no,updateMany:co,deleteOne:ao,deleteMany:di,initialize:eo});h(this,"selectors",{selectById:ro,selectByIds:uo})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,r=this.select(oi(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(a){throw this.dispatch(c(r)),a}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class pM extends E{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:fo,addMany:ut,setOne:po,setMany:yo,updateOne:So,updateMany:Ao,deleteOne:Io,deleteMany:lt,initialize:mo});h(this,"selectors",{selectById:Oo,selectByIds:Po})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(lo(e));this.dispatch(n(e)),this.dispatch(di(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(ri(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class yM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:Vo,addMany:zo,setOne:Eo,setMany:Bo,updateOne:Do,updateMany:jo,deleteOne:qo,deleteMany:Co,initialize:vo});h(this,"selectors",{selectById:Uo,selectByIds:Lo})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project:e}},n);return this.dispatch(c(r)),r}}class fM extends E{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:Zo,addMany:It,setOne:Wo,setMany:Ho,updateOne:Ko,updateMany:Yo,deleteOne:Jo,deleteMany:Tt,initialize:Go});h(this,"selectors",{selectById:Qo,selectByIds:xo})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.asset],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,submitted_at:u,created_by:a}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.issue,m.asset]),blocks:w(d)});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class SM extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:rh,addMany:Si,setOne:dh,setMany:uh,updateOne:lh,updateMany:oh,deleteOne:hh,deleteMany:Ai,initialize:ah});h(this,"selectors",{selectById:yh,selectByIds:fh})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class AM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:Th,addMany:Oh,setOne:Ph,setMany:Fh,updateOne:bh,updateMany:_h,deleteOne:gh,deleteMany:Mh,initialize:Ih});h(this,"selectors",{selectById:wh,selectByIds:vh})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class IM extends E{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:zh,addMany:Dh,setOne:jh,setMany:qh,updateOne:Ch,updateMany:$h,deleteOne:Uh,deleteMany:Lh,initialize:Vh});h(this,"selectors",{selectById:kh,selectByIds:Nh})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>d.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[e.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{setMany:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class TM extends E{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:Kh,addMany:_i,setOne:Yh,setMany:Zh,updateOne:Jh,updateMany:Xh,deleteOne:Qh,deleteMany:gi,initialize:Wh});h(this,"selectors",{selectById:em,selectByIds:tm})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.project,d.issue_type,d.status,d.priority],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const a={...r,...e};this.dispatch(n(a));const u={};for(const m of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(m in e&&e[m]!==r[m])switch(m){case $.PRIORITY:{const f=e[m],I=this.select(ki(f));if(!I)throw new Error(`Trying to update issue type priority with ${f} which does not exist in store`);u[m]={name:I.name,color:I.color,uuid:I.uuid};break}case $.DUE_DATE:u[m]=e.due_date;break;case $.DESCRIPTION:u[m]=e.description??"";break;case $.TITLE:u[m]=e.title??"";break;case $.STATUS:{const f=e[m],I=this.select(Ki(f));if(!I)throw new Error(`Trying to update issue type status with ${f} which does not exist in store`);u[m]={name:I.name,color:I.color,uuid:I.uuid};break}case $.ASSIGNED_TO:{const f=e[m];if(f===null)u[m]=null;else{const I=this.select(es(f));if(!I)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);u[m]={full_name:I.username,id:I.id}}break}}const d=O({created_by:this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(Zi(d));const p=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(m=>{this.dispatch(n(m))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Xi(d.uuid))}),[a,p]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=w(e).toSorted(Ct);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(ps);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} issues that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=rt(e,Math.min(n??e.length,N)),m=[];let f=null;for(const I of p){const R=dt.v4(),b=w(I),g=I.map(({status:B})=>B).filter(Boolean),_=I.map(({priority:B})=>B).filter(Boolean),v=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(f?[f]:[]).concat(b).concat(g).concat(_),blocks:[R].concat(b)});m.push(v),f=R}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue with uuid ${e} found in the store`);const u=this.select(th(e)),d=this.select(ph(e)),p=this.select(Ly(e)),m=this.select(bo(e));this.dispatch(n(e)),this.dispatch(Ai(w(d))),this.dispatch(Qi(w(p))),this.dispatch(Tt(w(u))),this.dispatch(lt(w(m)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(a)),this.dispatch(Si(d)),this.dispatch(Ji(p)),this.dispatch(It(u)),this.dispatch(ut(m)),f}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(eh(e)),d=this.select(_o(e));this.dispatch(c(e)),this.dispatch(Tt(w(u))),this.dispatch(lt(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(p){throw this.dispatch(n(a)),this.dispatch(It(u)),this.dispatch(ut(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class OM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:am,addMany:rm,setOne:dm,setMany:um,updateOne:lm,updateMany:om,deleteOne:hm,deleteMany:mm,initialize:cm});h(this,"selectors",{selectById:ym,selectByIds:fm})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class PM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:Tm,addMany:Om,setOne:Pm,setMany:Fm,updateOne:bm,updateMany:_m,deleteOne:gm,deleteMany:Mm,initialize:Im});h(this,"selectors",{selectById:wm,selectByIds:vm})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class FM extends E{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:Ym,addMany:Zm,setOne:Jm,setMany:Xm,updateOne:Qm,updateMany:xm,deleteOne:ep,deleteMany:tp,initialize:Km});h(this,"selectors",{selectById:ip,selectByIds:np})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class bM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Field Values Attachment");h(this,"url","/issue-type-field-values-attachments");h(this,"actions",{addOne:dp,addMany:zi,setOne:up,setMany:lp,updateOne:op,updateMany:hp,deleteOne:mp,deleteMany:Di,initialize:rp});h(this,"selectors",{selectById:yp,selectByIds:fp})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class _M extends E{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:zm,addMany:Dm,setOne:jm,setMany:qm,updateOne:Cm,updateMany:$m,deleteOne:Um,deleteMany:Lm,initialize:Vm});h(this,"selectors",{selectById:Nm,selectByIds:Gm})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(Sp(e));this.dispatch(n(e)),this.dispatch(Di(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(zi(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class gM extends E{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:Op,addMany:Pp,setOne:Fp,setMany:bp,updateOne:_p,updateMany:gp,deleteOne:Mp,deleteMany:Rp,initialize:Tp});h(this,"selectors",{selectById:vp,selectByIds:Ep})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class MM extends E{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:Dp,addMany:jp,setOne:qp,setMany:Cp,updateOne:$p,updateMany:Up,deleteOne:Lp,deleteMany:kp,initialize:zp});h(this,"selectors",{selectById:Gp,selectByIds:Hp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class RM extends E{constructor(){super(...arguments);h(this,"name","Issue Type Priority");h(this,"url","/issue-type-priorities");h(this,"actions",{addOne:Zp,addMany:Jp,setOne:Xp,setMany:Qp,updateOne:xp,updateMany:ey,deleteOne:ty,deleteMany:sy,initialize:Yp});h(this,"selectors",{selectById:ki,selectByIds:ny})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class wM extends E{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:dy,addMany:uy,setOne:ly,setMany:oy,updateOne:hy,updateMany:my,deleteOne:py,deleteMany:yy,initialize:ry});h(this,"selectors",{selectById:Sy,selectByIds:Ay})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,submitted_at:u,created_by:a});this.dispatch(n(d));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=this.select(sm(e));this.dispatch(n(e)),this.dispatch(gi(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(_i(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class vM extends E{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:Py,addMany:Fy,setOne:by,setMany:_y,updateOne:gy,updateMany:My,deleteOne:Ry,deleteMany:wy,initialize:Oy});h(this,"selectors",{selectById:Ki,selectByIds:Ey})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class EM extends E{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:Zi,addMany:Ji,setOne:Dy,setMany:jy,updateOne:qy,updateMany:Cy,deleteOne:Xi,deleteMany:Qi,initialize:zy});h(this,"selectors",{selectById:$y,selectByIds:Uy})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}const BM=1800;function VM(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 zM extends Ng{constructor(){super(...arguments);h(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let c;try{c=await n}catch(r){console.error("Could not renew tokens; clearing auth",r),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(Hd(!1)),this.clearTokens(),this.dispatch(T()),this.dispatch(T())}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.debug("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 c;try{c=rb(e).exp??n}catch{c=n}return c-n<BM}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 U&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??bt).toString()))}}}async handleUnauthorized(e,n){if(e.url.endsWith("/token/refresh/"))throw this.select(c=>c.authReducer.isLoggedIn)&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(this.select(c=>c.authReducer.isLoggedIn))await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=dt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(c=>{this.setTokens(VM(c))})}}class DM extends yt{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:sf,addMany:nf,setOne:cf,setMany:af,updateOne:rf,updateMany:df,deleteOne:uf,deleteMany:lf,initialize:tf});h(this,"selectors",{selectById:hf,selectByIds:mf})}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e)),u=this.select(es(a.user));this.dispatch(n(a.uuid)),this.dispatch(nn(a.user));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${a.uuid}/`,blockers:[a.uuid],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(sn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class jM extends yt{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:Tf,addMany:If,setOne:Af,setMany:Sf,updateOne:Pf,updateMany:Of,deleteOne:Ff,deleteMany:bf,initialize:ff});h(this,"selectors",{selectById:Mf,selectByIds:Rf})}async add(e){const{addOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(c)),c}async update(e){const{setOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(c)),c}async invite(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,c=await this.list({},e);return this.dispatch(n(c)),c}}class qM extends E{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:Cf,addMany:$f,setOne:Uf,setMany:Lf,updateOne:kf,updateMany:Nf,deleteOne:Gf,deleteMany:Hf,initialize:qf});h(this,"selectors",{selectById:Kf,selectByIds:Yf})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(d=>{throw this.dispatch(r(a.uuid)),d}),[a,u]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>M(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(m=>m.uuid))),p}),[u,d]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class CM extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:Xf,addMany:Qf,setOne:xf,setMany:eS,updateOne:tS,updateMany:sS,deleteOne:iS,deleteMany:nS,initialize:Jf});h(this,"selectors",{selectById:aS,selectByIds:rS})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class $M extends E{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:oS,addMany:hS,setOne:mS,setMany:pS,updateOne:yS,updateMany:fS,deleteOne:SS,deleteMany:AS,initialize:lS});h(this,"selectors",{selectById:TS,selectByIds:OS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class UM extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:MS,addMany:RS,setOne:_S,setMany:gS,updateOne:wS,updateMany:vS,deleteOne:ES,deleteMany:BS,initialize:bS});h(this,"selectors",{selectById:DS,selectByIds:jS})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class LM extends yt{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:NS,addMany:kS,setOne:LS,setMany:US,updateOne:HS,updateMany:GS,deleteOne:WS,deleteMany:KS,initialize:$S});h(this,"selectors",{selectById:JS,selectByIds:XS})}async add(e){const{addOne:n}=this.actions,c=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:M(e)});return this.dispatch(n(c)),c}async update(e){const{updateOne:n}=this.actions,c=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e)});return this.dispatch(n(c)),c}async delete(e){const{deleteOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),c}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class kM extends E{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:pA,addMany:Pt,setOne:yA,setMany:fA,updateOne:SA,updateMany:AA,deleteOne:IA,deleteMany:Ft,initialize:mA});h(this,"selectors",{selectById:PA,selectByIds:FA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_type,a.project,a.asset,...a.procedure_initiative?[a.procedure_initiative]:[]],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e,n){var b;const{store:c}=this.client,{addMany:r,updateMany:a,deleteMany:u}=this.actions,d=new Date().toISOString(),p=((b=c.getState().userReducer.currentUser)==null?void 0:b.id)??null,m=[],f=rt(e,Math.min(n??e.length,N)),I=[];for(const g of f){const _=[],v=[],B=[];for(const D of g){const z=O({...D,submitted_at:d,created_by:p});m.push(z),_.push(M(z)),v.push(z.procedure_type,z.project,z.asset,...z.procedure_initiative?[z.procedure_initiative]:[]),B.push(z.uuid)}const C={payload:{submitted_at:d,payloads:_},blockers:v,blocks:B};I.push(C)}this.dispatch(r(m));const R=I.map(g=>{const{payload:_,blocks:v,blockers:B}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:_,blockers:B,blocks:v})});return Promise.all(R).then(g=>{this.dispatch(a(g.flat()))}).catch(()=>{this.dispatch(u(w(m)))}),[m,Promise.all(R).then(g=>g.flat())]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(c(w(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class NM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:vA,addMany:EA,setOne:BA,setMany:VA,updateOne:zA,updateMany:DA,deleteOne:jA,deleteMany:qA,initialize:wA});h(this,"selectors",{selectById:$A,selectByIds:UA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:w(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class GM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:GA,addMany:HA,setOne:WA,setMany:KA,updateOne:YA,updateMany:ZA,deleteOne:JA,deleteMany:XA,initialize:NA});h(this,"selectors",{selectById:xA,selectByIds:eI})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class HM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:nI,addMany:cI,setOne:aI,setMany:rI,updateOne:dI,updateMany:uI,deleteOne:lI,deleteMany:oI,initialize:iI});h(this,"selectors",{selectById:mI,selectByIds:pI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class WM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:AI,addMany:II,setOne:TI,setMany:OI,updateOne:PI,updateMany:FI,deleteOne:bI,deleteMany:_I,initialize:SI});h(this,"selectors",{selectById:MI,selectByIds:RI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class KM extends yt{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:BI,addMany:VI,setOne:zI,setMany:DI,updateOne:jI,updateMany:qI,deleteOne:CI,deleteMany:$I,initialize:EI});h(this,"selectors",{selectById:LI,selectByIds:kI})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class YM extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:WI,addMany:gn,setOne:KI,setMany:YI,updateOne:ZI,updateMany:JI,deleteOne:XI,deleteMany:Mn,initialize:HI});h(this,"selectors",{selectById:eT,selectByIds:tT})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return O({...e,created_by:this.select(n=>{var c;return((c=n.userReducer.currentUser)==null?void 0:c.id)??null}),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class ZM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:cT,addMany:aT,setOne:rT,setMany:dT,updateOne:uT,updateMany:lT,deleteOne:oT,deleteMany:hT,initialize:nT});h(this,"selectors",{selectById:mT,selectByIds:pT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=this.select(xI(e));this.dispatch(n(e)),this.dispatch(Mn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(gn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class JM extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Attachment");h(this,"url","/procedure-step-field-values-attachments");h(this,"actions",{addOne:AT,addMany:Bn,setOne:IT,setMany:TT,updateOne:OT,updateMany:PT,deleteOne:FT,deleteMany:Vn,initialize:ST});h(this,"selectors",{selectById:_T,selectByIds:gT})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class XM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Review");h(this,"url","/procedure-step-field-values-reviews");h(this,"actions",{addOne:HT,addMany:qn,setOne:WT,setMany:KT,updateOne:YT,updateMany:ZT,deleteOne:JT,deleteMany:Cn,initialize:GT});h(this,"selectors",{selectById:QT,selectByIds:xT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.field_values],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class QM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:ET,addMany:BT,setOne:VT,setMany:zT,updateOne:DT,updateMany:jT,deleteOne:qT,deleteMany:CT,initialize:vT});h(this,"selectors",{selectById:LT,selectByIds:kT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(R=>{var b;return((b=R.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,N)),f=[];for(const R of m){const b=[],g=[],_=[];for(const v of R){const B=O({...v,values:v.values,created_by:d,submitted_at:u});p.push(B),b.push(M(B)),g.push(B.procedure_step,B.procedure,B.fields_revision),_.push(B.uuid)}f.push({payload:{payloads:b,submitted_at:u},blockers:g,blocks:_})}this.dispatch(c(p));const I=f.map(R=>{const{payload:b,blocks:g,blockers:_}=R;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:g})});return Promise.all(I).then(R=>{this.dispatch(r(R.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(R=>R.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.procedure,a.procedure_step,a.fields_revision],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=this.select(MT(e)),d=this.select(eO(e));this.dispatch(n(e)),this.dispatch(Vn(w(u))),this.dispatch(Cn(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Bn(u)),this.dispatch(qn(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class xM extends E{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:nO,addMany:cO,setOne:aO,setMany:rO,updateOne:dO,updateMany:uO,deleteOne:lO,deleteMany:oO,initialize:iO});h(this,"selectors",{selectById:mO,selectByIds:pO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:d.map(m=>m.uuid)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.map(m=>m.uuid)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class eR extends E{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:eA,addMany:tA,setOne:sA,setMany:iA,updateOne:nA,updateMany:cA,deleteOne:aA,deleteMany:rA,initialize:xS});h(this,"selectors",{selectById:lA,selectByIds:oA})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=O({...e,created_by:((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(c(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(u),blockers:[u.procedure_type,u.project],blocks:[u.uuid]});return d.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(a(u.uuid))}),[u,d]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const u=this.select(MA(e));this.dispatch(n(e)),this.dispatch(Ft(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Pt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class tR extends E{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:TO,addMany:OO,setOne:AO,setMany:IO,updateOne:PO,updateMany:FO,deleteOne:bO,deleteMany:_O,initialize:SO});h(this,"selectors",{selectById:MO,selectByIds:RO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_type],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class sR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:EO,addMany:BO,setOne:VO,setMany:zO,updateOne:DO,updateMany:jO,deleteOne:qO,deleteMany:CO,initialize:vO});h(this,"selectors",{selectById:LO,selectByIds:kO})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const{procedure_type:n,file_sha1:c,file_extension:r,file_name:a,file_type:u,file_url:d}=e,p=this.select(f=>{var I;return((I=f.userReducer.currentUser)==null?void 0:I.id)??null}),m=new Date().toISOString();return O({file_url:d,file_sha1:c,file_extension:r,file_name:a,file_type:u,created_by:p,submitted_at:m,procedure_type:n})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class iR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:HO,addMany:WO,setOne:KO,setMany:YO,updateOne:ZO,updateMany:JO,deleteOne:XO,deleteMany:QO,initialize:GO});h(this,"selectors",{selectById:tP,selectByIds:sP})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class nR extends E{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:cP,addMany:aP,setOne:rP,setMany:dP,updateOne:uP,updateMany:lP,deleteOne:oP,deleteMany:hP,initialize:nP});h(this,"selectors",{selectById:yP,selectByIds:fP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.procedure_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class cR extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:IP,addMany:Zn,setOne:TP,setMany:OP,updateOne:PP,updateMany:FP,deleteOne:bP,deleteMany:Jn,initialize:AP});h(this,"selectors",{selectById:MP,selectByIds:RP})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class aR extends E{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:BP,addMany:VP,setOne:zP,setMany:DP,updateOne:jP,updateMany:qP,deleteOne:CP,deleteMany:$P,initialize:EP});h(this,"selectors",{selectById:kP,selectByIds:NP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.fields_revision,e.procedure],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(R=>{var b;return((b=R.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,N)),f=[];for(const R of m){const b=[],g=[],_=[];for(const v of R){const B=O({...v,values:v.values,created_by:d,submitted_at:u});p.push(B),b.push(M(B)),g.push(B.procedure,B.fields_revision),_.push(B.uuid)}f.push({payload:{payloads:b,submitted_at:u},blockers:g,blocks:_})}this.dispatch(c(p));const I=f.map(R=>{const{payload:b,blocks:g,blockers:_}=R;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:g})});return Promise.all(I).then(R=>{this.dispatch(r(R.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(R=>R.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.fields_revision,a.procedure],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(wP(e));this.dispatch(n(e)),this.dispatch(Jn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Zn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class rR extends E{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:WP,addMany:KP,setOne:YP,setMany:ZP,updateOne:JP,updateMany:XP,deleteOne:QP,deleteMany:xP,initialize:HP});h(this,"selectors",{selectById:sF,selectByIds:iF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=this.select(bA(e));this.dispatch(n(e)),this.dispatch(Ft(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Pt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class dR extends E{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:rF,addMany:dF,setOne:uF,setMany:lF,updateOne:oF,updateMany:hF,deleteOne:mF,deleteMany:pF,initialize:aF});h(this,"selectors",{selectById:SF,selectByIds:AF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[e.team],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>M(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(c(r)),r}}class uR extends E{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:OF,addMany:PF,setOne:FF,setMany:bF,updateOne:_F,updateMany:gF,deleteOne:MF,deleteMany:RF,initialize:TF});h(this,"selectors",{selectById:vF,selectByIds:EF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,submitted_at:new Date().toISOString(),created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class lR extends yt{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:sn,addMany:Ky,setOne:Wy,setMany:Hy,updateOne:Zy,updateMany:Yy,deleteOne:nn,deleteMany:Jy,initialize:Gy});h(this,"selectors",{selectById:es,selectByIds:xy})}async list(e,n){const{organizationUuid:c,...r}=e,a=c?`/organizations/${c}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:a,...r},n)}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({organizationUuid:e},n);return this.dispatch(c(r)),r}}async function uc(t,s,e,n,c){const r=n instanceof pt;r&&s.checkAuth!==!1&&await n.auth.prepareAuth();const a={queryParams:"",isAuthNeeded:!0},{s3url:u,payload:d,headers:p,method:m,queryParams:f,attachmentHash:I,isExternalUrl:R,isAuthNeeded:b,isResponseBlob:g}={...a,...s};let _=s.url;const v=I?await e.files.fetchCache(I):void 0;if(I&&!v)throw new Error(`Cannot upload file ${I} because it's not cached.`);!R&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const B=q=>{if(I){if(!u)throw new Error(`No S3 URL for file ${I}`);if("warning"in u)throw new Error(`S3 URL warning for file ${I}`);if(!v)throw new Error(`No file for file ${I}`);const G=u.fields["x-amz-checksum-sha1"];if(!G)throw new Error(`No checksum for file ${I}`);return q.set("x-amz-checksum-sha1",G).field({...d,...u.fields}).attach("file",v)}return q.send(d)},D={[o.GET]:()=>g?St.get(_.toString()).responseType("blob"):St.get(_.toString()),[o.POST]:()=>{const q=St.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=St.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=St.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=St.delete(_.toString());return B(q)}}[m];let z=D();const Mt=()=>{console.debug("aborting request:",s.url),z.abort()};if(c==null||c.addEventListener("abort",Mt),b&&r){const q=n.auth.getAuthHeader();z=z.set("Authorization",q)}p&&(z=z.set(p));try{return await z.query(f)}catch(q){const G=NF(q),ds=G==null?void 0:G.status;if(r&&ds===401)return await n.auth.handleUnauthorized(z,G),z.query(f);throw new U({response:G,innerError:q,discard:rc.includes(ds)})}finally{c==null||c.removeEventListener("abort",Mt)}}class oR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new us,a={...e,uuid:e.uuid??dt.v4()};return uc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??bt).toString()))}),r}async performRequest(s,e,n,c){return this._performRequest(s,e,n,c).then(r=>{if(r instanceof U)throw r;return r})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(c=>{if(c instanceof U)throw c;return c})}_enqueueRequest(s,e,n){const c=new us,r={...s,BASE_URL:e,serviceName:n},a=this.store.dispatch(Bf(r)),u=p=>{if(p)c.resolve(p.body);else{const m=new U({message:"Could not get a response from the server.",response:p,discard:!0});c.reject(m)}},d=p=>{p instanceof U?p.options.discard=!0:(console.error("Received an unexpected error while processing a request:",p,`
|
|
14
|
+
Converting error to APIError and discarding.`),p=new U({message:"An error occurred while processing the request.",innerError:p,discard:!0})),c.reject(p)};return a.then(u,d),c}async performPagination(s,e,n,c,r){const a={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:u}=a,d=[];let p=await this.performRequest(s,a,c,r);for(d.push(p.results);p.next;)p=await this.performRequest(s,{url:p.next,method:u},c,r),d.push(p.results);return d}}class _t{constructor(){h(this,"graph");h(this,"requestAttemptCounter");this.graph=new db.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new _t;for(let n=0;n<s.length;n++){const c=s[n];if(!c){console.error("Outbox item was undefined");continue}e.sneakRequest(c);for(let r=0;r<n;r++){const a=s[r];if(!a){console.error("Previous outbox item was undefined");continue}a.payload.uuid!==c.payload.uuid&&a.payload.blocks.some(u=>c.payload.blockers.includes(u))&&_t._addDependency(c.payload.uuid,a.payload.uuid,e.graph)}}return e}_addDependency(s,e){_t._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),c=new Set(n.payload.blocks);s.payload.blockers.some(r=>c.has(r))&&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),c=new Set(s.payload.blocks);n.payload.blockers.some(r=>c.has(r))&&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 c of s){const r=this.requestAttemptCounter[c]||0;r<e&&(e=r,n=c)}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),c=s.findIndex(r=>r.payload.uuid===n.payload.uuid);c!==-1&&(s.splice(c,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 c=this.requestAttemptCounter[e.payload.uuid]||0,r=this.requestAttemptCounter[n.payload.uuid]||0;return c-r}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let GF;function HF(t){GF=t}function gt(){return GF}let WF;function KF(t){WF=t}function YF(){return WF}let lc=null;function ft(){const t=gt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(lc)return lc;const s=t.getState().offline.outbox,e=_t._fromOutbox(s);return lc=e,e}const hR=(t,s)=>{const e=new s(t);return KF(e),HF(t),e};class mR{constructor(s){h(this,"_all");h(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 oc{constructor(){h(this,"next");this.next=null}then(s){return new mR(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!gt())throw new Error("Client store not set");const n=YF();if(!n)throw new Error("Client SDK not set");return UF(s,n)}}}class ZF extends oc{async run(s){return super.run(s)}}class JF extends oc{async run(s){return super.run(s)}}const XF=new ZF().then(new JF).compile();function QF(t){var s;return(s=XF[0])==null?void 0:s.run(t)}var xF=(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))(xF||{});i.ALL_MIDDLEWARE=XF,i.APIError=U,i.AgentService=Gg,i.AssetAttachmentService=Hg,i.AssetCommentService=Wg,i.AssetService=Kg,i.AssetStatusType=Tc,i.AssetTypeAttachmentService=Yg,i.AssetTypeFieldValuesAttachmentService=Xg,i.AssetTypeFieldValuesService=Qg,i.AssetTypeFieldsAttachmentService=Zg,i.AssetTypeFieldsService=Jg,i.AssetTypeIdentifierService=xg,i.AssetTypeIdentifierValueService=eM,i.AssetTypeService=tM,i.AssetTypeStatusService=sM,i.BaseApiService=pt,i.BaseModelApiService=yt,i.BaseOfflineFileModelApiService=j,i.BaseOfflineModelApiService=E,i.BaseSDK=oR,i.COMMON_AUTO_FIELDS=Ac,i.DEFAULT_PAGE_SIZE=zF,i.DISCARD_HTTP_STATUSES=rc,i.DeferredPromise=us,i.DocumentAttachmentService=iM,i.DocumentService=nM,i.EMPTY_ARRAY=yc,i.EMPTY_OBJECT=fc,i.EmailDomainsService=cM,i.EmailVerificationService=aM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=DF,i.FileService=rM,i.FormIdentifierService=dM,i.FormIdentifierValueService=uM,i.FormRevisionAttachmentService=lM,i.FormRevisionService=oM,i.FormService=hM,i.FormSubmissionAttachmentService=mM,i.FormSubmissionService=pM,i.GeoImageService=yM,i.HttpMethod=o,i.IssueAssociationService=fM,i.IssueAttachmentService=SM,i.IssueCommentAttachmentService=AM,i.IssueCommentService=IM,i.IssuePriorityType=Pc,i.IssueService=TM,i.IssueStatusType=Oc,i.IssueTypeAttachmentService=OM,i.IssueTypeFieldValuesAttachmentService=bM,i.IssueTypeFieldValuesService=_M,i.IssueTypeFieldsAttachmentService=PM,i.IssueTypeFieldsService=FM,i.IssueTypeIdentifierService=gM,i.IssueTypeIdentifierValueService=MM,i.IssueTypePriorityService=RM,i.IssueTypeService=wM,i.IssueTypeStatusService=vM,i.IssueUpdateChange=$,i.IssueUpdateService=EM,i.JWTService=zM,i.MAX_SERVICE_BATCH_SIZE=N,i.OUTBOX_RETRY_DELAY=Sc,i.OfflineAnalyticsMiddleware=ZF,i.OfflineMiddleware=oc,i.OrganizationAccessLevel=Ic,i.OrganizationAccessService=DM,i.OrganizationService=jM,i.OutboxCoordinator=_t,i.ProcdureInitiativeService=eR,i.ProcedureFieldValuesAttachmentService=cR,i.ProcedureFieldValuesService=aR,i.ProcedureService=kM,i.ProcedureStepAssigneeService=NM,i.ProcedureStepCommentService=GM,i.ProcedureStepDefaultAssigneeService=HM,i.ProcedureStepDefaultReviewerService=WM,i.ProcedureStepEventService=KM,i.ProcedureStepEventType=Fc,i.ProcedureStepFieldValuesAttachmentService=JM,i.ProcedureStepFieldValuesReviewService=XM,i.ProcedureStepFieldValuesReviewType=bc,i.ProcedureStepFieldValuesService=QM,i.ProcedureStepFieldsAttachmentService=YM,i.ProcedureStepFieldsService=ZM,i.ProcedureStepReviewerService=xM,i.ProcedureStepService=tR,i.ProcedureTypeAttachmentService=sR,i.ProcedureTypeFieldsAttachmentService=iR,i.ProcedureTypeFieldsService=nR,i.ProcedureTypeService=rR,i.ProjectAccessService=qM,i.ProjectAttachmentService=CM,i.ProjectCommentService=$M,i.ProjectFileService=UM,i.ProjectService=LM,i.RESET_ORGANIZATION_STATE=F,i.RESET_PROJECT_STATE=V,i.RESET_STATE=T,i.RateLimitingMiddleware=JF,i.SelectorBuilder=wb,i.TeamMembershipService=dR,i.TeamService=uR,i.UNKNOWN_ERROR_MESSAGE=bt,i.UserService=lR,i.VerificationCodeType=xF,i._setLatestRetryTime=zf,i.addAsset=Sa,i.addAssetAttachment=Gc,i.addAssetAttachments=As,i.addAssetComment=ia,i.addAssetComments=$t,i.addAssetType=Td,i.addAssetTypeAttachment=va,i.addAssetTypeAttachments=gs,i.addAssetTypeFieldValues=vr,i.addAssetTypeFieldValuesAttachment=Sr,i.addAssetTypeFieldValuesAttachments=Vs,i.addAssetTypeFieldValuesMany=Er,i.addAssetTypeFields=ir,i.addAssetTypeFieldsAttachment=Na,i.addAssetTypeFieldsAttachments=Ga,i.addAssetTypeFieldsMany=nr,i.addAssetTypeIdentifier=Gr,i.addAssetTypeIdentifierValue=nd,i.addAssetTypeIdentifierValues=cd,i.addAssetTypeIdentifiers=Hr,i.addAssetTypeStatus=Bd,i.addAssetTypeStatuses=Vd,i.addAssetTypes=Od,i.addAssets=Fs,i.addConversation=Cc,i.addConversations=vb,i.addDocument=uu,i.addDocumentAttachment=Zd,i.addDocumentAttachments=Jd,i.addDocuments=lu,i.addEmailDomain=Fu,i.addEmailDomains=bu,i.addForm=Ll,i.addFormIdentifier=Uu,i.addFormIdentifierValue=el,i.addFormIdentifierValues=tl,i.addFormIdentifiers=Lu,i.addFormRevision=Rl,i.addFormRevisionAttachment=pl,i.addFormRevisionAttachments=yl,i.addFormRevisions=si,i.addFormSubmission=fo,i.addFormSubmissionAttachment=to,i.addFormSubmissionAttachments=ri,i.addFormSubmissions=ut,i.addForms=kl,i.addGeoImage=Vo,i.addGeoImages=zo,i.addIssue=Kh,i.addIssueAssociation=Zo,i.addIssueAssociations=It,i.addIssueAttachment=rh,i.addIssueAttachments=Si,i.addIssueComment=zh,i.addIssueCommentAttachment=Th,i.addIssueCommentAttachments=Oh,i.addIssueComments=Dh,i.addIssueType=dy,i.addIssueTypeAttachment=am,i.addIssueTypeAttachments=rm,i.addIssueTypeFieldValues=zm,i.addIssueTypeFieldValuesAttachment=dp,i.addIssueTypeFieldValuesAttachments=zi,i.addIssueTypeFieldValuesMany=Dm,i.addIssueTypeFields=Ym,i.addIssueTypeFieldsAttachment=Tm,i.addIssueTypeFieldsAttachments=Om,i.addIssueTypeFieldsMany=Zm,i.addIssueTypeIdentifier=Op,i.addIssueTypeIdentifierValue=Dp,i.addIssueTypeIdentifierValues=jp,i.addIssueTypeIdentifiers=Pp,i.addIssueTypePriorities=Jp,i.addIssueTypePriority=Zp,i.addIssueTypeStatus=Py,i.addIssueTypeStatuses=Fy,i.addIssueTypes=uy,i.addIssueUpdate=Zi,i.addIssueUpdates=Ji,i.addIssues=_i,i.addOrganization=Tf,i.addOrganizationAccess=sf,i.addOrganizationAccesses=nf,i.addOrganizations=If,i.addProcedure=pA,i.addProcedureFieldValues=BP,i.addProcedureFieldValuesAttachment=IP,i.addProcedureFieldValuesAttachments=Zn,i.addProcedureFieldValuesMany=VP,i.addProcedureInitiative=eA,i.addProcedureInitiatives=tA,i.addProcedureStep=TO,i.addProcedureStepAssignee=vA,i.addProcedureStepAssignees=EA,i.addProcedureStepComment=GA,i.addProcedureStepComments=HA,i.addProcedureStepDefaultAssignee=nI,i.addProcedureStepDefaultAssignees=cI,i.addProcedureStepDefaultReviewer=AI,i.addProcedureStepDefaultReviewers=II,i.addProcedureStepEvent=BI,i.addProcedureStepEvents=VI,i.addProcedureStepFieldValues=ET,i.addProcedureStepFieldValuesAttachment=AT,i.addProcedureStepFieldValuesAttachments=Bn,i.addProcedureStepFieldValuesMany=BT,i.addProcedureStepFieldValuesReview=HT,i.addProcedureStepFieldValuesReviews=qn,i.addProcedureStepFields=cT,i.addProcedureStepFieldsAttachment=WI,i.addProcedureStepFieldsAttachments=gn,i.addProcedureStepFieldsMany=aT,i.addProcedureStepReviewer=nO,i.addProcedureStepReviewers=cO,i.addProcedureSteps=OO,i.addProcedureType=WP,i.addProcedureTypeAttachment=EO,i.addProcedureTypeAttachments=BO,i.addProcedureTypeFields=cP,i.addProcedureTypeFieldsAttachment=HO,i.addProcedureTypeFieldsAttachments=WO,i.addProcedureTypeFieldsMany=aP,i.addProcedureTypes=KP,i.addProcedures=Pt,i.addProject=NS,i.addProjectAccess=Cf,i.addProjectAccesses=$f,i.addProjectAttachment=Xf,i.addProjectAttachments=Qf,i.addProjectComment=oS,i.addProjectComments=hS,i.addProjectFile=MS,i.addProjectFiles=RS,i.addProjects=kS,i.addTeam=OF,i.addTeamMembership=rF,i.addTeamMemberships=dF,i.addTeams=PF,i.addUser=sn,i.addUsers=Ky,i.agentsReducer=Lc,i.agentsSlice=ys,i.areArraysEqual=hb,i.assetAttachmentReducer=ea,i.assetAttachmentSlice=Ss,i.assetCommentReducer=pa,i.assetCommentSlice=Os,i.assetReducer=Ma,i.assetSlice=Ps,i.assetTypeAttachmentReducer=Ua,i.assetTypeAttachmentSlice=_s,i.assetTypeFieldValuesAttachmentReducer=Mr,i.assetTypeFieldValuesAttachmentSlice=Bs,i.assetTypeFieldValuesReducer=Lr,i.assetTypeFieldValuesSlice=js,i.assetTypeFieldsAttachmentReducer=er,i.assetTypeFieldsAttachmentSlice=ws,i.assetTypeFieldsReducer=pr,i.assetTypeFieldsSlice=Es,i.assetTypeIdentifierReducer=td,i.assetTypeIdentifierSlice=qs,i.assetTypeIdentifierValueReducer=yd,i.assetTypeIdentifierValueSlice=$s,i.assetTypeReducer=wd,i.assetTypeSlice=Us,i.assetTypeStatusReducer=Nd,i.assetTypeStatusSlice=ks,i.assetTypeStatusSortFn=Ec,i.authReducer=Wd,i.authSlice=Ht,i.baseReducer=Vg,i.baseReducers=ac,i.clearTokens=Zb,i.createModelAdapter=P,i.createOfflineAction=vf,i.createPayload=M,i.createSelectionAdapter=ub,i.deleteAsset=Ta,i.deleteAssetAttachment=Zc,i.deleteAssetAttachments=Is,i.deleteAssetComment=da,i.deleteAssetComments=Ut,i.deleteAssetType=bd,i.deleteAssetTypeAttachment=Da,i.deleteAssetTypeAttachments=Ms,i.deleteAssetTypeFieldValues=jr,i.deleteAssetTypeFieldValuesAttachment=Pr,i.deleteAssetTypeFieldValuesAttachments=zs,i.deleteAssetTypeFieldValuesMany=qr,i.deleteAssetTypeFields=ur,i.deleteAssetTypeFieldsAttachment=Za,i.deleteAssetTypeFieldsAttachments=Ja,i.deleteAssetTypeFieldsMany=lr,i.deleteAssetTypeIdentifier=Jr,i.deleteAssetTypeIdentifierValue=ld,i.deleteAssetTypeIdentifierValues=od,i.deleteAssetTypeIdentifiers=Xr,i.deleteAssetTypeStatus=Cd,i.deleteAssetTypeStatuses=$d,i.deleteAssetTypes=_d,i.deleteAssets=bs,i.deleteConversation=Vb,i.deleteConversations=zb,i.deleteDocument=yu,i.deleteDocumentAttachment=tu,i.deleteDocumentAttachments=su,i.deleteDocuments=fu,i.deleteEmailDomain=wu,i.deleteEmailDomains=vu,i.deleteForm=Kl,i.deleteFormIdentifier=Wu,i.deleteFormIdentifierValue=al,i.deleteFormIdentifierValues=rl,i.deleteFormIdentifiers=Ku,i.deleteFormRevision=Vl,i.deleteFormRevisionAttachment=Tl,i.deleteFormRevisionAttachments=Ol,i.deleteFormRevisions=ii,i.deleteFormSubmission=Io,i.deleteFormSubmissionAttachment=ao,i.deleteFormSubmissionAttachments=di,i.deleteFormSubmissions=lt,i.deleteForms=Yl,i.deleteGeoImage=qo,i.deleteGeoImages=Co,i.deleteIssue=Qh,i.deleteIssueAssociation=Jo,i.deleteIssueAssociations=Tt,i.deleteIssueAttachment=hh,i.deleteIssueAttachments=Ai,i.deleteIssueComment=Uh,i.deleteIssueCommentAttachment=gh,i.deleteIssueCommentAttachments=Mh,i.deleteIssueComments=Lh,i.deleteIssueType=py,i.deleteIssueTypeAttachment=hm,i.deleteIssueTypeAttachments=mm,i.deleteIssueTypeFieldValues=Um,i.deleteIssueTypeFieldValuesAttachment=mp,i.deleteIssueTypeFieldValuesAttachments=Di,i.deleteIssueTypeFieldValuesMany=Lm,i.deleteIssueTypeFields=ep,i.deleteIssueTypeFieldsAttachment=gm,i.deleteIssueTypeFieldsAttachments=Mm,i.deleteIssueTypeFieldsMany=tp,i.deleteIssueTypeIdentifier=Mp,i.deleteIssueTypeIdentifierValue=Lp,i.deleteIssueTypeIdentifierValues=kp,i.deleteIssueTypeIdentifiers=Rp,i.deleteIssueTypePriorities=sy,i.deleteIssueTypePriority=ty,i.deleteIssueTypeStatus=Ry,i.deleteIssueTypeStatuses=wy,i.deleteIssueTypes=yy,i.deleteIssueUpdate=Xi,i.deleteIssueUpdates=Qi,i.deleteIssues=gi,i.deleteOrganization=Ff,i.deleteOrganizationAccess=uf,i.deleteOrganizationAccesses=lf,i.deleteOrganizations=bf,i.deleteProcedure=IA,i.deleteProcedureFieldValues=CP,i.deleteProcedureFieldValuesAttachment=bP,i.deleteProcedureFieldValuesAttachments=Jn,i.deleteProcedureFieldValuesMany=$P,i.deleteProcedureInitiative=aA,i.deleteProcedureInitiatives=rA,i.deleteProcedureStep=bO,i.deleteProcedureStepAssignee=jA,i.deleteProcedureStepAssignees=qA,i.deleteProcedureStepComment=JA,i.deleteProcedureStepComments=XA,i.deleteProcedureStepDefaultAssignee=lI,i.deleteProcedureStepDefaultAssignees=oI,i.deleteProcedureStepDefaultReviewer=bI,i.deleteProcedureStepDefaultReviewers=_I,i.deleteProcedureStepEvent=CI,i.deleteProcedureStepEvents=$I,i.deleteProcedureStepFieldValues=qT,i.deleteProcedureStepFieldValuesAttachment=FT,i.deleteProcedureStepFieldValuesAttachments=Vn,i.deleteProcedureStepFieldValuesMany=CT,i.deleteProcedureStepFieldValuesReview=JT,i.deleteProcedureStepFieldValuesReviews=Cn,i.deleteProcedureStepFields=oT,i.deleteProcedureStepFieldsAttachment=XI,i.deleteProcedureStepFieldsAttachments=Mn,i.deleteProcedureStepFieldsMany=hT,i.deleteProcedureStepReviewer=lO,i.deleteProcedureStepReviewers=oO,i.deleteProcedureSteps=_O,i.deleteProcedureType=QP,i.deleteProcedureTypeAttachment=qO,i.deleteProcedureTypeAttachments=CO,i.deleteProcedureTypeFields=oP,i.deleteProcedureTypeFieldsAttachment=XO,i.deleteProcedureTypeFieldsAttachments=QO,i.deleteProcedureTypeFieldsMany=hP,i.deleteProcedureTypes=xP,i.deleteProcedures=Ft,i.deleteProject=WS,i.deleteProjectAccess=Gf,i.deleteProjectAccesses=Hf,i.deleteProjectAttachment=iS,i.deleteProjectAttachments=nS,i.deleteProjectComment=SS,i.deleteProjectComments=AS,i.deleteProjectFile=ES,i.deleteProjectFiles=BS,i.deleteProjects=KS,i.deleteTeam=MF,i.deleteTeamMembership=mF,i.deleteTeamMemberships=pF,i.deleteTeams=RF,i.deleteUser=nn,i.deleteUsers=Jy,i.dequeue=$F,i.discard=LF,i.documentAttachmentReducer=au,i.documentAttachmentSlice=Gs,i.documentSlice=Ws,i.documentsReducer=Su,i.emailDomainsReducer=zu,i.emailDomainsSlice=Ys,i.emailRegex=Mb,i.enqueue=CF,i.enqueueRequest=Bf,i.extractResponseFromError=NF,i.fallbackToEmptyArray=S,i.fallbackToEmptyObject=hs,i.fetchBlobFromObjectUrl=Mc,i.fetchFileFromObjectUrl=Rc,i.fileReducer=qu,i.fileSlice=Js,i.formIdentifierReducer=Xu,i.formIdentifierSlice=Xs,i.formIdentifierValueReducer=ol,i.formIdentifierValueSlice=xs,i.formReducer=Zl,i.formRevisionAttachmentReducer=_l,i.formRevisionAttachmentSlice=ei,i.formRevisionReducer=Cl,i.formRevisionsSlice=ti,i.formSlice=ni,i.formSubmissionAttachmentReducer=oo,i.formSubmissionAttachmentSlice=ai,i.formSubmissionReducer=Ro,i.formSubmissionSlice=hi,i.geoImageReducer=ko,i.geoImageSlice=mi,i.getClientSDK=YF,i.getClientStore=gt,i.getDocumentSubTree=Dc,i.getDocumentTrees=Rb,i.getFileExtension=gc,i.getLocalDateString=_c,i.getLocalRelativeDateString=fb,i.getOutboxCoordinator=ft,i.getRenamedFile=Ib,i.getRequestDescription=A,i.getS3FileKey=Ab,i.hashFile=qt,i.initSDK=hR,i.initializeAssetAttachments=Nc,i.initializeAssetComments=sa,i.initializeAssetTypeAttachments=wa,i.initializeAssetTypeFieldValues=wr,i.initializeAssetTypeFieldValuesAttachments=fr,i.initializeAssetTypeFields=sr,i.initializeAssetTypeFieldsAttachments=ka,i.initializeAssetTypeIdentifierValues=id,i.initializeAssetTypeIdentifiers=Nr,i.initializeAssetTypeStatuses=Ed,i.initializeAssetTypes=Sd,i.initializeAssets=fa,i.initializeConversations=qc,i.initializeDocumentAttachments=Yd,i.initializeDocuments=du,i.initializeEmailDomains=Pu,i.initializeFormIdentifierValues=xu,i.initializeFormIdentifiers=$u,i.initializeFormRevisionAttachments=ml,i.initializeFormRevisions=Ml,i.initializeFormSubmissionAttachments=eo,i.initializeFormSubmissions=mo,i.initializeForms=Ul,i.initializeGeoImages=vo,i.initializeIssueAssociations=Go,i.initializeIssueAttachments=ah,i.initializeIssueCommentAttachments=Ih,i.initializeIssueComments=Vh,i.initializeIssueTypeAttachments=cm,i.initializeIssueTypeFieldValues=Vm,i.initializeIssueTypeFieldValuesAttachments=rp,i.initializeIssueTypeFields=Km,i.initializeIssueTypeFieldsAttachments=Im,i.initializeIssueTypeIdentifierValues=zp,i.initializeIssueTypeIdentifiers=Tp,i.initializeIssueTypePriorities=Yp,i.initializeIssueTypeStatuses=Oy,i.initializeIssueTypes=ry,i.initializeIssueUpdates=zy,i.initializeIssues=Wh,i.initializeOrganizationAccesses=tf,i.initializeOrganizations=ff,i.initializeProcedureFieldValues=EP,i.initializeProcedureFieldValuesAttachments=AP,i.initializeProcedureInitiatives=xS,i.initializeProcedureStepAssignees=wA,i.initializeProcedureStepComments=NA,i.initializeProcedureStepDefaultAssignees=iI,i.initializeProcedureStepDefaultReviewers=SI,i.initializeProcedureStepEvents=EI,i.initializeProcedureStepFieldValues=vT,i.initializeProcedureStepFieldValuesAttachments=ST,i.initializeProcedureStepFieldValuesReviews=GT,i.initializeProcedureStepFields=nT,i.initializeProcedureStepFieldsAttachments=HI,i.initializeProcedureStepReviewers=iO,i.initializeProcedureSteps=SO,i.initializeProcedureTypeAttachments=vO,i.initializeProcedureTypeFields=nP,i.initializeProcedureTypeFieldsAttachments=GO,i.initializeProcedureTypes=HP,i.initializeProcedures=mA,i.initializeProjectAccesses=qf,i.initializeProjectAttachments=Jf,i.initializeProjectComments=lS,i.initializeProjectFiles=bS,i.initializeProjects=$S,i.initializeTeamMemberships=aF,i.initializeTeams=TF,i.initializeUsers=Gy,i.isImageFile=Tb,i.isObjectUrl=wc,i.isToday=yb,i.issueAssociationReducer=nh,i.issueAssociationSlice=yi,i.issueAttachmentReducer=Sh,i.issueAttachmentSlice=fi,i.issueCommentAttachmentReducer=Eh,i.issueCommentAttachmentSlice=Ti,i.issueCommentReducer=Gh,i.issueCommentSlice=Pi,i.issueReducer=im,i.issueSlice=bi,i.issueTypeAttachmentReducer=Sm,i.issueTypeAttachmentSlice=Mi,i.issueTypeFieldValuesAttachmentReducer=Ap,i.issueTypeFieldValuesAttachmentSlice=Vi,i.issueTypeFieldValuesReducer=Hm,i.issueTypeFieldValuesSlice=Ei,i.issueTypeFieldsAttachmentReducer=Em,i.issueTypeFieldsAttachmentSlice=wi,i.issueTypeFieldsReducer=cp,i.issueTypeFieldsSlice=Bi,i.issueTypeIdentifierReducer=Bp,i.issueTypeIdentifierSlice=qi,i.issueTypeIdentifierValueReducer=Wp,i.issueTypeIdentifierValueSlice=$i,i.issueTypePriorityReducer=cy,i.issueTypePrioritySlice=Ui,i.issueTypePrioritySortFn=Vc,i.issueTypeReducer=Iy,i.issueTypeSlice=Ni,i.issueTypeStatusReducer=By,i.issueTypeStatusSlice=Hi,i.issueTypeStatusSortFn=Bc,i.issueUpdateReducer=ky,i.issueUpdateSlice=Yi,i.logOnlyOnce=Ob,i.markAsDeleted=Vf,i.markForDeletion=q_,i.memoize=os,i.organizationAccessReducer=of,i.organizationAccessSlice=an,i.organizationReducer=wf,i.organizationSlice=rn,i.outboxReducer=Df,i.outboxSlice=dn,i.overmapEnhancer=Cg,i.overmapReducer=zg,i.overmapReducers=VF,i.performRequest=uc,i.performRequestFromAction=UF,i.procedureFieldValuesAttachmentReducer=_P,i.procedureFieldValuesAttachmentSlice=Yn,i.procedureFieldValuesReducer=UP,i.procedureFieldValuesSlice=Qn,i.procedureInitiativeReducer=dA,i.procedureInitiativeSlice=fn,i.procedureReducer=TA,i.procedureSlice=Sn,i.procedureStepAssigneeReducer=LA,i.procedureStepAssigneeSlice=An,i.procedureStepCommentReducer=tI,i.procedureStepCommentSlice=In,i.procedureStepDefaultAssigneeReducer=yI,i.procedureStepDefaultAssigneeSlice=Tn,i.procedureStepDefaultReviewerReducer=wI,i.procedureStepDefaultReviewerSlice=Pn,i.procedureStepEventReducer=NI,i.procedureStepEventSlice=bn,i.procedureStepFieldValuesAttachmentReducer=RT,i.procedureStepFieldValuesAttachmentSlice=En,i.procedureStepFieldValuesReducer=$T,i.procedureStepFieldValuesReviewReducer=tO,i.procedureStepFieldValuesReviewSlice=jn,i.procedureStepFieldValuesSlice=Dn,i.procedureStepFieldsAttachmentReducer=sT,i.procedureStepFieldsAttachmentSlice=_n,i.procedureStepFieldsReducer=yT,i.procedureStepFieldsSlice=wn,i.procedureStepReducer=gO,i.procedureStepReviewerReducer=yO,i.procedureStepReviewerSlice=$n,i.procedureStepSlice=Un,i.procedureTypeAttachmentReducer=$O,i.procedureTypeAttachmentSlice=Nn,i.procedureTypeFieldsAttachmentReducer=xO,i.procedureTypeFieldsAttachmentSlice=Hn,i.procedureTypeFieldsReducer=mP,i.procedureTypeFieldsSlice=Kn,i.procedureTypeReducer=eF,i.procedureTypeSlice=ec,i.projectAccessReducer=Wf,i.projectAccessSlice=un,i.projectAttachmentReducer=dS,i.projectAttachmentSlice=on,i.projectCommentReducer=PS,i.projectCommentSlice=mn,i.projectFileReducer=qS,i.projectFileSlice=pn,i.projectReducer=YS,i.projectSlice=yn,i.rehydratedReducer=nF,i.rehydratedSlice=sc,i.restructureSelectorWithArgs=y,i.runMiddleware=QF,i.selectAccessToken=Jb,i.selectAccessesByUserOfProject=$_,i.selectAccessibleProjects=G_,i.selectActiveOrganizationAccess=V_,i.selectAllDocumentAttachments=Hs,i.selectAssetAttachmentById=Xc,i.selectAssetAttachmentMapping=Jc,i.selectAssetAttachments=Ts,i.selectAssetAttachmentsByIds=Qc,i.selectAssetById=_a,i.selectAssetCommentById=la,i.selectAssetCommentMapping=ua,i.selectAssetComments=Lt,i.selectAssetCommentsByIds=oa,i.selectAssetTypeAttachmentById=qa,i.selectAssetTypeAttachmentMapping=ja,i.selectAssetTypeAttachments=Rs,i.selectAssetTypeAttachmentsByIds=Ca,i.selectAssetTypeById=Md,i.selectAssetTypeFieldValues=Nt,i.selectAssetTypeFieldValuesAttachmentById=br,i.selectAssetTypeFieldValuesAttachments=Ds,i.selectAssetTypeFieldValuesAttachmentsByIds=_r,i.selectAssetTypeFieldValuesAttachmentsMapping=Fr,i.selectAssetTypeFieldValuesById=$r,i.selectAssetTypeFieldValuesByIds=Ur,i.selectAssetTypeFieldValuesMapping=Cr,i.selectAssetTypeFieldValuesOfAsset=Lb,i.selectAssetTypeFields=wt,i.selectAssetTypeFieldsAttachmentById=Qa,i.selectAssetTypeFieldsAttachments=vs,i.selectAssetTypeFieldsAttachmentsByIds=xa,i.selectAssetTypeFieldsAttachmentsMapping=Xa,i.selectAssetTypeFieldsById=hr,i.selectAssetTypeFieldsByIds=mr,i.selectAssetTypeFieldsMapping=or,i.selectAssetTypeFieldsOfAssetType=$b,i.selectAssetTypeIdentifierById=xr,i.selectAssetTypeIdentifierMapping=Qr,i.selectAssetTypeIdentifierValueById=md,i.selectAssetTypeIdentifierValueMapping=hd,i.selectAssetTypeIdentifierValues=Gt,i.selectAssetTypeIdentifierValuesByIds=pd,i.selectAssetTypeIdentifierValuesOfAsset=Gb,i.selectAssetTypeIdentifierValuesOfIdentifier=Hb,i.selectAssetTypeIdentifiers=Cs,i.selectAssetTypeIdentifiersByIds=ed,i.selectAssetTypeIdentifiersOfAssetType=Nb,i.selectAssetTypeStatusById=Ld,i.selectAssetTypeStatusMapping=Ud,i.selectAssetTypeStatuses=Ns,i.selectAssetTypeStatusesByIds=kd,i.selectAssetTypeStatusesOfAssetType=Kb,i.selectAssetTypeValuesOfAssetType=kb,i.selectAssetTypes=Ls,i.selectAssetTypesByIds=Rd,i.selectAssetTypesMapping=gd,i.selectAssetTypesOfOrganization=Wb,i.selectAssets=kt,i.selectAssetsByIds=ga,i.selectAssetsMapping=Fa,i.selectAssetsOfAssetType=ba,i.selectAssetsOfProject=qb,i.selectAttachmentsOfAsset=xc,i.selectAttachmentsOfAssetType=$a,i.selectAttachmentsOfAssetTypeFieldValues=gr,i.selectAttachmentsOfAssetTypeFields=Cb,i.selectAttachmentsOfDocument=Qb,i.selectAttachmentsOfFormRevision=d_,i.selectAttachmentsOfFormSubmission=lo,i.selectAttachmentsOfIssue=ph,i.selectAttachmentsOfIssueComment=f_,i.selectAttachmentsOfIssueType=I_,i.selectAttachmentsOfIssueTypeFieldValues=Sp,i.selectAttachmentsOfIssueTypeFields=T_,i.selectAttachmentsOfProcedureFieldValues=wP,i.selectAttachmentsOfProcedureStepFieldValues=MT,i.selectAttachmentsOfProcedureStepFields=xI,i.selectAttachmentsOfProcedureType=Og,i.selectAttachmentsOfProcedureTypeFields=Pg,i.selectAttachmentsOfProject=L_,i.selectCommentsOfAsset=ha,i.selectCommentsOfAssets=ma,i.selectCommentsOfIssue=S_,i.selectCommentsOfProject=k_,i.selectCommentsOfProjects=N_,i.selectConversation=jb,i.selectConversationMapping=fs,i.selectConversations=Db,i.selectCurrentUser=Qy,i.selectDeletedRequests=D_,i.selectDescendantsOfDocument=Tu,i.selectDocumentAttachmentById=nu,i.selectDocumentAttachmentMapping=iu,i.selectDocumentAttachmentsByIds=cu,i.selectDocumentById=Au,i.selectDocuments=Wt,i.selectDocumentsByIds=Iu,i.selectDocumentsMapping=Ks,i.selectEmailDomainById=Bu,i.selectEmailDomains=Zs,i.selectEmailDomainsAsMapping=Eu,i.selectEmailDomainsByIds=Vu,i.selectEmailDomainsOfOrganization=t_,i.selectFieldValuesOfProcedure=_g,i.selectFormById=Xl,i.selectFormIdentifierById=Zu,i.selectFormIdentifierMapping=Yu,i.selectFormIdentifierValueById=ul,i.selectFormIdentifierValueMapping=dl,i.selectFormIdentifierValues=Kt,i.selectFormIdentifierValuesByIds=ll,i.selectFormIdentifierValuesOfFormSubmission=a_,i.selectFormIdentifierValuesOfIdentifier=r_,i.selectFormIdentifiers=Qs,i.selectFormIdentifiersByIds=Ju,i.selectFormIdentifiersOfForm=c_,i.selectFormMapping=Jl,i.selectFormRevisionAttachmentById=Fl,i.selectFormRevisionAttachments=Pl,i.selectFormRevisionAttachmentsByIds=bl,i.selectFormRevisionAttachmentsMapping=Yt,i.selectFormRevisionById=Dl,i.selectFormRevisionMapping=zl,i.selectFormRevisions=Zt,i.selectFormRevisionsByIds=jl,i.selectFormRevisionsOfForm=ql,i.selectFormSubmissionAttachemntsByIds=oi,i.selectFormSubmissionAttachmentById=ro,i.selectFormSubmissionAttachments=li,i.selectFormSubmissionAttachmentsByIds=uo,i.selectFormSubmissionAttachmentsMapping=ui,i.selectFormSubmissionById=Oo,i.selectFormSubmissions=k,i.selectFormSubmissionsByIds=Po,i.selectFormSubmissionsMapping=To,i.selectFormSubmissionsOfAsset=go,i.selectFormSubmissionsOfAssets=Mo,i.selectFormSubmissionsOfForm=Fo,i.selectFormSubmissionsOfIssue=bo,i.selectFormSubmissionsOfIssues=_o,i.selectFormSubmissionsOfOrganization=o_,i.selectFormSubmissionsOfOrganizationAndForm=p_,i.selectFormSubmissionsOfProject=h_,i.selectFormSubmissionsOfProjectAndForm=m_,i.selectForms=ci,i.selectFormsByIds=Ql,i.selectFormsOfOrganization=l_,i.selectGeoImageById=Uo,i.selectGeoImageMapping=$o,i.selectGeoImages=pi,i.selectGeoImagesByIds=Lo,i.selectGeoImagesOfProject=y_,i.selectIsLoggedIn=Xb,i.selectIssueAssociationById=Qo,i.selectIssueAssociationMapping=Xo,i.selectIssueAssociations=Ot,i.selectIssueAssociationsByIds=xo,i.selectIssueAssociationsOfAsset=sh,i.selectIssueAssociationsOfAssets=ih,i.selectIssueAssociationsOfIssue=th,i.selectIssueAssociationsOfIssues=eh,i.selectIssueAttachmentById=yh,i.selectIssueAttachmentMapping=mh,i.selectIssueAttachments=Ii,i.selectIssueAttachmentsByIds=fh,i.selectIssueById=em,i.selectIssueCommentAttachmentById=wh,i.selectIssueCommentAttachmentMapping=Rh,i.selectIssueCommentAttachments=Oi,i.selectIssueCommentAttachmentsByIds=vh,i.selectIssueCommentById=kh,i.selectIssueCommentMapping=Fi,i.selectIssueCommentsByIds=Nh,i.selectIssueMapping=xh,i.selectIssueTypeAttachmentById=ym,i.selectIssueTypeAttachmentMapping=pm,i.selectIssueTypeAttachments=Ri,i.selectIssueTypeAttachmentsByIds=fm,i.selectIssueTypeById=Sy,i.selectIssueTypeFieldValues=Xt,i.selectIssueTypeFieldValuesAttachmentById=yp,i.selectIssueTypeFieldValuesAttachments=ji,i.selectIssueTypeFieldValuesAttachmentsByIds=fp,i.selectIssueTypeFieldValuesAttachmentsMapping=pp,i.selectIssueTypeFieldValuesById=Nm,i.selectIssueTypeFieldValuesByIds=Gm,i.selectIssueTypeFieldValuesMapping=km,i.selectIssueTypeFieldValuesOfIssue=O_,i.selectIssueTypeFields=vt,i.selectIssueTypeFieldsAttachmentById=wm,i.selectIssueTypeFieldsAttachments=vi,i.selectIssueTypeFieldsAttachmentsByIds=vm,i.selectIssueTypeFieldsAttachmentsMapping=Rm,i.selectIssueTypeFieldsById=ip,i.selectIssueTypeFieldsByIds=np,i.selectIssueTypeFieldsMapping=sp,i.selectIssueTypeFieldsOfIssueType=P_,i.selectIssueTypeIdentifierById=vp,i.selectIssueTypeIdentifierMapping=wp,i.selectIssueTypeIdentifierValueById=Gp,i.selectIssueTypeIdentifierValueMapping=Np,i.selectIssueTypeIdentifierValues=Qt,i.selectIssueTypeIdentifierValuesByIds=Hp,i.selectIssueTypeIdentifierValuesOfIdentifier=M_,i.selectIssueTypeIdentifierValuesOfIssue=g_,i.selectIssueTypeIdentifiers=Ci,i.selectIssueTypeIdentifiersByIds=Ep,i.selectIssueTypeIdentifiersOfIssueType=__,i.selectIssueTypeMapping=fy,i.selectIssueTypePriorities=Li,i.selectIssueTypePrioritiesByIds=ny,i.selectIssueTypePrioritiesOfIssueType=R_,i.selectIssueTypePriorityById=ki,i.selectIssueTypePriorityMapping=iy,i.selectIssueTypeStatusById=Ki,i.selectIssueTypeStatusMapping=vy,i.selectIssueTypeStatuses=Wi,i.selectIssueTypeStatusesByIds=Ey,i.selectIssueTypeStatusesOfIssueType=v_,i.selectIssueTypeValuesOfIssueType=b_,i.selectIssueTypes=Gi,i.selectIssueTypesByIds=Ay,i.selectIssueTypesOfOrganization=w_,i.selectIssueUpdateById=$y,i.selectIssueUpdateMapping=xi,i.selectIssueUpdates=en,i.selectIssueUpdatesByIds=Uy,i.selectIssueUpdatesOfIssue=Ly,i.selectIssues=Jt,i.selectIssuesByIds=tm,i.selectIssuesOfIssueType=sm,i.selectIssuesOfProject=A_,i.selectLatestAssetTypeFieldsOfAssetType=Ub,i.selectLatestFieldsByProcedureStep=dg,i.selectLatestFormRevisionOfForm=u_,i.selectLatestIssueTypeFieldsOfIssueType=F_,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=yg,i.selectLatestProcedureStepFieldsOfProcedureStep=rg,i.selectLatestProcedureTypeFieldsOfProcedureType=bg,i.selectLatestRetryTime=j_,i.selectLatestReviewOfProcedureStepFieldValues=hg,i.selectMembershipsByUserOfTeam=vg,i.selectOrganizationAccessById=hf,i.selectOrganizationAccessMapping=ts,i.selectOrganizationAccessUserMapping=pf,i.selectOrganizationAccessesByIds=mf,i.selectOrganizationById=Mf,i.selectOrganizationDocuments=e_,i.selectOrganizations=gf,i.selectOrganizationsByIds=Rf,i.selectOrganizationsMapping=_f,i.selectProcedureById=PA,i.selectProcedureFieldValues=xn,i.selectProcedureFieldValuesAttachmentById=MP,i.selectProcedureFieldValuesAttachments=Xn,i.selectProcedureFieldValuesAttachmentsByIds=RP,i.selectProcedureFieldValuesAttachmentsMapping=gP,i.selectProcedureFieldValuesById=kP,i.selectProcedureFieldValuesByIds=NP,i.selectProcedureFieldValuesMapping=LP,i.selectProcedureInitiativeById=lA,i.selectProcedureInitiatives=ns,i.selectProcedureInitiativesByIds=oA,i.selectProcedureInitiativesMapping=uA,i.selectProcedureInitiativesOfProcedureType=K_,i.selectProcedureInitiativesOfProject=W_,i.selectProcedureStepAssigneeById=$A,i.selectProcedureStepAssignees=Bt,i.selectProcedureStepAssigneesByIds=UA,i.selectProcedureStepAssigneesMapping=CA,i.selectProcedureStepAssigneesOfProcedure=Z_,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=X_,i.selectProcedureStepAssigneesOfProcedureStep=J_,i.selectProcedureStepById=MO,i.selectProcedureStepCommentById=xA,i.selectProcedureStepComments=Vt,i.selectProcedureStepCommentsByIds=eI,i.selectProcedureStepCommentsMapping=QA,i.selectProcedureStepCommentsOfProcedure=Q_,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=eg,i.selectProcedureStepCommentsOfProcedureStep=x_,i.selectProcedureStepDefaultAssigneeById=mI,i.selectProcedureStepDefaultAssignees=On,i.selectProcedureStepDefaultAssigneesByIds=pI,i.selectProcedureStepDefaultAssigneesMapping=hI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=tg,i.selectProcedureStepDefaultReviewerById=MI,i.selectProcedureStepDefaultReviewers=Fn,i.selectProcedureStepDefaultReviewersByIds=RI,i.selectProcedureStepDefaultReviewersMapping=gI,i.selectProcedureStepDefaultReviewersOfProcedureStep=sg,i.selectProcedureStepEventById=LI,i.selectProcedureStepEvents=zt,i.selectProcedureStepEventsByIds=kI,i.selectProcedureStepEventsMapping=UI,i.selectProcedureStepEventsOfProcedure=ig,i.selectProcedureStepEventsOfProcedureAndProcedureStep=cg,i.selectProcedureStepEventsOfProcedureStep=ng,i.selectProcedureStepFieldValues=ht,i.selectProcedureStepFieldValuesAttachmentById=_T,i.selectProcedureStepFieldValuesAttachments=zn,i.selectProcedureStepFieldValuesAttachmentsByIds=gT,i.selectProcedureStepFieldValuesAttachmentsMapping=bT,i.selectProcedureStepFieldValuesById=LT,i.selectProcedureStepFieldValuesByIds=kT,i.selectProcedureStepFieldValuesMapping=UT,i.selectProcedureStepFieldValuesOfProcedure=ug,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=og,i.selectProcedureStepFieldValuesOfProcedureStep=lg,i.selectProcedureStepFieldValuesReviewById=QT,i.selectProcedureStepFieldValuesReviews=mt,i.selectProcedureStepFieldValuesReviewsByIds=xT,i.selectProcedureStepFieldValuesReviewsMapping=XT,i.selectProcedureStepFieldValuesReviewsOfProcedure=mg,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=pg,i.selectProcedureStepFields=cs,i.selectProcedureStepFieldsAttachmentById=eT,i.selectProcedureStepFieldsAttachments=Rn,i.selectProcedureStepFieldsAttachmentsByIds=tT,i.selectProcedureStepFieldsAttachmentsMapping=QI,i.selectProcedureStepFieldsById=mT,i.selectProcedureStepFieldsByIds=pT,i.selectProcedureStepFieldsMapping=vn,i.selectProcedureStepFieldsOfProcedureStep=ag,i.selectProcedureStepReviewerById=mO,i.selectProcedureStepReviewers=Dt,i.selectProcedureStepReviewersByIds=pO,i.selectProcedureStepReviewersMapping=hO,i.selectProcedureStepReviewersOfProcedure=fg,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=Ag,i.selectProcedureStepReviewersOfProcedureStep=Sg,i.selectProcedureSteps=kn,i.selectProcedureStepsByIds=RO,i.selectProcedureStepsMapping=Ln,i.selectProcedureStepsMappingOfProcedureType=Ig,i.selectProcedureStepsOfProcedureType=Tg,i.selectProcedureTypeAttachmentById=LO,i.selectProcedureTypeAttachmentMapping=UO,i.selectProcedureTypeAttachments=Gn,i.selectProcedureTypeAttachmentsByIds=kO,i.selectProcedureTypeById=sF,i.selectProcedureTypeFields=as,i.selectProcedureTypeFieldsAttachmentById=tP,i.selectProcedureTypeFieldsAttachments=Wn,i.selectProcedureTypeFieldsAttachmentsByIds=sP,i.selectProcedureTypeFieldsAttachmentsMapping=eP,i.selectProcedureTypeFieldsById=yP,i.selectProcedureTypeFieldsByIds=fP,i.selectProcedureTypeFieldsMapping=pP,i.selectProcedureTypeFieldsOfProcedureType=Fg,i.selectProcedureTypes=tc,i.selectProcedureTypesByIds=iF,i.selectProcedureTypesMapping=tF,i.selectProcedureTypesOfOrganization=gg,i.selectProcedures=ot,i.selectProceduresByIds=FA,i.selectProceduresMapping=OA,i.selectProceduresOfAsset=_A,i.selectProceduresOfAssets=gA,i.selectProceduresOfProcedureInitiative=MA,i.selectProceduresOfProcedureType=bA,i.selectProceduresOfProject=Y_,i.selectProjectAccessById=Kf,i.selectProjectAccessMapping=ln,i.selectProjectAccesses=Et,i.selectProjectAccessesByIds=Yf,i.selectProjectAccessesOfProject=C_,i.selectProjectAttachmentById=aS,i.selectProjectAttachmentMapping=cS,i.selectProjectAttachments=hn,i.selectProjectAttachmentsByIds=rS,i.selectProjectById=JS,i.selectProjectCommentById=TS,i.selectProjectCommentMapping=IS,i.selectProjectComments=ss,i.selectProjectCommentsByIds=OS,i.selectProjectDocuments=xb,i.selectProjectFileById=DS,i.selectProjectFileMapping=VS,i.selectProjectFiles=zS,i.selectProjectFilesByIds=jS,i.selectProjectMapping=ZS,i.selectProjects=is,i.selectProjectsByIds=XS,i.selectProjectsOfOrganization=H_,i.selectRehydrated=wg,i.selectReviewsOfProcedureStepFieldValues=eO,i.selectTeamById=vF,i.selectTeamMembershipById=SF,i.selectTeamMemberships=rs,i.selectTeamMembershipsByIds=AF,i.selectTeamMembershipsMapping=fF,i.selectTeams=cc,i.selectTeamsByIds=EF,i.selectTeamsMapping=wF,i.selectTeamsOfOrganization=Bg,i.selectUploadUrl=n_,i.selectUserById=es,i.selectUsers=xt,i.selectUsersByIds=xy,i.selectUsersMapping=cn,i.selectUsersOfOrganization=z_,i.selectUsersOfProject=U_,i.selectUsersOfTeam=Eg,i.setAsset=Oa,i.setAssetAttachment=Hc,i.setAssetAttachments=Wc,i.setAssetComment=na,i.setAssetComments=ca,i.setAssetType=Ad,i.setAssetTypeAttachment=Ea,i.setAssetTypeAttachments=Ba,i.setAssetTypeFieldValues=Br,i.setAssetTypeFieldValuesAttachment=Ar,i.setAssetTypeFieldValuesAttachments=Ir,i.setAssetTypeFieldValuesMany=Vr,i.setAssetTypeFields=cr,i.setAssetTypeFieldsAttachment=Ha,i.setAssetTypeFieldsAttachments=Wa,i.setAssetTypeFieldsMany=ar,i.setAssetTypeIdentifier=Wr,i.setAssetTypeIdentifierValue=ad,i.setAssetTypeIdentifierValues=rd,i.setAssetTypeIdentifiers=Kr,i.setAssetTypeStatus=zd,i.setAssetTypeStatuses=Dd,i.setAssetTypes=Id,i.setAssets=Pa,i.setClientSDK=KF,i.setClientStore=HF,i.setConversation=$c,i.setConversations=Eb,i.setCurrentUser=E_,i.setCurrentUserProfile=B_,i.setDocument=ou,i.setDocumentAttachment=Xd,i.setDocumentAttachments=Qd,i.setDocuments=hu,i.setEmailDomain=_u,i.setEmailDomains=gu,i.setForm=Nl,i.setFormIdentifier=ku,i.setFormIdentifierValue=sl,i.setFormIdentifierValues=il,i.setFormIdentifiers=Nu,i.setFormRevision=wl,i.setFormRevisionAttachment=fl,i.setFormRevisionAttachments=Sl,i.setFormRevisions=vl,i.setFormSubmission=po,i.setFormSubmissionAttachment=so,i.setFormSubmissionAttachments=io,i.setFormSubmissions=yo,i.setForms=Gl,i.setGeoImage=Eo,i.setGeoImages=Bo,i.setIssue=Yh,i.setIssueAssociation=Wo,i.setIssueAssociations=Ho,i.setIssueAttachment=dh,i.setIssueAttachments=uh,i.setIssueComment=jh,i.setIssueCommentAttachment=Ph,i.setIssueCommentAttachments=Fh,i.setIssueComments=qh,i.setIssueType=ly,i.setIssueTypeAttachment=dm,i.setIssueTypeAttachments=um,i.setIssueTypeFieldValues=jm,i.setIssueTypeFieldValuesAttachment=up,i.setIssueTypeFieldValuesAttachments=lp,i.setIssueTypeFieldValuesMany=qm,i.setIssueTypeFields=Jm,i.setIssueTypeFieldsAttachment=Pm,i.setIssueTypeFieldsAttachments=Fm,i.setIssueTypeFieldsMany=Xm,i.setIssueTypeIdentifier=Fp,i.setIssueTypeIdentifierValue=qp,i.setIssueTypeIdentifierValues=Cp,i.setIssueTypeIdentifiers=bp,i.setIssueTypePriorities=Qp,i.setIssueTypePriority=Xp,i.setIssueTypeStatus=by,i.setIssueTypeStatuses=_y,i.setIssueTypes=oy,i.setIssueUpdate=Dy,i.setIssueUpdates=jy,i.setIssues=Zh,i.setLoggedIn=Hd,i.setOrganization=Af,i.setOrganizationAccess=cf,i.setOrganizationAccesses=af,i.setOrganizations=Sf,i.setProcedure=yA,i.setProcedureFieldValues=zP,i.setProcedureFieldValuesAttachment=TP,i.setProcedureFieldValuesAttachments=OP,i.setProcedureFieldValuesMany=DP,i.setProcedureInitiative=sA,i.setProcedureInitiatives=iA,i.setProcedureStep=AO,i.setProcedureStepAssignee=BA,i.setProcedureStepAssignees=VA,i.setProcedureStepComment=WA,i.setProcedureStepComments=KA,i.setProcedureStepDefaultAssignee=aI,i.setProcedureStepDefaultAssignees=rI,i.setProcedureStepDefaultReviewer=TI,i.setProcedureStepDefaultReviewers=OI,i.setProcedureStepEvent=zI,i.setProcedureStepEvents=DI,i.setProcedureStepFieldValues=VT,i.setProcedureStepFieldValuesAttachment=IT,i.setProcedureStepFieldValuesAttachments=TT,i.setProcedureStepFieldValuesMany=zT,i.setProcedureStepFieldValuesReview=WT,i.setProcedureStepFieldValuesReviews=KT,i.setProcedureStepFields=rT,i.setProcedureStepFieldsAttachment=KI,i.setProcedureStepFieldsAttachments=YI,i.setProcedureStepFieldsMany=dT,i.setProcedureStepReviewer=aO,i.setProcedureStepReviewers=rO,i.setProcedureSteps=IO,i.setProcedureType=YP,i.setProcedureTypeAttachment=VO,i.setProcedureTypeAttachments=zO,i.setProcedureTypeFields=rP,i.setProcedureTypeFieldsAttachment=KO,i.setProcedureTypeFieldsAttachments=YO,i.setProcedureTypeFieldsMany=dP,i.setProcedureTypes=ZP,i.setProcedures=fA,i.setProject=LS,i.setProjectAccess=Uf,i.setProjectAccesses=Lf,i.setProjectAttachment=xf,i.setProjectAttachments=eS,i.setProjectComment=mS,i.setProjectComments=pS,i.setProjectFile=_S,i.setProjectFiles=gS,i.setProjects=US,i.setRehydrated=Rg,i.setTeam=FF,i.setTeamMembership=uF,i.setTeamMemberships=lF,i.setTeams=bF,i.setTokens=Yb,i.setUploadUrl=i_,i.setUser=Wy,i.setUsers=Hy,i.shallowEqual=ob,i.slugify=_b,i.spacesToDashesLower=bb,i.submittedAtModelSortFn=At,i.teamMembershipReducer=yF,i.teamMembershipSlice=ic,i.teamReducer=BF,i.teamSlice=nc,i.toFileNameSafeString=Fb,i.toUuidArray=w,i.toUuidIdRecord=Pb,i.truncate=gb,i.updateAsset=Aa,i.updateAssetAttachment=Kc,i.updateAssetAttachments=Yc,i.updateAssetComment=aa,i.updateAssetComments=ra,i.updateAssetType=Pd,i.updateAssetTypeAttachment=Va,i.updateAssetTypeAttachments=za,i.updateAssetTypeFieldValues=zr,i.updateAssetTypeFieldValuesAttachment=Tr,i.updateAssetTypeFieldValuesAttachments=Or,i.updateAssetTypeFieldValuesMany=Dr,i.updateAssetTypeFields=rr,i.updateAssetTypeFieldsAttachment=Ka,i.updateAssetTypeFieldsAttachments=Ya,i.updateAssetTypeFieldsMany=dr,i.updateAssetTypeIdentifier=Yr,i.updateAssetTypeIdentifierValue=dd,i.updateAssetTypeIdentifierValues=ud,i.updateAssetTypeIdentifiers=Zr,i.updateAssetTypeStatus=jd,i.updateAssetTypeStatuses=qd,i.updateAssetTypes=Fd,i.updateAssets=Ia,i.updateConversation=Uc,i.updateConversations=Bb,i.updateDocument=mu,i.updateDocumentAttachment=xd,i.updateDocumentAttachments=eu,i.updateDocuments=pu,i.updateEmailDomain=Mu,i.updateEmailDomains=Ru,i.updateForm=Hl,i.updateFormIdentifier=Gu,i.updateFormIdentifierValue=nl,i.updateFormIdentifierValues=cl,i.updateFormIdentifiers=Hu,i.updateFormRevision=El,i.updateFormRevisionAttachment=Al,i.updateFormRevisionAttachments=Il,i.updateFormRevisions=Bl,i.updateFormSubmission=So,i.updateFormSubmissionAttachment=no,i.updateFormSubmissionAttachments=co,i.updateFormSubmissions=Ao,i.updateForms=Wl,i.updateGeoImage=Do,i.updateGeoImages=jo,i.updateIssue=Jh,i.updateIssueAssociation=Ko,i.updateIssueAssociations=Yo,i.updateIssueAttachment=lh,i.updateIssueAttachments=oh,i.updateIssueComment=Ch,i.updateIssueCommentAttachment=bh,i.updateIssueCommentAttachments=_h,i.updateIssueComments=$h,i.updateIssueType=hy,i.updateIssueTypeAttachment=lm,i.updateIssueTypeAttachments=om,i.updateIssueTypeFieldValues=Cm,i.updateIssueTypeFieldValuesAttachment=op,i.updateIssueTypeFieldValuesAttachments=hp,i.updateIssueTypeFieldValuesMany=$m,i.updateIssueTypeFields=Qm,i.updateIssueTypeFieldsAttachment=bm,i.updateIssueTypeFieldsAttachments=_m,i.updateIssueTypeFieldsMany=xm,i.updateIssueTypeIdentifier=_p,i.updateIssueTypeIdentifierValue=$p,i.updateIssueTypeIdentifierValues=Up,i.updateIssueTypeIdentifiers=gp,i.updateIssueTypePriorities=ey,i.updateIssueTypePriority=xp,i.updateIssueTypeStatus=gy,i.updateIssueTypeStatuses=My,i.updateIssueTypes=my,i.updateIssueUpdate=qy,i.updateIssueUpdates=Cy,i.updateIssues=Xh,i.updateOrganization=Pf,i.updateOrganizationAccess=rf,i.updateOrganizationAccesses=df,i.updateOrganizations=Of,i.updateProcedure=SA,i.updateProcedureFieldValues=jP,i.updateProcedureFieldValuesAttachment=PP,i.updateProcedureFieldValuesAttachments=FP,i.updateProcedureFieldValuesMany=qP,i.updateProcedureInitiative=nA,i.updateProcedureInitiatives=cA,i.updateProcedureStep=PO,i.updateProcedureStepAssignee=zA,i.updateProcedureStepAssignees=DA,i.updateProcedureStepComment=YA,i.updateProcedureStepComments=ZA,i.updateProcedureStepDefaultAssignee=dI,i.updateProcedureStepDefaultAssignees=uI,i.updateProcedureStepDefaultReviewer=PI,i.updateProcedureStepDefaultReviewers=FI,i.updateProcedureStepEvent=jI,i.updateProcedureStepEvents=qI,i.updateProcedureStepFieldValues=DT,i.updateProcedureStepFieldValuesAttachment=OT,i.updateProcedureStepFieldValuesAttachments=PT,i.updateProcedureStepFieldValuesMany=jT,i.updateProcedureStepFieldValuesReview=YT,i.updateProcedureStepFieldValuesReviews=ZT,i.updateProcedureStepFields=uT,i.updateProcedureStepFieldsAttachment=ZI,i.updateProcedureStepFieldsAttachments=JI,i.updateProcedureStepFieldsMany=lT,i.updateProcedureStepReviewer=dO,i.updateProcedureStepReviewers=uO,i.updateProcedureSteps=FO,i.updateProcedureType=JP,i.updateProcedureTypeAttachment=DO,i.updateProcedureTypeAttachments=jO,i.updateProcedureTypeFields=uP,i.updateProcedureTypeFieldsAttachment=ZO,i.updateProcedureTypeFieldsAttachments=JO,i.updateProcedureTypeFieldsMany=lP,i.updateProcedureTypes=XP,i.updateProcedures=AA,i.updateProject=HS,i.updateProjectAccess=kf,i.updateProjectAccesses=Nf,i.updateProjectAttachment=tS,i.updateProjectAttachments=sS,i.updateProjectComment=yS,i.updateProjectComments=fS,i.updateProjectFile=wS,i.updateProjectFiles=vS,i.updateProjects=GS,i.updateTeam=_F,i.updateTeamMembership=oF,i.updateTeamMemberships=hF,i.updateTeams=gF,i.updateUser=Zy,i.updateUsers=Yy,i.useSelectorBuilder=lb,i.userReducer=Xy,i.userSlice=tn,i.uuidObj=O,i.uuidObjSortFn=ps,i.uuidSortFn=Ct,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|